Overview

Namespaces

  • PHP
  • Thelia
    • Action
    • Controller
    • Core
      • Bundle
      • Event
      • EventListener
      • Template
    • Exception
    • Log
      • Destination
    • Model
      • map
      • om
    • Routing
      • Matcher
    • Tools

Classes

  • BaseAccessory
  • BaseAccessoryPeer
  • BaseAccessoryQuery
  • BaseAddress
  • BaseAddressPeer
  • BaseAddressQuery
  • BaseAdmin
  • BaseAdminGroup
  • BaseAdminGroupPeer
  • BaseAdminGroupQuery
  • BaseAdminLog
  • BaseAdminLogPeer
  • BaseAdminLogQuery
  • BaseAdminPeer
  • BaseAdminQuery
  • BaseArea
  • BaseAreaPeer
  • BaseAreaQuery
  • BaseAttribute
  • BaseAttributeAv
  • BaseAttributeAvDesc
  • BaseAttributeAvDescPeer
  • BaseAttributeAvDescQuery
  • BaseAttributeAvI18n
  • BaseAttributeAvI18nPeer
  • BaseAttributeAvI18nQuery
  • BaseAttributeAvPeer
  • BaseAttributeAvQuery
  • BaseAttributeCategory
  • BaseAttributeCategoryPeer
  • BaseAttributeCategoryQuery
  • BaseAttributeCombination
  • BaseAttributeCombinationPeer
  • BaseAttributeCombinationQuery
  • BaseAttributeDesc
  • BaseAttributeDescPeer
  • BaseAttributeDescQuery
  • BaseAttributeI18n
  • BaseAttributeI18nPeer
  • BaseAttributeI18nQuery
  • BaseAttributePeer
  • BaseAttributeQuery
  • BaseCategory
  • BaseCategoryDesc
  • BaseCategoryDescPeer
  • BaseCategoryDescQuery
  • BaseCategoryI18n
  • BaseCategoryI18nPeer
  • BaseCategoryI18nQuery
  • BaseCategoryPeer
  • BaseCategoryQuery
  • BaseCategoryVersion
  • BaseCategoryVersionPeer
  • BaseCategoryVersionQuery
  • BaseCombination
  • BaseCombinationPeer
  • BaseCombinationQuery
  • BaseConfig
  • BaseConfigDesc
  • BaseConfigDescPeer
  • BaseConfigDescQuery
  • BaseConfigI18n
  • BaseConfigI18nPeer
  • BaseConfigI18nQuery
  • BaseConfigPeer
  • BaseConfigQuery
  • BaseContent
  • BaseContentAssoc
  • BaseContentAssocPeer
  • BaseContentAssocQuery
  • BaseContentDesc
  • BaseContentDescPeer
  • BaseContentDescQuery
  • BaseContentFolder
  • BaseContentFolderPeer
  • BaseContentFolderQuery
  • BaseContentI18n
  • BaseContentI18nPeer
  • BaseContentI18nQuery
  • BaseContentPeer
  • BaseContentQuery
  • BaseContentVersion
  • BaseContentVersionPeer
  • BaseContentVersionQuery
  • BaseCountry
  • BaseCountryDesc
  • BaseCountryDescPeer
  • BaseCountryDescQuery
  • BaseCountryI18n
  • BaseCountryI18nPeer
  • BaseCountryI18nQuery
  • BaseCountryPeer
  • BaseCountryQuery
  • BaseCoupon
  • BaseCouponOrder
  • BaseCouponOrderPeer
  • BaseCouponOrderQuery
  • BaseCouponPeer
  • BaseCouponQuery
  • BaseCouponRule
  • BaseCouponRulePeer
  • BaseCouponRuleQuery
  • BaseCurrency
  • BaseCurrencyPeer
  • BaseCurrencyQuery
  • BaseCustomer
  • BaseCustomerPeer
  • BaseCustomerQuery
  • BaseCustomerTitle
  • BaseCustomerTitleDesc
  • BaseCustomerTitleDescPeer
  • BaseCustomerTitleDescQuery
  • BaseCustomerTitleI18n
  • BaseCustomerTitleI18nPeer
  • BaseCustomerTitleI18nQuery
  • BaseCustomerTitlePeer
  • BaseCustomerTitleQuery
  • BaseDelivzone
  • BaseDelivzonePeer
  • BaseDelivzoneQuery
  • BaseDocument
  • BaseDocumentDesc
  • BaseDocumentDescPeer
  • BaseDocumentDescQuery
  • BaseDocumentI18n
  • BaseDocumentI18nPeer
  • BaseDocumentI18nQuery
  • BaseDocumentPeer
  • BaseDocumentQuery
  • BaseFeature
  • BaseFeatureAv
  • BaseFeatureAvDesc
  • BaseFeatureAvDescPeer
  • BaseFeatureAvDescQuery
  • BaseFeatureAvI18n
  • BaseFeatureAvI18nPeer
  • BaseFeatureAvI18nQuery
  • BaseFeatureAvPeer
  • BaseFeatureAvQuery
  • BaseFeatureCategory
  • BaseFeatureCategoryPeer
  • BaseFeatureCategoryQuery
  • BaseFeatureDesc
  • BaseFeatureDescPeer
  • BaseFeatureDescQuery
  • BaseFeatureI18n
  • BaseFeatureI18nPeer
  • BaseFeatureI18nQuery
  • BaseFeaturePeer
  • BaseFeatureProd
  • BaseFeatureProdPeer
  • BaseFeatureProdQuery
  • BaseFeatureQuery
  • BaseFolder
  • BaseFolderDesc
  • BaseFolderDescPeer
  • BaseFolderDescQuery
  • BaseFolderI18n
  • BaseFolderI18nPeer
  • BaseFolderI18nQuery
  • BaseFolderPeer
  • BaseFolderQuery
  • BaseFolderVersion
  • BaseFolderVersionPeer
  • BaseFolderVersionQuery
  • BaseGroup
  • BaseGroupDesc
  • BaseGroupDescPeer
  • BaseGroupDescQuery
  • BaseGroupI18n
  • BaseGroupI18nPeer
  • BaseGroupI18nQuery
  • BaseGroupModule
  • BaseGroupModulePeer
  • BaseGroupModuleQuery
  • BaseGroupPeer
  • BaseGroupQuery
  • BaseGroupResource
  • BaseGroupResourcePeer
  • BaseGroupResourceQuery
  • BaseImage
  • BaseImageDesc
  • BaseImageDescPeer
  • BaseImageDescQuery
  • BaseImageI18n
  • BaseImageI18nPeer
  • BaseImageI18nQuery
  • BaseImagePeer
  • BaseImageQuery
  • BaseLang
  • BaseLangPeer
  • BaseLangQuery
  • BaseMessage
  • BaseMessageDesc
  • BaseMessageDescPeer
  • BaseMessageDescQuery
  • BaseMessageI18n
  • BaseMessageI18nPeer
  • BaseMessageI18nQuery
  • BaseMessagePeer
  • BaseMessageQuery
  • BaseMessageVersion
  • BaseMessageVersionPeer
  • BaseMessageVersionQuery
  • BaseModuleDesc
  • BaseModuleDescPeer
  • BaseModuleDescQuery
  • BaseModuleI18n
  • BaseModuleI18nPeer
  • BaseModuleI18nQuery
  • BaseModulePeer
  • BaseOrder
  • BaseOrderAddress
  • BaseOrderAddressPeer
  • BaseOrderAddressQuery
  • BaseOrderFeature
  • BaseOrderFeaturePeer
  • BaseOrderFeatureQuery
  • BaseOrderPeer
  • BaseOrderProduct
  • BaseOrderProductPeer
  • BaseOrderProductQuery
  • BaseOrderQuery
  • BaseOrderStatus
  • BaseOrderStatusDesc
  • BaseOrderStatusDescPeer
  • BaseOrderStatusDescQuery
  • BaseOrderStatusI18n
  • BaseOrderStatusI18nPeer
  • BaseOrderStatusI18nQuery
  • BaseOrderStatusPeer
  • BaseOrderStatusQuery
  • BaseProduct
  • BaseProductCategory
  • BaseProductCategoryPeer
  • BaseProductCategoryQuery
  • BaseProductDesc
  • BaseProductDescPeer
  • BaseProductDescQuery
  • BaseProductI18n
  • BaseProductI18nPeer
  • BaseProductI18nQuery
  • BaseProductPeer
  • BaseProductQuery
  • BaseProductVersion
  • BaseProductVersionPeer
  • BaseProductVersionQuery
  • BaseResource
  • BaseResourceDesc
  • BaseResourceDescPeer
  • BaseResourceDescQuery
  • BaseResourceI18n
  • BaseResourceI18nPeer
  • BaseResourceI18nQuery
  • BaseResourcePeer
  • BaseResourceQuery
  • BaseRewriting
  • BaseRewritingPeer
  • BaseRewritingQuery
  • BaseStock
  • BaseStockPeer
  • BaseStockQuery
  • BaseTax
  • BaseTaxDesc
  • BaseTaxDescPeer
  • BaseTaxDescQuery
  • BaseTaxI18n
  • BaseTaxI18nPeer
  • BaseTaxI18nQuery
  • BaseTaxPeer
  • BaseTaxQuery
  • BaseTaxRule
  • BaseTaxRuleCountry
  • BaseTaxRuleCountryPeer
  • BaseTaxRuleCountryQuery
  • BaseTaxRuleDesc
  • BaseTaxRuleDescPeer
  • BaseTaxRuleDescQuery
  • BaseTaxRuleI18n
  • BaseTaxRuleI18nPeer
  • BaseTaxRuleI18nQuery
  • BaseTaxRulePeer
  • BaseTaxRuleQuery
  • Overview
  • Namespace
  • Class
  • Tree
  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\GroupResource;
 16: use Thelia\Model\Resource;
 17: use Thelia\Model\ResourceI18n;
 18: use Thelia\Model\ResourcePeer;
 19: use Thelia\Model\ResourceQuery;
 20: 
 21: /**
 22:  * Base class that represents a query for the 'resource' table.
 23:  *
 24:  *
 25:  *
 26:  * @method ResourceQuery orderById($order = Criteria::ASC) Order by the id column
 27:  * @method ResourceQuery orderByCode($order = Criteria::ASC) Order by the code column
 28:  * @method ResourceQuery orderByCreatedAt($order = Criteria::ASC) Order by the created_at column
 29:  * @method ResourceQuery orderByUpdatedAt($order = Criteria::ASC) Order by the updated_at column
 30:  *
 31:  * @method ResourceQuery groupById() Group by the id column
 32:  * @method ResourceQuery groupByCode() Group by the code column
 33:  * @method ResourceQuery groupByCreatedAt() Group by the created_at column
 34:  * @method ResourceQuery groupByUpdatedAt() Group by the updated_at column
 35:  *
 36:  * @method ResourceQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
 37:  * @method ResourceQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
 38:  * @method ResourceQuery innerJoin($relation) Adds a INNER JOIN clause to the query
 39:  *
 40:  * @method ResourceQuery leftJoinGroupResource($relationAlias = null) Adds a LEFT JOIN clause to the query using the GroupResource relation
 41:  * @method ResourceQuery rightJoinGroupResource($relationAlias = null) Adds a RIGHT JOIN clause to the query using the GroupResource relation
 42:  * @method ResourceQuery innerJoinGroupResource($relationAlias = null) Adds a INNER JOIN clause to the query using the GroupResource relation
 43:  *
 44:  * @method ResourceQuery leftJoinResourceI18n($relationAlias = null) Adds a LEFT JOIN clause to the query using the ResourceI18n relation
 45:  * @method ResourceQuery rightJoinResourceI18n($relationAlias = null) Adds a RIGHT JOIN clause to the query using the ResourceI18n relation
 46:  * @method ResourceQuery innerJoinResourceI18n($relationAlias = null) Adds a INNER JOIN clause to the query using the ResourceI18n relation
 47:  *
 48:  * @method Resource findOne(PropelPDO $con = null) Return the first Resource matching the query
 49:  * @method Resource findOneOrCreate(PropelPDO $con = null) Return the first Resource matching the query, or a new Resource object populated from the query conditions when no match is found
 50:  *
 51:  * @method Resource findOneById(int $id) Return the first Resource filtered by the id column
 52:  * @method Resource findOneByCode(string $code) Return the first Resource filtered by the code column
 53:  * @method Resource findOneByCreatedAt(string $created_at) Return the first Resource filtered by the created_at column
 54:  * @method Resource findOneByUpdatedAt(string $updated_at) Return the first Resource filtered by the updated_at column
 55:  *
 56:  * @method array findById(int $id) Return Resource objects filtered by the id column
 57:  * @method array findByCode(string $code) Return Resource objects filtered by the code column
 58:  * @method array findByCreatedAt(string $created_at) Return Resource objects filtered by the created_at column
 59:  * @method array findByUpdatedAt(string $updated_at) Return Resource objects filtered by the updated_at column
 60:  *
 61:  * @package    propel.generator.Thelia.Model.om
 62:  */
 63: abstract class BaseResourceQuery extends ModelCriteria
 64: {
 65:     /**
 66:      * Initializes internal state of BaseResourceQuery object.
 67:      *
 68:      * @param     string $dbName The dabase name
 69:      * @param     string $modelName The phpName of a model, e.g. 'Book'
 70:      * @param     string $modelAlias The alias for the model in this query, e.g. 'b'
 71:      */
 72:     public function __construct($dbName = 'thelia', $modelName = 'Thelia\\Model\\Resource', $modelAlias = null)
 73:     {
 74:         parent::__construct($dbName, $modelName, $modelAlias);
 75:     }
 76: 
 77:     /**
 78:      * Returns a new ResourceQuery object.
 79:      *
 80:      * @param     string $modelAlias The alias of a model in the query
 81:      * @param     ResourceQuery|Criteria $criteria Optional Criteria to build the query from
 82:      *
 83:      * @return ResourceQuery
 84:      */
 85:     public static function create($modelAlias = null, $criteria = null)
 86:     {
 87:         if ($criteria instanceof ResourceQuery) {
 88:             return $criteria;
 89:         }
 90:         $query = new ResourceQuery();
 91:         if (null !== $modelAlias) {
 92:             $query->setModelAlias($modelAlias);
 93:         }
 94:         if ($criteria instanceof Criteria) {
 95:             $query->mergeWith($criteria);
 96:         }
 97: 
 98:         return $query;
 99:     }
100: 
101:     /**
102:      * Find object by primary key.
103:      * Propel uses the instance pool to skip the database if the object exists.
104:      * Go fast if the query is untouched.
105:      *
106:      * <code>
107:      * $obj  = $c->findPk(12, $con);
108:      * </code>
109:      *
110:      * @param mixed $key Primary key to use for the query
111:      * @param     PropelPDO $con an optional connection object
112:      *
113:      * @return   Resource|Resource[]|mixed the result, formatted by the current formatter
114:      */
115:     public function findPk($key, $con = null)
116:     {
117:         if ($key === null) {
118:             return null;
119:         }
120:         if ((null !== ($obj = ResourcePeer::getInstanceFromPool((string) $key))) && !$this->formatter) {
121:             // the object is alredy in the instance pool
122:             return $obj;
123:         }
124:         if ($con === null) {
125:             $con = Propel::getConnection(ResourcePeer::DATABASE_NAME, Propel::CONNECTION_READ);
126:         }
127:         $this->basePreSelect($con);
128:         if ($this->formatter || $this->modelAlias || $this->with || $this->select
129:          || $this->selectColumns || $this->asColumns || $this->selectModifiers
130:          || $this->map || $this->having || $this->joins) {
131:             return $this->findPkComplex($key, $con);
132:         } else {
133:             return $this->findPkSimple($key, $con);
134:         }
135:     }
136: 
137:     /**
138:      * Find object by primary key using raw SQL to go fast.
139:      * Bypass doSelect() and the object formatter by using generated code.
140:      *
141:      * @param     mixed $key Primary key to use for the query
142:      * @param     PropelPDO $con A connection object
143:      *
144:      * @return   Resource A model object, or null if the key is not found
145:      * @throws   PropelException
146:      */
147:     protected function findPkSimple($key, $con)
148:     {
149:         $sql = 'SELECT `ID`, `CODE`, `CREATED_AT`, `UPDATED_AT` FROM `resource` WHERE `ID` = :p0';
150:         try {
151:             $stmt = $con->prepare($sql);
152:             $stmt->bindValue(':p0', $key, PDO::PARAM_INT);
153:             $stmt->execute();
154:         } catch (Exception $e) {
155:             Propel::log($e->getMessage(), Propel::LOG_ERR);
156:             throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);
157:         }
158:         $obj = null;
159:         if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
160:             $obj = new Resource();
161:             $obj->hydrate($row);
162:             ResourcePeer::addInstanceToPool($obj, (string) $key);
163:         }
164:         $stmt->closeCursor();
165: 
166:         return $obj;
167:     }
168: 
169:     /**
170:      * Find object by primary key.
171:      *
172:      * @param     mixed $key Primary key to use for the query
173:      * @param     PropelPDO $con A connection object
174:      *
175:      * @return Resource|Resource[]|mixed the result, formatted by the current formatter
176:      */
177:     protected function findPkComplex($key, $con)
178:     {
179:         // As the query uses a PK condition, no limit(1) is necessary.
180:         $criteria = $this->isKeepQuery() ? clone $this : $this;
181:         $stmt = $criteria
182:             ->filterByPrimaryKey($key)
183:             ->doSelect($con);
184: 
185:         return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
186:     }
187: 
188:     /**
189:      * Find objects by primary key
190:      * <code>
191:      * $objs = $c->findPks(array(12, 56, 832), $con);
192:      * </code>
193:      * @param     array $keys Primary keys to use for the query
194:      * @param     PropelPDO $con an optional connection object
195:      *
196:      * @return PropelObjectCollection|Resource[]|mixed the list of results, formatted by the current formatter
197:      */
198:     public function findPks($keys, $con = null)
199:     {
200:         if ($con === null) {
201:             $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);
202:         }
203:         $this->basePreSelect($con);
204:         $criteria = $this->isKeepQuery() ? clone $this : $this;
205:         $stmt = $criteria
206:             ->filterByPrimaryKeys($keys)
207:             ->doSelect($con);
208: 
209:         return $criteria->getFormatter()->init($criteria)->format($stmt);
210:     }
211: 
212:     /**
213:      * Filter the query by primary key
214:      *
215:      * @param     mixed $key Primary key to use for the query
216:      *
217:      * @return ResourceQuery The current query, for fluid interface
218:      */
219:     public function filterByPrimaryKey($key)
220:     {
221: 
222:         return $this->addUsingAlias(ResourcePeer::ID, $key, Criteria::EQUAL);
223:     }
224: 
225:     /**
226:      * Filter the query by a list of primary keys
227:      *
228:      * @param     array $keys The list of primary key to use for the query
229:      *
230:      * @return ResourceQuery The current query, for fluid interface
231:      */
232:     public function filterByPrimaryKeys($keys)
233:     {
234: 
235:         return $this->addUsingAlias(ResourcePeer::ID, $keys, Criteria::IN);
236:     }
237: 
238:     /**
239:      * Filter the query on the id column
240:      *
241:      * Example usage:
242:      * <code>
243:      * $query->filterById(1234); // WHERE id = 1234
244:      * $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
245:      * $query->filterById(array('min' => 12)); // WHERE id > 12
246:      * </code>
247:      *
248:      * @param     mixed $id The value to use as filter.
249:      *              Use scalar values for equality.
250:      *              Use array values for in_array() equivalent.
251:      *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
252:      * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
253:      *
254:      * @return ResourceQuery The current query, for fluid interface
255:      */
256:     public function filterById($id = null, $comparison = null)
257:     {
258:         if (is_array($id) && null === $comparison) {
259:             $comparison = Criteria::IN;
260:         }
261: 
262:         return $this->addUsingAlias(ResourcePeer::ID, $id, $comparison);
263:     }
264: 
265:     /**
266:      * Filter the query on the code column
267:      *
268:      * Example usage:
269:      * <code>
270:      * $query->filterByCode('fooValue');   // WHERE code = 'fooValue'
271:      * $query->filterByCode('%fooValue%'); // WHERE code LIKE '%fooValue%'
272:      * </code>
273:      *
274:      * @param     string $code The value to use as filter.
275:      *              Accepts wildcards (* and % trigger a LIKE)
276:      * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
277:      *
278:      * @return ResourceQuery The current query, for fluid interface
279:      */
280:     public function filterByCode($code = null, $comparison = null)
281:     {
282:         if (null === $comparison) {
283:             if (is_array($code)) {
284:                 $comparison = Criteria::IN;
285:             } elseif (preg_match('/[\%\*]/', $code)) {
286:                 $code = str_replace('*', '%', $code);
287:                 $comparison = Criteria::LIKE;
288:             }
289:         }
290: 
291:         return $this->addUsingAlias(ResourcePeer::CODE, $code, $comparison);
292:     }
293: 
294:     /**
295:      * Filter the query on the created_at column
296:      *
297:      * Example usage:
298:      * <code>
299:      * $query->filterByCreatedAt('2011-03-14'); // WHERE created_at = '2011-03-14'
300:      * $query->filterByCreatedAt('now'); // WHERE created_at = '2011-03-14'
301:      * $query->filterByCreatedAt(array('max' => 'yesterday')); // WHERE created_at > '2011-03-13'
302:      * </code>
303:      *
304:      * @param     mixed $createdAt The value to use as filter.
305:      *              Values can be integers (unix timestamps), DateTime objects, or strings.
306:      *              Empty strings are treated as NULL.
307:      *              Use scalar values for equality.
308:      *              Use array values for in_array() equivalent.
309:      *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
310:      * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
311:      *
312:      * @return ResourceQuery The current query, for fluid interface
313:      */
314:     public function filterByCreatedAt($createdAt = null, $comparison = null)
315:     {
316:         if (is_array($createdAt)) {
317:             $useMinMax = false;
318:             if (isset($createdAt['min'])) {
319:                 $this->addUsingAlias(ResourcePeer::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
320:                 $useMinMax = true;
321:             }
322:             if (isset($createdAt['max'])) {
323:                 $this->addUsingAlias(ResourcePeer::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
324:                 $useMinMax = true;
325:             }
326:             if ($useMinMax) {
327:                 return $this;
328:             }
329:             if (null === $comparison) {
330:                 $comparison = Criteria::IN;
331:             }
332:         }
333: 
334:         return $this->addUsingAlias(ResourcePeer::CREATED_AT, $createdAt, $comparison);
335:     }
336: 
337:     /**
338:      * Filter the query on the updated_at column
339:      *
340:      * Example usage:
341:      * <code>
342:      * $query->filterByUpdatedAt('2011-03-14'); // WHERE updated_at = '2011-03-14'
343:      * $query->filterByUpdatedAt('now'); // WHERE updated_at = '2011-03-14'
344:      * $query->filterByUpdatedAt(array('max' => 'yesterday')); // WHERE updated_at > '2011-03-13'
345:      * </code>
346:      *
347:      * @param     mixed $updatedAt The value to use as filter.
348:      *              Values can be integers (unix timestamps), DateTime objects, or strings.
349:      *              Empty strings are treated as NULL.
350:      *              Use scalar values for equality.
351:      *              Use array values for in_array() equivalent.
352:      *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
353:      * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
354:      *
355:      * @return ResourceQuery The current query, for fluid interface
356:      */
357:     public function filterByUpdatedAt($updatedAt = null, $comparison = null)
358:     {
359:         if (is_array($updatedAt)) {
360:             $useMinMax = false;
361:             if (isset($updatedAt['min'])) {
362:                 $this->addUsingAlias(ResourcePeer::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
363:                 $useMinMax = true;
364:             }
365:             if (isset($updatedAt['max'])) {
366:                 $this->addUsingAlias(ResourcePeer::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
367:                 $useMinMax = true;
368:             }
369:             if ($useMinMax) {
370:                 return $this;
371:             }
372:             if (null === $comparison) {
373:                 $comparison = Criteria::IN;
374:             }
375:         }
376: 
377:         return $this->addUsingAlias(ResourcePeer::UPDATED_AT, $updatedAt, $comparison);
378:     }
379: 
380:     /**
381:      * Filter the query by a related GroupResource object
382:      *
383:      * @param   GroupResource|PropelObjectCollection $groupResource  the related object to use as filter
384:      * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
385:      *
386:      * @return   ResourceQuery The current query, for fluid interface
387:      * @throws   PropelException - if the provided filter is invalid.
388:      */
389:     public function filterByGroupResource($groupResource, $comparison = null)
390:     {
391:         if ($groupResource instanceof GroupResource) {
392:             return $this
393:                 ->addUsingAlias(ResourcePeer::ID, $groupResource->getResourceId(), $comparison);
394:         } elseif ($groupResource instanceof PropelObjectCollection) {
395:             return $this
396:                 ->useGroupResourceQuery()
397:                 ->filterByPrimaryKeys($groupResource->getPrimaryKeys())
398:                 ->endUse();
399:         } else {
400:             throw new PropelException('filterByGroupResource() only accepts arguments of type GroupResource or PropelCollection');
401:         }
402:     }
403: 
404:     /**
405:      * Adds a JOIN clause to the query using the GroupResource relation
406:      *
407:      * @param     string $relationAlias optional alias for the relation
408:      * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
409:      *
410:      * @return ResourceQuery The current query, for fluid interface
411:      */
412:     public function joinGroupResource($relationAlias = null, $joinType = Criteria::INNER_JOIN)
413:     {
414:         $tableMap = $this->getTableMap();
415:         $relationMap = $tableMap->getRelation('GroupResource');
416: 
417:         // create a ModelJoin object for this join
418:         $join = new ModelJoin();
419:         $join->setJoinType($joinType);
420:         $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
421:         if ($previousJoin = $this->getPreviousJoin()) {
422:             $join->setPreviousJoin($previousJoin);
423:         }
424: 
425:         // add the ModelJoin to the current object
426:         if ($relationAlias) {
427:             $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
428:             $this->addJoinObject($join, $relationAlias);
429:         } else {
430:             $this->addJoinObject($join, 'GroupResource');
431:         }
432: 
433:         return $this;
434:     }
435: 
436:     /**
437:      * Use the GroupResource relation GroupResource object
438:      *
439:      * @see       useQuery()
440:      *
441:      * @param     string $relationAlias optional alias for the relation,
442:      *                                   to be used as main alias in the secondary query
443:      * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
444:      *
445:      * @return   \Thelia\Model\GroupResourceQuery A secondary query class using the current class as primary query
446:      */
447:     public function useGroupResourceQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
448:     {
449:         return $this
450:             ->joinGroupResource($relationAlias, $joinType)
451:             ->useQuery($relationAlias ? $relationAlias : 'GroupResource', '\Thelia\Model\GroupResourceQuery');
452:     }
453: 
454:     /**
455:      * Filter the query by a related ResourceI18n object
456:      *
457:      * @param   ResourceI18n|PropelObjectCollection $resourceI18n  the related object to use as filter
458:      * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
459:      *
460:      * @return   ResourceQuery The current query, for fluid interface
461:      * @throws   PropelException - if the provided filter is invalid.
462:      */
463:     public function filterByResourceI18n($resourceI18n, $comparison = null)
464:     {
465:         if ($resourceI18n instanceof ResourceI18n) {
466:             return $this
467:                 ->addUsingAlias(ResourcePeer::ID, $resourceI18n->getId(), $comparison);
468:         } elseif ($resourceI18n instanceof PropelObjectCollection) {
469:             return $this
470:                 ->useResourceI18nQuery()
471:                 ->filterByPrimaryKeys($resourceI18n->getPrimaryKeys())
472:                 ->endUse();
473:         } else {
474:             throw new PropelException('filterByResourceI18n() only accepts arguments of type ResourceI18n or PropelCollection');
475:         }
476:     }
477: 
478:     /**
479:      * Adds a JOIN clause to the query using the ResourceI18n relation
480:      *
481:      * @param     string $relationAlias optional alias for the relation
482:      * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
483:      *
484:      * @return ResourceQuery The current query, for fluid interface
485:      */
486:     public function joinResourceI18n($relationAlias = null, $joinType = 'LEFT JOIN')
487:     {
488:         $tableMap = $this->getTableMap();
489:         $relationMap = $tableMap->getRelation('ResourceI18n');
490: 
491:         // create a ModelJoin object for this join
492:         $join = new ModelJoin();
493:         $join->setJoinType($joinType);
494:         $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
495:         if ($previousJoin = $this->getPreviousJoin()) {
496:             $join->setPreviousJoin($previousJoin);
497:         }
498: 
499:         // add the ModelJoin to the current object
500:         if ($relationAlias) {
501:             $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
502:             $this->addJoinObject($join, $relationAlias);
503:         } else {
504:             $this->addJoinObject($join, 'ResourceI18n');
505:         }
506: 
507:         return $this;
508:     }
509: 
510:     /**
511:      * Use the ResourceI18n relation ResourceI18n object
512:      *
513:      * @see       useQuery()
514:      *
515:      * @param     string $relationAlias optional alias for the relation,
516:      *                                   to be used as main alias in the secondary query
517:      * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
518:      *
519:      * @return   \Thelia\Model\ResourceI18nQuery A secondary query class using the current class as primary query
520:      */
521:     public function useResourceI18nQuery($relationAlias = null, $joinType = 'LEFT JOIN')
522:     {
523:         return $this
524:             ->joinResourceI18n($relationAlias, $joinType)
525:             ->useQuery($relationAlias ? $relationAlias : 'ResourceI18n', '\Thelia\Model\ResourceI18nQuery');
526:     }
527: 
528:     /**
529:      * Exclude object from result
530:      *
531:      * @param   Resource $resource Object to remove from the list of results
532:      *
533:      * @return ResourceQuery The current query, for fluid interface
534:      */
535:     public function prune($resource = null)
536:     {
537:         if ($resource) {
538:             $this->addUsingAlias(ResourcePeer::ID, $resource->getId(), Criteria::NOT_EQUAL);
539:         }
540: 
541:         return $this;
542:     }
543: 
544:     // timestampable behavior
545: 
546:     /**
547:      * Filter by the latest updated
548:      *
549:      * @param      int $nbDays Maximum age of the latest update in days
550:      *
551:      * @return     ResourceQuery The current query, for fluid interface
552:      */
553:     public function recentlyUpdated($nbDays = 7)
554:     {
555:         return $this->addUsingAlias(ResourcePeer::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
556:     }
557: 
558:     /**
559:      * Order by update date desc
560:      *
561:      * @return     ResourceQuery The current query, for fluid interface
562:      */
563:     public function lastUpdatedFirst()
564:     {
565:         return $this->addDescendingOrderByColumn(ResourcePeer::UPDATED_AT);
566:     }
567: 
568:     /**
569:      * Order by update date asc
570:      *
571:      * @return     ResourceQuery The current query, for fluid interface
572:      */
573:     public function firstUpdatedFirst()
574:     {
575:         return $this->addAscendingOrderByColumn(ResourcePeer::UPDATED_AT);
576:     }
577: 
578:     /**
579:      * Filter by the latest created
580:      *
581:      * @param      int $nbDays Maximum age of in days
582:      *
583:      * @return     ResourceQuery The current query, for fluid interface
584:      */
585:     public function recentlyCreated($nbDays = 7)
586:     {
587:         return $this->addUsingAlias(ResourcePeer::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
588:     }
589: 
590:     /**
591:      * Order by create date desc
592:      *
593:      * @return     ResourceQuery The current query, for fluid interface
594:      */
595:     public function lastCreatedFirst()
596:     {
597:         return $this->addDescendingOrderByColumn(ResourcePeer::CREATED_AT);
598:     }
599: 
600:     /**
601:      * Order by create date asc
602:      *
603:      * @return     ResourceQuery The current query, for fluid interface
604:      */
605:     public function firstCreatedFirst()
606:     {
607:         return $this->addAscendingOrderByColumn(ResourcePeer::CREATED_AT);
608:     }
609:     // i18n behavior
610: 
611:     /**
612:      * Adds a JOIN clause to the query using the i18n relation
613:      *
614:      * @param     string $locale Locale to use for the join condition, e.g. 'fr_FR'
615:      * @param     string $relationAlias optional alias for the relation
616:      * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
617:      *
618:      * @return    ResourceQuery The current query, for fluid interface
619:      */
620:     public function joinI18n($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
621:     {
622:         $relationName = $relationAlias ? $relationAlias : 'ResourceI18n';
623: 
624:         return $this
625:             ->joinResourceI18n($relationAlias, $joinType)
626:             ->addJoinCondition($relationName, $relationName . '.Locale = ?', $locale);
627:     }
628: 
629:     /**
630:      * Adds a JOIN clause to the query and hydrates the related I18n object.
631:      * Shortcut for $c->joinI18n($locale)->with()
632:      *
633:      * @param     string $locale Locale to use for the join condition, e.g. 'fr_FR'
634:      * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
635:      *
636:      * @return    ResourceQuery The current query, for fluid interface
637:      */
638:     public function joinWithI18n($locale = 'en_EN', $joinType = Criteria::LEFT_JOIN)
639:     {
640:         $this
641:             ->joinI18n($locale, null, $joinType)
642:             ->with('ResourceI18n');
643:         $this->with['ResourceI18n']->setIsWithOneToMany(false);
644: 
645:         return $this;
646:     }
647: 
648:     /**
649:      * Use the I18n relation query object
650:      *
651:      * @see       useQuery()
652:      *
653:      * @param     string $locale Locale to use for the join condition, e.g. 'fr_FR'
654:      * @param     string $relationAlias optional alias for the relation
655:      * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'. Defaults to left join.
656:      *
657:      * @return    ResourceI18nQuery A secondary query class using the current class as primary query
658:      */
659:     public function useI18nQuery($locale = 'en_EN', $relationAlias = null, $joinType = Criteria::LEFT_JOIN)
660:     {
661:         return $this
662:             ->joinI18n($locale, $relationAlias, $joinType)
663:             ->useQuery($relationAlias ? $relationAlias : 'ResourceI18n', 'Thelia\Model\ResourceI18nQuery');
664:     }
665: 
666: }
667: 
thelia API documentation generated by ApiGen 2.8.0