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