# File core/lib/Thelia/Model/om/BaseOrderFeatureQuery.php | thelia

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