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