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\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:      * </code>
260:      *
261:      * @see       filterByContent()
262:      *
263:      * @param     mixed $contentId The value to use as filter.
264:      *              Use scalar values for equality.
265:      *              Use array values for in_array() equivalent.
266:      *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
267:      * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
268:      *
269:      * @return ContentFolderQuery The current query, for fluid interface
270:      */
271:     public function filterByContentId($contentId = null, $comparison = null)
272:     {
273:         if (is_array($contentId) && null === $comparison) {
274:             $comparison = Criteria::IN;
275:         }
276: 
277:         return $this->addUsingAlias(ContentFolderPeer::CONTENT_ID, $contentId, $comparison);
278:     }
279: 
280:     /**
281:      * Filter the query on the folder_id column
282:      *
283:      * Example usage:
284:      * <code>
285:      * $query->filterByFolderId(1234); // WHERE folder_id = 1234
286:      * $query->filterByFolderId(array(12, 34)); // WHERE folder_id IN (12, 34)
287:      * $query->filterByFolderId(array('min' => 12)); // WHERE folder_id > 12
288:      * </code>
289:      *
290:      * @see       filterByFolder()
291:      *
292:      * @param     mixed $folderId The value to use as filter.
293:      *              Use scalar values for equality.
294:      *              Use array values for in_array() equivalent.
295:      *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
296:      * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
297:      *
298:      * @return ContentFolderQuery The current query, for fluid interface
299:      */
300:     public function filterByFolderId($folderId = null, $comparison = null)
301:     {
302:         if (is_array($folderId) && null === $comparison) {
303:             $comparison = Criteria::IN;
304:         }
305: 
306:         return $this->addUsingAlias(ContentFolderPeer::FOLDER_ID, $folderId, $comparison);
307:     }
308: 
309:     /**
310:      * Filter the query on the created_at column
311:      *
312:      * Example usage:
313:      * <code>
314:      * $query->filterByCreatedAt('2011-03-14'); // WHERE created_at = '2011-03-14'
315:      * $query->filterByCreatedAt('now'); // WHERE created_at = '2011-03-14'
316:      * $query->filterByCreatedAt(array('max' => 'yesterday')); // WHERE created_at > '2011-03-13'
317:      * </code>
318:      *
319:      * @param     mixed $createdAt The value to use as filter.
320:      *              Values can be integers (unix timestamps), DateTime objects, or strings.
321:      *              Empty strings are treated as NULL.
322:      *              Use scalar values for equality.
323:      *              Use array values for in_array() equivalent.
324:      *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
325:      * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
326:      *
327:      * @return ContentFolderQuery The current query, for fluid interface
328:      */
329:     public function filterByCreatedAt($createdAt = null, $comparison = null)
330:     {
331:         if (is_array($createdAt)) {
332:             $useMinMax = false;
333:             if (isset($createdAt['min'])) {
334:                 $this->addUsingAlias(ContentFolderPeer::CREATED_AT, $createdAt['min'], Criteria::GREATER_EQUAL);
335:                 $useMinMax = true;
336:             }
337:             if (isset($createdAt['max'])) {
338:                 $this->addUsingAlias(ContentFolderPeer::CREATED_AT, $createdAt['max'], Criteria::LESS_EQUAL);
339:                 $useMinMax = true;
340:             }
341:             if ($useMinMax) {
342:                 return $this;
343:             }
344:             if (null === $comparison) {
345:                 $comparison = Criteria::IN;
346:             }
347:         }
348: 
349:         return $this->addUsingAlias(ContentFolderPeer::CREATED_AT, $createdAt, $comparison);
350:     }
351: 
352:     /**
353:      * Filter the query on the updated_at column
354:      *
355:      * Example usage:
356:      * <code>
357:      * $query->filterByUpdatedAt('2011-03-14'); // WHERE updated_at = '2011-03-14'
358:      * $query->filterByUpdatedAt('now'); // WHERE updated_at = '2011-03-14'
359:      * $query->filterByUpdatedAt(array('max' => 'yesterday')); // WHERE updated_at > '2011-03-13'
360:      * </code>
361:      *
362:      * @param     mixed $updatedAt The value to use as filter.
363:      *              Values can be integers (unix timestamps), DateTime objects, or strings.
364:      *              Empty strings are treated as NULL.
365:      *              Use scalar values for equality.
366:      *              Use array values for in_array() equivalent.
367:      *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
368:      * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
369:      *
370:      * @return ContentFolderQuery The current query, for fluid interface
371:      */
372:     public function filterByUpdatedAt($updatedAt = null, $comparison = null)
373:     {
374:         if (is_array($updatedAt)) {
375:             $useMinMax = false;
376:             if (isset($updatedAt['min'])) {
377:                 $this->addUsingAlias(ContentFolderPeer::UPDATED_AT, $updatedAt['min'], Criteria::GREATER_EQUAL);
378:                 $useMinMax = true;
379:             }
380:             if (isset($updatedAt['max'])) {
381:                 $this->addUsingAlias(ContentFolderPeer::UPDATED_AT, $updatedAt['max'], Criteria::LESS_EQUAL);
382:                 $useMinMax = true;
383:             }
384:             if ($useMinMax) {
385:                 return $this;
386:             }
387:             if (null === $comparison) {
388:                 $comparison = Criteria::IN;
389:             }
390:         }
391: 
392:         return $this->addUsingAlias(ContentFolderPeer::UPDATED_AT, $updatedAt, $comparison);
393:     }
394: 
395:     /**
396:      * Filter the query by a related Content object
397:      *
398:      * @param   Content|PropelObjectCollection $content The related object(s) to use as filter
399:      * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
400:      *
401:      * @return   ContentFolderQuery The current query, for fluid interface
402:      * @throws   PropelException - if the provided filter is invalid.
403:      */
404:     public function filterByContent($content, $comparison = null)
405:     {
406:         if ($content instanceof Content) {
407:             return $this
408:                 ->addUsingAlias(ContentFolderPeer::CONTENT_ID, $content->getId(), $comparison);
409:         } elseif ($content instanceof PropelObjectCollection) {
410:             if (null === $comparison) {
411:                 $comparison = Criteria::IN;
412:             }
413: 
414:             return $this
415:                 ->addUsingAlias(ContentFolderPeer::CONTENT_ID, $content->toKeyValue('PrimaryKey', 'Id'), $comparison);
416:         } else {
417:             throw new PropelException('filterByContent() only accepts arguments of type Content or PropelCollection');
418:         }
419:     }
420: 
421:     /**
422:      * Adds a JOIN clause to the query using the Content relation
423:      *
424:      * @param     string $relationAlias optional alias for the relation
425:      * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
426:      *
427:      * @return ContentFolderQuery The current query, for fluid interface
428:      */
429:     public function joinContent($relationAlias = null, $joinType = Criteria::INNER_JOIN)
430:     {
431:         $tableMap = $this->getTableMap();
432:         $relationMap = $tableMap->getRelation('Content');
433: 
434:         // create a ModelJoin object for this join
435:         $join = new ModelJoin();
436:         $join->setJoinType($joinType);
437:         $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
438:         if ($previousJoin = $this->getPreviousJoin()) {
439:             $join->setPreviousJoin($previousJoin);
440:         }
441: 
442:         // add the ModelJoin to the current object
443:         if ($relationAlias) {
444:             $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
445:             $this->addJoinObject($join, $relationAlias);
446:         } else {
447:             $this->addJoinObject($join, 'Content');
448:         }
449: 
450:         return $this;
451:     }
452: 
453:     /**
454:      * Use the Content relation Content object
455:      *
456:      * @see       useQuery()
457:      *
458:      * @param     string $relationAlias optional alias for the relation,
459:      *                                   to be used as main alias in the secondary query
460:      * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
461:      *
462:      * @return   \Thelia\Model\ContentQuery A secondary query class using the current class as primary query
463:      */
464:     public function useContentQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
465:     {
466:         return $this
467:             ->joinContent($relationAlias, $joinType)
468:             ->useQuery($relationAlias ? $relationAlias : 'Content', '\Thelia\Model\ContentQuery');
469:     }
470: 
471:     /**
472:      * Filter the query by a related Folder object
473:      *
474:      * @param   Folder|PropelObjectCollection $folder The related object(s) to use as filter
475:      * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
476:      *
477:      * @return   ContentFolderQuery The current query, for fluid interface
478:      * @throws   PropelException - if the provided filter is invalid.
479:      */
480:     public function filterByFolder($folder, $comparison = null)
481:     {
482:         if ($folder instanceof Folder) {
483:             return $this
484:                 ->addUsingAlias(ContentFolderPeer::FOLDER_ID, $folder->getId(), $comparison);
485:         } elseif ($folder instanceof PropelObjectCollection) {
486:             if (null === $comparison) {
487:                 $comparison = Criteria::IN;
488:             }
489: 
490:             return $this
491:                 ->addUsingAlias(ContentFolderPeer::FOLDER_ID, $folder->toKeyValue('PrimaryKey', 'Id'), $comparison);
492:         } else {
493:             throw new PropelException('filterByFolder() only accepts arguments of type Folder or PropelCollection');
494:         }
495:     }
496: 
497:     /**
498:      * Adds a JOIN clause to the query using the Folder relation
499:      *
500:      * @param     string $relationAlias optional alias for the relation
501:      * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
502:      *
503:      * @return ContentFolderQuery The current query, for fluid interface
504:      */
505:     public function joinFolder($relationAlias = null, $joinType = Criteria::INNER_JOIN)
506:     {
507:         $tableMap = $this->getTableMap();
508:         $relationMap = $tableMap->getRelation('Folder');
509: 
510:         // create a ModelJoin object for this join
511:         $join = new ModelJoin();
512:         $join->setJoinType($joinType);
513:         $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
514:         if ($previousJoin = $this->getPreviousJoin()) {
515:             $join->setPreviousJoin($previousJoin);
516:         }
517: 
518:         // add the ModelJoin to the current object
519:         if ($relationAlias) {
520:             $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
521:             $this->addJoinObject($join, $relationAlias);
522:         } else {
523:             $this->addJoinObject($join, 'Folder');
524:         }
525: 
526:         return $this;
527:     }
528: 
529:     /**
530:      * Use the Folder relation Folder object
531:      *
532:      * @see       useQuery()
533:      *
534:      * @param     string $relationAlias optional alias for the relation,
535:      *                                   to be used as main alias in the secondary query
536:      * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
537:      *
538:      * @return   \Thelia\Model\FolderQuery A secondary query class using the current class as primary query
539:      */
540:     public function useFolderQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
541:     {
542:         return $this
543:             ->joinFolder($relationAlias, $joinType)
544:             ->useQuery($relationAlias ? $relationAlias : 'Folder', '\Thelia\Model\FolderQuery');
545:     }
546: 
547:     /**
548:      * Exclude object from result
549:      *
550:      * @param   ContentFolder $contentFolder Object to remove from the list of results
551:      *
552:      * @return ContentFolderQuery The current query, for fluid interface
553:      */
554:     public function prune($contentFolder = null)
555:     {
556:         if ($contentFolder) {
557:             $this->addCond('pruneCond0', $this->getAliasedColName(ContentFolderPeer::CONTENT_ID), $contentFolder->getContentId(), Criteria::NOT_EQUAL);
558:             $this->addCond('pruneCond1', $this->getAliasedColName(ContentFolderPeer::FOLDER_ID), $contentFolder->getFolderId(), Criteria::NOT_EQUAL);
559:             $this->combine(array('pruneCond0', 'pruneCond1'), Criteria::LOGICAL_OR);
560:         }
561: 
562:         return $this;
563:     }
564: 
565:     // timestampable behavior
566: 
567:     /**
568:      * Filter by the latest updated
569:      *
570:      * @param      int $nbDays Maximum age of the latest update in days
571:      *
572:      * @return     ContentFolderQuery The current query, for fluid interface
573:      */
574:     public function recentlyUpdated($nbDays = 7)
575:     {
576:         return $this->addUsingAlias(ContentFolderPeer::UPDATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
577:     }
578: 
579:     /**
580:      * Order by update date desc
581:      *
582:      * @return     ContentFolderQuery The current query, for fluid interface
583:      */
584:     public function lastUpdatedFirst()
585:     {
586:         return $this->addDescendingOrderByColumn(ContentFolderPeer::UPDATED_AT);
587:     }
588: 
589:     /**
590:      * Order by update date asc
591:      *
592:      * @return     ContentFolderQuery The current query, for fluid interface
593:      */
594:     public function firstUpdatedFirst()
595:     {
596:         return $this->addAscendingOrderByColumn(ContentFolderPeer::UPDATED_AT);
597:     }
598: 
599:     /**
600:      * Filter by the latest created
601:      *
602:      * @param      int $nbDays Maximum age of in days
603:      *
604:      * @return     ContentFolderQuery The current query, for fluid interface
605:      */
606:     public function recentlyCreated($nbDays = 7)
607:     {
608:         return $this->addUsingAlias(ContentFolderPeer::CREATED_AT, time() - $nbDays * 24 * 60 * 60, Criteria::GREATER_EQUAL);
609:     }
610: 
611:     /**
612:      * Order by create date desc
613:      *
614:      * @return     ContentFolderQuery The current query, for fluid interface
615:      */
616:     public function lastCreatedFirst()
617:     {
618:         return $this->addDescendingOrderByColumn(ContentFolderPeer::CREATED_AT);
619:     }
620: 
621:     /**
622:      * Order by create date asc
623:      *
624:      * @return     ContentFolderQuery The current query, for fluid interface
625:      */
626:     public function firstCreatedFirst()
627:     {
628:         return $this->addAscendingOrderByColumn(ContentFolderPeer::CREATED_AT);
629:     }
630: }
631: 
thelia API documentation generated by ApiGen 2.8.0