Overview

Namespaces

  • Thelia
    • Action
    • Config
    • Controller
    • Core
      • Bundle
      • DependencyInjection
        • Compiler
        • Loader
      • Event
      • EventListener
      • Template
        • BaseParam
    • Exception
    • Log
      • Destination
    • Model
      • map
      • om
    • Routing
      • Matcher
    • Tools
    • Tpex
      • BaseParam
      • Element
        • Loop
        • TestLoop
      • Event
      • Exception
      • Filter
      • Tokenizer

Classes

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