1: <?php
2:
3: namespace Thelia\Model\om;
4:
5: use \Criteria;
6: use \Exception;
7: use \ModelCriteria;
8: use \ModelJoin;
9: use \PDO;
10: use \Propel;
11: use \PropelCollection;
12: use \PropelException;
13: use \PropelObjectCollection;
14: use \PropelPDO;
15: use Thelia\Model\Group;
16: use Thelia\Model\GroupDesc;
17: use Thelia\Model\GroupDescPeer;
18: use Thelia\Model\GroupDescQuery;
19:
20: /**
21: * Base class that represents a query for the 'group_desc' table.
22: *
23: *
24: *
25: * @method GroupDescQuery orderById($order = Criteria::ASC) Order by the id column
26: * @method GroupDescQuery orderByGroupId($order = Criteria::ASC) Order by the group_id column
27: * @method GroupDescQuery orderByLang($order = Criteria::ASC) Order by the lang column
28: * @method GroupDescQuery orderByTitle($order = Criteria::ASC) Order by the title column
29: * @method GroupDescQuery orderByDescription($order = Criteria::ASC) Order by the description column
30: * @method GroupDescQuery orderByChapo($order = Criteria::ASC) Order by the chapo column
31: * @method GroupDescQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
32: * @method GroupDescQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
33: *
34: * @method GroupDescQuery groupById() Group by the id column
35: * @method GroupDescQuery groupByGroupId() Group by the group_id column
36: * @method GroupDescQuery groupByLang() Group by the lang column
37: * @method GroupDescQuery groupByTitle() Group by the title column
38: * @method GroupDescQuery groupByDescription() Group by the description column
39: * @method GroupDescQuery groupByChapo() Group by the chapo column
40: * @method GroupDescQuery groupByCreatedAt() Group by the created_at column
41: * @method GroupDescQuery groupByUpdatedAt() Group by the updated_at column
42: *
43: * @method GroupDescQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
44: * @method GroupDescQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
45: * @method GroupDescQuery innerJoin($relation) Adds a INNER JOIN clause to the query
46: *
47: * @method GroupDescQuery leftJoinGroup($relationAlias = null) Adds a LEFT JOIN clause to the query using the Group relation
48: * @method GroupDescQuery rightJoinGroup($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Group relation
49: * @method GroupDescQuery innerJoinGroup($relationAlias = null) Adds a INNER JOIN clause to the query using the Group relation
50: *
51: * @method GroupDesc findOne(PropelPDO $con = null) Return the first GroupDesc matching the query
52: * @method GroupDesc findOneOrCreate(PropelPDO $con = null) Return the first GroupDesc matching the query, or a new GroupDesc object populated from the query conditions when no match is found
53: *
54: * @method GroupDesc findOneById(int $id) Return the first GroupDesc filtered by the id column
55: * @method GroupDesc findOneByGroupId(int $group_id) Return the first GroupDesc filtered by the group_id column
56: * @method GroupDesc findOneByLang(string $lang) Return the first GroupDesc filtered by the lang column
57: * @method GroupDesc findOneByTitle(string $title) Return the first GroupDesc filtered by the title column
58: * @method GroupDesc findOneByDescription(string $description) Return the first GroupDesc filtered by the description column
59: * @method GroupDesc findOneByChapo(string $chapo) Return the first GroupDesc filtered by the chapo column
60: * @method GroupDesc findOneByCreatedAt(string $created_at) Return the first GroupDesc filtered by the created_at column
61: * @method GroupDesc findOneByUpdatedAt(string $updated_at) Return the first GroupDesc filtered by the updated_at column
62: *
63: * @method array findById(int $id) Return GroupDesc objects filtered by the id column
64: * @method array findByGroupId(int $group_id) Return GroupDesc objects filtered by the group_id column
65: * @method array findByLang(string $lang) Return GroupDesc objects filtered by the lang column
66: * @method array findByTitle(string $title) Return GroupDesc objects filtered by the title column
67: * @method array findByDescription(string $description) Return GroupDesc objects filtered by the description column
68: * @method array findByChapo(string $chapo) Return GroupDesc objects filtered by the chapo column
69: * @method array findByCreatedAt(string $created_at) Return GroupDesc objects filtered by the created_at column
70: * @method array findByUpdatedAt(string $updated_at) Return GroupDesc objects filtered by the updated_at column
71: *
72: * @package propel.generator.Thelia.Model.om
73: */
74: abstract class BaseGroupDescQuery extends ModelCriteria
75: {
76: /**
77: * Initializes internal state of BaseGroupDescQuery object.
78: *
79: * @param string $dbName The dabase name
80: * @param string $modelName The phpName of a model, e.g. 'Book'
81: * @param string $modelAlias The alias for the model in this query, e.g. 'b'
82: */
83: public function __construct($dbName = 'thelia', $modelName = 'Thelia\\Model\\GroupDesc', $modelAlias = null)
84: {
85: parent::__construct($dbName, $modelName, $modelAlias);
86: }
87:
88: /**
89: * Returns a new GroupDescQuery object.
90: *
91: * @param string $modelAlias The alias of a model in the query
92: * @param GroupDescQuery|Criteria $criteria Optional Criteria to build the query from
93: *
94: * @return GroupDescQuery
95: */
96: public static function create($modelAlias = null, $criteria = null)
97: {
98: if ($criteria instanceof GroupDescQuery) {
99: return $criteria;
100: }
101: $query = new GroupDescQuery();
102: if (null !== $modelAlias) {
103: $query->setModelAlias($modelAlias);
104: }
105: if ($criteria instanceof Criteria) {
106: $query->mergeWith($criteria);
107: }
108:
109: return $query;
110: }
111:
112: /**
113: * Find object by primary key.
114: * Propel uses the instance pool to skip the database if the object exists.
115: * Go fast if the query is untouched.
116: *
117: * <code>
118: * $obj = $c->findPk(12, $con);
119: * </code>
120: *
121: * @param mixed $key Primary key to use for the query
122: * @param PropelPDO $con an optional connection object
123: *
124: * @return GroupDesc|GroupDesc[]|mixed the result, formatted by the current formatter
125: */
126: public function findPk($key, $con = null)
127: {
128: if ($key === null) {
129: return null;
130: }
131: if ((null !== ($obj = GroupDescPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {
132: // the object is alredy in the instance pool
133: return $obj;
134: }
135: if ($con === null) {
136: $con = Propel::getConnection(GroupDescPeer::DATABASE_NAME, Propel::CONNECTION_READ);
137: }
138: $this->basePreSelect($con);
139: if ($this->formatter || $this->modelAlias || $this->with || $this->select
140: || $this->selectColumns || $this->asColumns || $this->selectModifiers
141: || $this->map || $this->having || $this->joins) {
142: return $this->findPkComplex($key, $con);
143: } else {
144: return $this->findPkSimple($key, $con);
145: }
146: }
147:
148: /**
149: * Find object by primary key using raw SQL to go fast.
150: * Bypass doSelect() and the object formatter by using generated code.
151: *
152: * @param mixed $key Primary key to use for the query
153: * @param PropelPDO $con A connection object
154: *
155: * @return GroupDesc A model object, or null if the key is not found
156: * @throws PropelException
157: */
158: protected function findPkSimple($key, $con)
159: {
160: $sql = 'SELECT `ID`, `GROUP_ID`, `LANG`, `TITLE`, `DESCRIPTION`, `CHAPO`, `CREATED_AT`, `UPDATED_AT` FROM `group_desc` WHERE `ID` = :p0';
161: try {
162: $stmt = $con->prepare($sql);
163: $stmt->bindValue(':p0', $key, PDO::PARAM_INT);
164: $stmt->execute();
165: } catch (Exception $e) {
166: Propel::log($e->getMessage(), Propel::LOG_ERR);
167: throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);
168: }
169: $obj = null;
170: if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
171: $obj = new GroupDesc();
172: $obj->hydrate($row);
173: GroupDescPeer::addInstanceToPool($obj, (string) $key);
174: }
175: $stmt->closeCursor();
176:
177: return $obj;
178: }
179:
180: /**
181: * Find object by primary key.
182: *
183: * @param mixed $key Primary key to use for the query
184: * @param PropelPDO $con A connection object
185: *
186: * @return GroupDesc|GroupDesc[]|mixed the result, formatted by the current formatter
187: */
188: protected function findPkComplex($key, $con)
189: {
190: // As the query uses a PK condition, no limit(1) is necessary.
191: $criteria = $this->isKeepQuery() ? clone $this : $this;
192: $stmt = $criteria
193: ->filterByPrimaryKey($key)
194: ->doSelect($con);
195:
196: return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
197: }
198:
199: /**
200: * Find objects by primary key
201: * <code>
202: * $objs = $c->findPks(array(12, 56, 832), $con);
203: * </code>
204: * @param array $keys Primary keys to use for the query
205: * @param PropelPDO $con an optional connection object
206: *
207: * @return PropelObjectCollection|GroupDesc[]|mixed the list of results, formatted by the current formatter
208: */
209: public function findPks($keys, $con = null)
210: {
211: if ($con === null) {
212: $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);
213: }
214: $this->basePreSelect($con);
215: $criteria = $this->isKeepQuery() ? clone $this : $this;
216: $stmt = $criteria
217: ->filterByPrimaryKeys($keys)
218: ->doSelect($con);
219:
220: return $criteria->getFormatter()->init($criteria)->format($stmt);
221: }
222:
223: /**
224: * Filter the query by primary key
225: *
226: * @param mixed $key Primary key to use for the query
227: *
228: * @return GroupDescQuery The current query, for fluid interface
229: */
230: public function filterByPrimaryKey($key)
231: {
232:
233: return $this->addUsingAlias(GroupDescPeer::ID, $key, Criteria::EQUAL);
234: }
235:
236: /**
237: * Filter the query by a list of primary keys
238: *
239: * @param array $keys The list of primary key to use for the query
240: *
241: * @return GroupDescQuery The current query, for fluid interface
242: */
243: public function filterByPrimaryKeys($keys)
244: {
245:
246: return $this->addUsingAlias(GroupDescPeer::ID, $keys, Criteria::IN);
247: }
248:
249: /**
250: * Filter the query on the id column
251: *
252: * Example usage:
253: * <code>
254: * $query->filterById(1234); // WHERE id = 1234
255: * $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
256: * $query->filterById(array('min' => 12)); // WHERE id > 12
257: * </code>
258: *
259: * @param mixed $id The value to use as filter.
260: * Use scalar values for equality.
261: * Use array values for in_array() equivalent.
262: * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
263: * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
264: *
265: * @return GroupDescQuery The current query, for fluid interface
266: */
267: public function filterById($id = null, $comparison = null)
268: {
269: if (is_array($id) && null === $comparison) {
270: $comparison = Criteria::IN;
271: }
272:
273: return $this->addUsingAlias(GroupDescPeer::ID, $id, $comparison);
274: }
275:
276: /**
277: * Filter the query on the group_id column
278: *
279: * Example usage:
280: * <code>
281: * $query->filterByGroupId(1234); // WHERE group_id = 1234
282: * $query->filterByGroupId(array(12, 34)); // WHERE group_id IN (12, 34)
283: * $query->filterByGroupId(array('min' => 12)); // WHERE group_id > 12
284: * </code>
285: *
286: * @see filterByGroup()
287: *
288: * @param mixed $groupId The value to use as filter.
289: * Use scalar values for equality.
290: * Use array values for in_array() equivalent.
291: * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
292: * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
293: *
294: * @return GroupDescQuery The current query, for fluid interface
295: */
296: public function filterByGroupId($groupId = null, $comparison = null)
297: {
298: if (is_array($groupId)) {
299: $useMinMax = false;
300: if (isset($groupId['min'])) {
301: $this->addUsingAlias(GroupDescPeer::GROUP_ID, $groupId['min'], Criteria::GREATER_EQUAL);
302: $useMinMax = true;
303: }
304: if (isset($groupId['max'])) {
305: $this->addUsingAlias(GroupDescPeer::GROUP_ID, $groupId['max'], Criteria::LESS_EQUAL);
306: $useMinMax = true;
307: }
308: if ($useMinMax) {
309: return $this;
310: }
311: if (null === $comparison) {
312: $comparison = Criteria::IN;
313: }
314: }
315:
316: return $this->addUsingAlias(GroupDescPeer::GROUP_ID, $groupId, $comparison);
317: }
318:
319: /**
320: * Filter the query on the lang column
321: *
322: * Example usage:
323: * <code>
324: * $query->filterByLang('fooValue'); // WHERE lang = 'fooValue'
325: * $query->filterByLang('%fooValue%'); // WHERE lang LIKE '%fooValue%'
326: * </code>
327: *
328: * @param string $lang The value to use as filter.
329: * Accepts wildcards (* and % trigger a LIKE)
330: * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
331: *
332: * @return GroupDescQuery The current query, for fluid interface
333: */
334: public function filterByLang($lang = null, $comparison = null)
335: {
336: if (null === $comparison) {
337: if (is_array($lang)) {
338: $comparison = Criteria::IN;
339: } elseif (preg_match('/[\%\*]/', $lang)) {
340: $lang = str_replace('*', '%', $lang);
341: $comparison = Criteria::LIKE;
342: }
343: }
344:
345: return $this->addUsingAlias(GroupDescPeer::LANG, $lang, $comparison);
346: }
347:
348: /**
349: * Filter the query on the title column
350: *
351: * Example usage:
352: * <code>
353: * $query->filterByTitle('fooValue'); // WHERE title = 'fooValue'
354: * $query->filterByTitle('%fooValue%'); // WHERE title LIKE '%fooValue%'
355: * </code>
356: *
357: * @param string $title The value to use as filter.
358: * Accepts wildcards (* and % trigger a LIKE)
359: * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
360: *
361: * @return GroupDescQuery The current query, for fluid interface
362: */
363: public function filterByTitle($title = null, $comparison = null)
364: {
365: if (null === $comparison) {
366: if (is_array($title)) {
367: $comparison = Criteria::IN;
368: } elseif (preg_match('/[\%\*]/', $title)) {
369: $title = str_replace('*', '%', $title);
370: $comparison = Criteria::LIKE;
371: }
372: }
373:
374: return $this->addUsingAlias(GroupDescPeer::TITLE, $title, $comparison);
375: }
376:
377: /**
378: * Filter the query on the description column
379: *
380: * Example usage:
381: * <code>
382: * $query->filterByDescription('fooValue'); // WHERE description = 'fooValue'
383: * $query->filterByDescription('%fooValue%'); // WHERE description LIKE '%fooValue%'
384: * </code>
385: *
386: * @param string $description The value to use as filter.
387: * Accepts wildcards (* and % trigger a LIKE)
388: * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
389: *
390: * @return GroupDescQuery The current query, for fluid interface
391: */
392: public function filterByDescription($description = null, $comparison = null)
393: {
394: if (null === $comparison) {
395: if (is_array($description)) {
396: $comparison = Criteria::IN;
397: } elseif (preg_match('/[\%\*]/', $description)) {
398: $description = str_replace('*', '%', $description);
399: $comparison = Criteria::LIKE;
400: }
401: }
402:
403: return $this->addUsingAlias(GroupDescPeer::DESCRIPTION, $description, $comparison);
404: }
405:
406: /**
407: * Filter the query on the chapo column
408: *
409: * Example usage:
410: * <code>
411: * $query->filterByChapo('fooValue'); // WHERE chapo = 'fooValue'
412: * $query->filterByChapo('%fooValue%'); // WHERE chapo LIKE '%fooValue%'
413: * </code>
414: *
415: * @param string $chapo The value to use as filter.
416: * Accepts wildcards (* and % trigger a LIKE)
417: * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
418: *
419: * @return GroupDescQuery The current query, for fluid interface
420: */
421: public function filterByChapo($chapo = null, $comparison = null)
422: {
423: if (null === $comparison) {
424: if (is_array($chapo)) {
425: $comparison = Criteria::IN;
426: } elseif (preg_match('/[\%\*]/', $chapo)) {
427: $chapo = str_replace('*', '%', $chapo);
428: $comparison = Criteria::LIKE;
429: }
430: }
431:
432: return $this->addUsingAlias(GroupDescPeer::CHAPO, $chapo, $comparison);
433: }
434:
435: /**
436: * Filter the query on the created_at column
437: *
438: * Example usage:
439: * <code>
440: * $query->filterByCreatedAt('2011-03-14'); // WHERE created_at = '2011-03-14'
441: * $query->filterByCreatedAt('now'); // WHERE created_at = '2011-03-14'
442: * $query->filterByCreatedAt(array('max' => 'yesterday')); // WHERE created_at > '2011-03-13'
443: * </code>
444: *
445: * @param mixed $createdAt The value to use as filter.
446: * Values can be integers (unix timestamps), DateTime objects, or strings.
447: * Empty strings are treated as NULL.
448: * Use scalar values for equality.
449: * Use array values for in_array() equivalent.
450: * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
451: * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
452: *
453: * @return GroupDescQuery The current query, for fluid interface
454: */
455: public function filterByCreatedAt($createdAt = null, $comparison = null)
456: {
457: if (is_array($createdAt)) {
458: $useMinMax = false;
459: if (isset($createdAt['min'])) {
460: $this->addUsingAlias(GroupDescPeer::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
461: $useMinMax = true;
462: }
463: if (isset($createdAt['max'])) {
464: $this->addUsingAlias(GroupDescPeer::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
465: $useMinMax = true;
466: }
467: if ($useMinMax) {
468: return $this;
469: }
470: if (null === $comparison) {
471: $comparison = Criteria::IN;
472: }
473: }
474:
475: return $this->addUsingAlias(GroupDescPeer::CREATED_AT, $createdAt, $comparison);
476: }
477:
478: /**
479: * Filter the query on the updated_at column
480: *
481: * Example usage:
482: * <code>
483: * $query->filterByUpdatedAt('2011-03-14'); // WHERE updated_at = '2011-03-14'
484: * $query->filterByUpdatedAt('now'); // WHERE updated_at = '2011-03-14'
485: * $query->filterByUpdatedAt(array('max' => 'yesterday')); // WHERE updated_at > '2011-03-13'
486: * </code>
487: *
488: * @param mixed $updatedAt The value to use as filter.
489: * Values can be integers (unix timestamps), DateTime objects, or strings.
490: * Empty strings are treated as NULL.
491: * Use scalar values for equality.
492: * Use array values for in_array() equivalent.
493: * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
494: * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
495: *
496: * @return GroupDescQuery The current query, for fluid interface
497: */
498: public function filterByUpdatedAt($updatedAt = null, $comparison = null)
499: {
500: if (is_array($updatedAt)) {
501: $useMinMax = false;
502: if (isset($updatedAt['min'])) {
503: $this->addUsingAlias(GroupDescPeer::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
504: $useMinMax = true;
505: }
506: if (isset($updatedAt['max'])) {
507: $this->addUsingAlias(GroupDescPeer::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
508: $useMinMax = true;
509: }
510: if ($useMinMax) {
511: return $this;
512: }
513: if (null === $comparison) {
514: $comparison = Criteria::IN;
515: }
516: }
517:
518: return $this->addUsingAlias(GroupDescPeer::UPDATED_AT, $updatedAt, $comparison);
519: }
520:
521: /**
522: * Filter the query by a related Group object
523: *
524: * @param Group|PropelObjectCollection $group The related object(s) to use as filter
525: * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
526: *
527: * @return GroupDescQuery The current query, for fluid interface
528: * @throws PropelException - if the provided filter is invalid.
529: */
530: public function filterByGroup($group, $comparison = null)
531: {
532: if ($group instanceof Group) {
533: return $this
534: ->addUsingAlias(GroupDescPeer::GROUP_ID, $group->getId(), $comparison);
535: } elseif ($group instanceof PropelObjectCollection) {
536: if (null === $comparison) {
537: $comparison = Criteria::IN;
538: }
539:
540: return $this
541: ->addUsingAlias(GroupDescPeer::GROUP_ID, $group->toKeyValue('PrimaryKey', 'Id'), $comparison);
542: } else {
543: throw new PropelException('filterByGroup() only accepts arguments of type Group or PropelCollection');
544: }
545: }
546:
547: /**
548: * Adds a JOIN clause to the query using the Group relation
549: *
550: * @param string $relationAlias optional alias for the relation
551: * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
552: *
553: * @return GroupDescQuery The current query, for fluid interface
554: */
555: public function joinGroup($relationAlias = null, $joinType = Criteria::INNER_JOIN)
556: {
557: $tableMap = $this->getTableMap();
558: $relationMap = $tableMap->getRelation('Group');
559:
560: // create a ModelJoin object for this join
561: $join = new ModelJoin();
562: $join->setJoinType($joinType);
563: $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
564: if ($previousJoin = $this->getPreviousJoin()) {
565: $join->setPreviousJoin($previousJoin);
566: }
567:
568: // add the ModelJoin to the current object
569: if ($relationAlias) {
570: $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
571: $this->addJoinObject($join, $relationAlias);
572: } else {
573: $this->addJoinObject($join, 'Group');
574: }
575:
576: return $this;
577: }
578:
579: /**
580: * Use the Group relation Group object
581: *
582: * @see useQuery()
583: *
584: * @param string $relationAlias optional alias for the relation,
585: * to be used as main alias in the secondary query
586: * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
587: *
588: * @return \Thelia\Model\GroupQuery A secondary query class using the current class as primary query
589: */
590: public function useGroupQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
591: {
592: return $this
593: ->joinGroup($relationAlias, $joinType)
594: ->useQuery($relationAlias ? $relationAlias : 'Group', '\Thelia\Model\GroupQuery');
595: }
596:
597: /**
598: * Exclude object from result
599: *
600: * @param GroupDesc $groupDesc Object to remove from the list of results
601: *
602: * @return GroupDescQuery The current query, for fluid interface
603: */
604: public function prune($groupDesc = null)
605: {
606: if ($groupDesc) {
607: $this->addUsingAlias(GroupDescPeer::ID, $groupDesc->getId(), Criteria::NOT_EQUAL);
608: }
609:
610: return $this;
611: }
612:
613: // timestampable behavior
614:
615: /**
616: * Filter by the latest updated
617: *
618: * @param int $nbDays Maximum age of the latest update in days
619: *
620: * @return GroupDescQuery The current query, for fluid interface
621: */
622: public function recentlyUpdated($nbDays = 7)
623: {
624: return $this->addUsingAlias(GroupDescPeer::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
625: }
626:
627: /**
628: * Order by update date desc
629: *
630: * @return GroupDescQuery The current query, for fluid interface
631: */
632: public function lastUpdatedFirst()
633: {
634: return $this->addDescendingOrderByColumn(GroupDescPeer::UPDATED_AT);
635: }
636:
637: /**
638: * Order by update date asc
639: *
640: * @return GroupDescQuery The current query, for fluid interface
641: */
642: public function firstUpdatedFirst()
643: {
644: return $this->addAscendingOrderByColumn(GroupDescPeer::UPDATED_AT);
645: }
646:
647: /**
648: * Filter by the latest created
649: *
650: * @param int $nbDays Maximum age of in days
651: *
652: * @return GroupDescQuery The current query, for fluid interface
653: */
654: public function recentlyCreated($nbDays = 7)
655: {
656: return $this->addUsingAlias(GroupDescPeer::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
657: }
658:
659: /**
660: * Order by create date desc
661: *
662: * @return GroupDescQuery The current query, for fluid interface
663: */
664: public function lastCreatedFirst()
665: {
666: return $this->addDescendingOrderByColumn(GroupDescPeer::CREATED_AT);
667: }
668:
669: /**
670: * Order by create date asc
671: *
672: * @return GroupDescQuery The current query, for fluid interface
673: */
674: public function firstCreatedFirst()
675: {
676: return $this->addAscendingOrderByColumn(GroupDescPeer::CREATED_AT);
677: }
678: }
679: