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