1: <?php
2:
3: namespace cli_db\propel\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 cli_db\propel\Feature;
16: use cli_db\propel\FeatureSynonym;
17: use cli_db\propel\FeatureSynonymPeer;
18: use cli_db\propel\FeatureSynonymQuery;
19: use cli_db\propel\Pub;
20: use cli_db\propel\Synonym;
21:
22: /**
23: * Base class that represents a query for the 'feature_synonym' table.
24: *
25: *
26: *
27: * @method FeatureSynonymQuery orderByFeatureSynonymId($order = Criteria::ASC) Order by the feature_synonym_id column
28: * @method FeatureSynonymQuery orderBySynonymId($order = Criteria::ASC) Order by the synonym_id column
29: * @method FeatureSynonymQuery orderByFeatureId($order = Criteria::ASC) Order by the feature_id column
30: * @method FeatureSynonymQuery orderByPubId($order = Criteria::ASC) Order by the pub_id column
31: * @method FeatureSynonymQuery orderByIsCurrent($order = Criteria::ASC) Order by the is_current column
32: * @method FeatureSynonymQuery orderByIsInternal($order = Criteria::ASC) Order by the is_internal column
33: *
34: * @method FeatureSynonymQuery groupByFeatureSynonymId() Group by the feature_synonym_id column
35: * @method FeatureSynonymQuery groupBySynonymId() Group by the synonym_id column
36: * @method FeatureSynonymQuery groupByFeatureId() Group by the feature_id column
37: * @method FeatureSynonymQuery groupByPubId() Group by the pub_id column
38: * @method FeatureSynonymQuery groupByIsCurrent() Group by the is_current column
39: * @method FeatureSynonymQuery groupByIsInternal() Group by the is_internal column
40: *
41: * @method FeatureSynonymQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
42: * @method FeatureSynonymQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
43: * @method FeatureSynonymQuery innerJoin($relation) Adds a INNER JOIN clause to the query
44: *
45: * @method FeatureSynonymQuery leftJoinFeature($relationAlias = null) Adds a LEFT JOIN clause to the query using the Feature relation
46: * @method FeatureSynonymQuery rightJoinFeature($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Feature relation
47: * @method FeatureSynonymQuery innerJoinFeature($relationAlias = null) Adds a INNER JOIN clause to the query using the Feature relation
48: *
49: * @method FeatureSynonymQuery leftJoinPub($relationAlias = null) Adds a LEFT JOIN clause to the query using the Pub relation
50: * @method FeatureSynonymQuery rightJoinPub($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Pub relation
51: * @method FeatureSynonymQuery innerJoinPub($relationAlias = null) Adds a INNER JOIN clause to the query using the Pub relation
52: *
53: * @method FeatureSynonymQuery leftJoinSynonym($relationAlias = null) Adds a LEFT JOIN clause to the query using the Synonym relation
54: * @method FeatureSynonymQuery rightJoinSynonym($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Synonym relation
55: * @method FeatureSynonymQuery innerJoinSynonym($relationAlias = null) Adds a INNER JOIN clause to the query using the Synonym relation
56: *
57: * @method FeatureSynonym findOne(PropelPDO $con = null) Return the first FeatureSynonym matching the query
58: * @method FeatureSynonym findOneOrCreate(PropelPDO $con = null) Return the first FeatureSynonym matching the query, or a new FeatureSynonym object populated from the query conditions when no match is found
59: *
60: * @method FeatureSynonym findOneBySynonymId(int $synonym_id) Return the first FeatureSynonym filtered by the synonym_id column
61: * @method FeatureSynonym findOneByFeatureId(int $feature_id) Return the first FeatureSynonym filtered by the feature_id column
62: * @method FeatureSynonym findOneByPubId(int $pub_id) Return the first FeatureSynonym filtered by the pub_id column
63: * @method FeatureSynonym findOneByIsCurrent(boolean $is_current) Return the first FeatureSynonym filtered by the is_current column
64: * @method FeatureSynonym findOneByIsInternal(boolean $is_internal) Return the first FeatureSynonym filtered by the is_internal column
65: *
66: * @method array findByFeatureSynonymId(int $feature_synonym_id) Return FeatureSynonym objects filtered by the feature_synonym_id column
67: * @method array findBySynonymId(int $synonym_id) Return FeatureSynonym objects filtered by the synonym_id column
68: * @method array findByFeatureId(int $feature_id) Return FeatureSynonym objects filtered by the feature_id column
69: * @method array findByPubId(int $pub_id) Return FeatureSynonym objects filtered by the pub_id column
70: * @method array findByIsCurrent(boolean $is_current) Return FeatureSynonym objects filtered by the is_current column
71: * @method array findByIsInternal(boolean $is_internal) Return FeatureSynonym objects filtered by the is_internal column
72: *
73: * @package propel.generator.cli_db.om
74: */
75: abstract class BaseFeatureSynonymQuery extends ModelCriteria
76: {
77: /**
78: * Initializes internal state of BaseFeatureSynonymQuery object.
79: *
80: * @param string $dbName The dabase name
81: * @param string $modelName The phpName of a model, e.g. 'Book'
82: * @param string $modelAlias The alias for the model in this query, e.g. 'b'
83: */
84: public function __construct($dbName = 'cli_db', $modelName = 'cli_db\\propel\\FeatureSynonym', $modelAlias = null)
85: {
86: parent::__construct($dbName, $modelName, $modelAlias);
87: }
88:
89: /**
90: * Returns a new FeatureSynonymQuery object.
91: *
92: * @param string $modelAlias The alias of a model in the query
93: * @param FeatureSynonymQuery|Criteria $criteria Optional Criteria to build the query from
94: *
95: * @return FeatureSynonymQuery
96: */
97: public static function create($modelAlias = null, $criteria = null)
98: {
99: if ($criteria instanceof FeatureSynonymQuery) {
100: return $criteria;
101: }
102: $query = new FeatureSynonymQuery();
103: if (null !== $modelAlias) {
104: $query->setModelAlias($modelAlias);
105: }
106: if ($criteria instanceof Criteria) {
107: $query->mergeWith($criteria);
108: }
109:
110: return $query;
111: }
112:
113: /**
114: * Find object by primary key.
115: * Propel uses the instance pool to skip the database if the object exists.
116: * Go fast if the query is untouched.
117: *
118: * <code>
119: * $obj = $c->findPk(12, $con);
120: * </code>
121: *
122: * @param mixed $key Primary key to use for the query
123: * @param PropelPDO $con an optional connection object
124: *
125: * @return FeatureSynonym|FeatureSynonym[]|mixed the result, formatted by the current formatter
126: */
127: public function findPk($key, $con = null)
128: {
129: if ($key === null) {
130: return null;
131: }
132: if ((null !== ($obj = FeatureSynonymPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {
133: // the object is alredy in the instance pool
134: return $obj;
135: }
136: if ($con === null) {
137: $con = Propel::getConnection(FeatureSynonymPeer::DATABASE_NAME, Propel::CONNECTION_READ);
138: }
139: $this->basePreSelect($con);
140: if ($this->formatter || $this->modelAlias || $this->with || $this->select
141: || $this->selectColumns || $this->asColumns || $this->selectModifiers
142: || $this->map || $this->having || $this->joins) {
143: return $this->findPkComplex($key, $con);
144: } else {
145: return $this->findPkSimple($key, $con);
146: }
147: }
148:
149: /**
150: * Alias of findPk to use instance pooling
151: *
152: * @param mixed $key Primary key to use for the query
153: * @param PropelPDO $con A connection object
154: *
155: * @return FeatureSynonym A model object, or null if the key is not found
156: * @throws PropelException
157: */
158: public function findOneByFeatureSynonymId($key, $con = null)
159: {
160: return $this->findPk($key, $con);
161: }
162:
163: /**
164: * Find object by primary key using raw SQL to go fast.
165: * Bypass doSelect() and the object formatter by using generated code.
166: *
167: * @param mixed $key Primary key to use for the query
168: * @param PropelPDO $con A connection object
169: *
170: * @return FeatureSynonym A model object, or null if the key is not found
171: * @throws PropelException
172: */
173: protected function findPkSimple($key, $con)
174: {
175: $sql = 'SELECT "feature_synonym_id", "synonym_id", "feature_id", "pub_id", "is_current", "is_internal" FROM "feature_synonym" WHERE "feature_synonym_id" = :p0';
176: try {
177: $stmt = $con->prepare($sql);
178: $stmt->bindValue(':p0', $key, PDO::PARAM_INT);
179: $stmt->execute();
180: } catch (Exception $e) {
181: Propel::log($e->getMessage(), Propel::LOG_ERR);
182: throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);
183: }
184: $obj = null;
185: if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
186: $obj = new FeatureSynonym();
187: $obj->hydrate($row);
188: FeatureSynonymPeer::addInstanceToPool($obj, (string) $key);
189: }
190: $stmt->closeCursor();
191:
192: return $obj;
193: }
194:
195: /**
196: * Find object by primary key.
197: *
198: * @param mixed $key Primary key to use for the query
199: * @param PropelPDO $con A connection object
200: *
201: * @return FeatureSynonym|FeatureSynonym[]|mixed the result, formatted by the current formatter
202: */
203: protected function findPkComplex($key, $con)
204: {
205: // As the query uses a PK condition, no limit(1) is necessary.
206: $criteria = $this->isKeepQuery() ? clone $this : $this;
207: $stmt = $criteria
208: ->filterByPrimaryKey($key)
209: ->doSelect($con);
210:
211: return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
212: }
213:
214: /**
215: * Find objects by primary key
216: * <code>
217: * $objs = $c->findPks(array(12, 56, 832), $con);
218: * </code>
219: * @param array $keys Primary keys to use for the query
220: * @param PropelPDO $con an optional connection object
221: *
222: * @return PropelObjectCollection|FeatureSynonym[]|mixed the list of results, formatted by the current formatter
223: */
224: public function findPks($keys, $con = null)
225: {
226: if ($con === null) {
227: $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);
228: }
229: $this->basePreSelect($con);
230: $criteria = $this->isKeepQuery() ? clone $this : $this;
231: $stmt = $criteria
232: ->filterByPrimaryKeys($keys)
233: ->doSelect($con);
234:
235: return $criteria->getFormatter()->init($criteria)->format($stmt);
236: }
237:
238: /**
239: * Filter the query by primary key
240: *
241: * @param mixed $key Primary key to use for the query
242: *
243: * @return FeatureSynonymQuery The current query, for fluid interface
244: */
245: public function filterByPrimaryKey($key)
246: {
247:
248: return $this->addUsingAlias(FeatureSynonymPeer::FEATURE_SYNONYM_ID, $key, Criteria::EQUAL);
249: }
250:
251: /**
252: * Filter the query by a list of primary keys
253: *
254: * @param array $keys The list of primary key to use for the query
255: *
256: * @return FeatureSynonymQuery The current query, for fluid interface
257: */
258: public function filterByPrimaryKeys($keys)
259: {
260:
261: return $this->addUsingAlias(FeatureSynonymPeer::FEATURE_SYNONYM_ID, $keys, Criteria::IN);
262: }
263:
264: /**
265: * Filter the query on the feature_synonym_id column
266: *
267: * Example usage:
268: * <code>
269: * $query->filterByFeatureSynonymId(1234); // WHERE feature_synonym_id = 1234
270: * $query->filterByFeatureSynonymId(array(12, 34)); // WHERE feature_synonym_id IN (12, 34)
271: * $query->filterByFeatureSynonymId(array('min' => 12)); // WHERE feature_synonym_id >= 12
272: * $query->filterByFeatureSynonymId(array('max' => 12)); // WHERE feature_synonym_id <= 12
273: * </code>
274: *
275: * @param mixed $featureSynonymId The value to use as filter.
276: * Use scalar values for equality.
277: * Use array values for in_array() equivalent.
278: * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
279: * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
280: *
281: * @return FeatureSynonymQuery The current query, for fluid interface
282: */
283: public function filterByFeatureSynonymId($featureSynonymId = null, $comparison = null)
284: {
285: if (is_array($featureSynonymId)) {
286: $useMinMax = false;
287: if (isset($featureSynonymId['min'])) {
288: $this->addUsingAlias(FeatureSynonymPeer::FEATURE_SYNONYM_ID, $featureSynonymId['min'], Criteria::GREATER_EQUAL);
289: $useMinMax = true;
290: }
291: if (isset($featureSynonymId['max'])) {
292: $this->addUsingAlias(FeatureSynonymPeer::FEATURE_SYNONYM_ID, $featureSynonymId['max'], Criteria::LESS_EQUAL);
293: $useMinMax = true;
294: }
295: if ($useMinMax) {
296: return $this;
297: }
298: if (null === $comparison) {
299: $comparison = Criteria::IN;
300: }
301: }
302:
303: return $this->addUsingAlias(FeatureSynonymPeer::FEATURE_SYNONYM_ID, $featureSynonymId, $comparison);
304: }
305:
306: /**
307: * Filter the query on the synonym_id column
308: *
309: * Example usage:
310: * <code>
311: * $query->filterBySynonymId(1234); // WHERE synonym_id = 1234
312: * $query->filterBySynonymId(array(12, 34)); // WHERE synonym_id IN (12, 34)
313: * $query->filterBySynonymId(array('min' => 12)); // WHERE synonym_id >= 12
314: * $query->filterBySynonymId(array('max' => 12)); // WHERE synonym_id <= 12
315: * </code>
316: *
317: * @see filterBySynonym()
318: *
319: * @param mixed $synonymId The value to use as filter.
320: * Use scalar values for equality.
321: * Use array values for in_array() equivalent.
322: * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
323: * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
324: *
325: * @return FeatureSynonymQuery The current query, for fluid interface
326: */
327: public function filterBySynonymId($synonymId = null, $comparison = null)
328: {
329: if (is_array($synonymId)) {
330: $useMinMax = false;
331: if (isset($synonymId['min'])) {
332: $this->addUsingAlias(FeatureSynonymPeer::SYNONYM_ID, $synonymId['min'], Criteria::GREATER_EQUAL);
333: $useMinMax = true;
334: }
335: if (isset($synonymId['max'])) {
336: $this->addUsingAlias(FeatureSynonymPeer::SYNONYM_ID, $synonymId['max'], Criteria::LESS_EQUAL);
337: $useMinMax = true;
338: }
339: if ($useMinMax) {
340: return $this;
341: }
342: if (null === $comparison) {
343: $comparison = Criteria::IN;
344: }
345: }
346:
347: return $this->addUsingAlias(FeatureSynonymPeer::SYNONYM_ID, $synonymId, $comparison);
348: }
349:
350: /**
351: * Filter the query on the feature_id column
352: *
353: * Example usage:
354: * <code>
355: * $query->filterByFeatureId(1234); // WHERE feature_id = 1234
356: * $query->filterByFeatureId(array(12, 34)); // WHERE feature_id IN (12, 34)
357: * $query->filterByFeatureId(array('min' => 12)); // WHERE feature_id >= 12
358: * $query->filterByFeatureId(array('max' => 12)); // WHERE feature_id <= 12
359: * </code>
360: *
361: * @see filterByFeature()
362: *
363: * @param mixed $featureId The value to use as filter.
364: * Use scalar values for equality.
365: * Use array values for in_array() equivalent.
366: * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
367: * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
368: *
369: * @return FeatureSynonymQuery The current query, for fluid interface
370: */
371: public function filterByFeatureId($featureId = null, $comparison = null)
372: {
373: if (is_array($featureId)) {
374: $useMinMax = false;
375: if (isset($featureId['min'])) {
376: $this->addUsingAlias(FeatureSynonymPeer::FEATURE_ID, $featureId['min'], Criteria::GREATER_EQUAL);
377: $useMinMax = true;
378: }
379: if (isset($featureId['max'])) {
380: $this->addUsingAlias(FeatureSynonymPeer::FEATURE_ID, $featureId['max'], Criteria::LESS_EQUAL);
381: $useMinMax = true;
382: }
383: if ($useMinMax) {
384: return $this;
385: }
386: if (null === $comparison) {
387: $comparison = Criteria::IN;
388: }
389: }
390:
391: return $this->addUsingAlias(FeatureSynonymPeer::FEATURE_ID, $featureId, $comparison);
392: }
393:
394: /**
395: * Filter the query on the pub_id column
396: *
397: * Example usage:
398: * <code>
399: * $query->filterByPubId(1234); // WHERE pub_id = 1234
400: * $query->filterByPubId(array(12, 34)); // WHERE pub_id IN (12, 34)
401: * $query->filterByPubId(array('min' => 12)); // WHERE pub_id >= 12
402: * $query->filterByPubId(array('max' => 12)); // WHERE pub_id <= 12
403: * </code>
404: *
405: * @see filterByPub()
406: *
407: * @param mixed $pubId The value to use as filter.
408: * Use scalar values for equality.
409: * Use array values for in_array() equivalent.
410: * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
411: * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
412: *
413: * @return FeatureSynonymQuery The current query, for fluid interface
414: */
415: public function filterByPubId($pubId = null, $comparison = null)
416: {
417: if (is_array($pubId)) {
418: $useMinMax = false;
419: if (isset($pubId['min'])) {
420: $this->addUsingAlias(FeatureSynonymPeer::PUB_ID, $pubId['min'], Criteria::GREATER_EQUAL);
421: $useMinMax = true;
422: }
423: if (isset($pubId['max'])) {
424: $this->addUsingAlias(FeatureSynonymPeer::PUB_ID, $pubId['max'], Criteria::LESS_EQUAL);
425: $useMinMax = true;
426: }
427: if ($useMinMax) {
428: return $this;
429: }
430: if (null === $comparison) {
431: $comparison = Criteria::IN;
432: }
433: }
434:
435: return $this->addUsingAlias(FeatureSynonymPeer::PUB_ID, $pubId, $comparison);
436: }
437:
438: /**
439: * Filter the query on the is_current column
440: *
441: * Example usage:
442: * <code>
443: * $query->filterByIsCurrent(true); // WHERE is_current = true
444: * $query->filterByIsCurrent('yes'); // WHERE is_current = true
445: * </code>
446: *
447: * @param boolean|string $isCurrent The value to use as filter.
448: * Non-boolean arguments are converted using the following rules:
449: * * 1, '1', 'true', 'on', and 'yes' are converted to boolean true
450: * * 0, '0', 'false', 'off', and 'no' are converted to boolean false
451: * Check on string values is case insensitive (so 'FaLsE' is seen as 'false').
452: * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
453: *
454: * @return FeatureSynonymQuery The current query, for fluid interface
455: */
456: public function filterByIsCurrent($isCurrent = null, $comparison = null)
457: {
458: if (is_string($isCurrent)) {
459: $isCurrent = in_array(strtolower($isCurrent), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
460: }
461:
462: return $this->addUsingAlias(FeatureSynonymPeer::IS_CURRENT, $isCurrent, $comparison);
463: }
464:
465: /**
466: * Filter the query on the is_internal column
467: *
468: * Example usage:
469: * <code>
470: * $query->filterByIsInternal(true); // WHERE is_internal = true
471: * $query->filterByIsInternal('yes'); // WHERE is_internal = true
472: * </code>
473: *
474: * @param boolean|string $isInternal The value to use as filter.
475: * Non-boolean arguments are converted using the following rules:
476: * * 1, '1', 'true', 'on', and 'yes' are converted to boolean true
477: * * 0, '0', 'false', 'off', and 'no' are converted to boolean false
478: * Check on string values is case insensitive (so 'FaLsE' is seen as 'false').
479: * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
480: *
481: * @return FeatureSynonymQuery The current query, for fluid interface
482: */
483: public function filterByIsInternal($isInternal = null, $comparison = null)
484: {
485: if (is_string($isInternal)) {
486: $isInternal = in_array(strtolower($isInternal), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
487: }
488:
489: return $this->addUsingAlias(FeatureSynonymPeer::IS_INTERNAL, $isInternal, $comparison);
490: }
491:
492: /**
493: * Filter the query by a related Feature object
494: *
495: * @param Feature|PropelObjectCollection $feature The related object(s) to use as filter
496: * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
497: *
498: * @return FeatureSynonymQuery The current query, for fluid interface
499: * @throws PropelException - if the provided filter is invalid.
500: */
501: public function filterByFeature($feature, $comparison = null)
502: {
503: if ($feature instanceof Feature) {
504: return $this
505: ->addUsingAlias(FeatureSynonymPeer::FEATURE_ID, $feature->getFeatureId(), $comparison);
506: } elseif ($feature instanceof PropelObjectCollection) {
507: if (null === $comparison) {
508: $comparison = Criteria::IN;
509: }
510:
511: return $this
512: ->addUsingAlias(FeatureSynonymPeer::FEATURE_ID, $feature->toKeyValue('PrimaryKey', 'FeatureId'), $comparison);
513: } else {
514: throw new PropelException('filterByFeature() only accepts arguments of type Feature or PropelCollection');
515: }
516: }
517:
518: /**
519: * Adds a JOIN clause to the query using the Feature relation
520: *
521: * @param string $relationAlias optional alias for the relation
522: * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
523: *
524: * @return FeatureSynonymQuery The current query, for fluid interface
525: */
526: public function joinFeature($relationAlias = null, $joinType = Criteria::INNER_JOIN)
527: {
528: $tableMap = $this->getTableMap();
529: $relationMap = $tableMap->getRelation('Feature');
530:
531: // create a ModelJoin object for this join
532: $join = new ModelJoin();
533: $join->setJoinType($joinType);
534: $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
535: if ($previousJoin = $this->getPreviousJoin()) {
536: $join->setPreviousJoin($previousJoin);
537: }
538:
539: // add the ModelJoin to the current object
540: if ($relationAlias) {
541: $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
542: $this->addJoinObject($join, $relationAlias);
543: } else {
544: $this->addJoinObject($join, 'Feature');
545: }
546:
547: return $this;
548: }
549:
550: /**
551: * Use the Feature relation Feature object
552: *
553: * @see useQuery()
554: *
555: * @param string $relationAlias optional alias for the relation,
556: * to be used as main alias in the secondary query
557: * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
558: *
559: * @return \cli_db\propel\FeatureQuery A secondary query class using the current class as primary query
560: */
561: public function useFeatureQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
562: {
563: return $this
564: ->joinFeature($relationAlias, $joinType)
565: ->useQuery($relationAlias ? $relationAlias : 'Feature', '\cli_db\propel\FeatureQuery');
566: }
567:
568: /**
569: * Filter the query by a related Pub object
570: *
571: * @param Pub|PropelObjectCollection $pub The related object(s) to use as filter
572: * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
573: *
574: * @return FeatureSynonymQuery The current query, for fluid interface
575: * @throws PropelException - if the provided filter is invalid.
576: */
577: public function filterByPub($pub, $comparison = null)
578: {
579: if ($pub instanceof Pub) {
580: return $this
581: ->addUsingAlias(FeatureSynonymPeer::PUB_ID, $pub->getPubId(), $comparison);
582: } elseif ($pub instanceof PropelObjectCollection) {
583: if (null === $comparison) {
584: $comparison = Criteria::IN;
585: }
586:
587: return $this
588: ->addUsingAlias(FeatureSynonymPeer::PUB_ID, $pub->toKeyValue('PrimaryKey', 'PubId'), $comparison);
589: } else {
590: throw new PropelException('filterByPub() only accepts arguments of type Pub or PropelCollection');
591: }
592: }
593:
594: /**
595: * Adds a JOIN clause to the query using the Pub relation
596: *
597: * @param string $relationAlias optional alias for the relation
598: * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
599: *
600: * @return FeatureSynonymQuery The current query, for fluid interface
601: */
602: public function joinPub($relationAlias = null, $joinType = Criteria::INNER_JOIN)
603: {
604: $tableMap = $this->getTableMap();
605: $relationMap = $tableMap->getRelation('Pub');
606:
607: // create a ModelJoin object for this join
608: $join = new ModelJoin();
609: $join->setJoinType($joinType);
610: $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
611: if ($previousJoin = $this->getPreviousJoin()) {
612: $join->setPreviousJoin($previousJoin);
613: }
614:
615: // add the ModelJoin to the current object
616: if ($relationAlias) {
617: $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
618: $this->addJoinObject($join, $relationAlias);
619: } else {
620: $this->addJoinObject($join, 'Pub');
621: }
622:
623: return $this;
624: }
625:
626: /**
627: * Use the Pub relation Pub object
628: *
629: * @see useQuery()
630: *
631: * @param string $relationAlias optional alias for the relation,
632: * to be used as main alias in the secondary query
633: * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
634: *
635: * @return \cli_db\propel\PubQuery A secondary query class using the current class as primary query
636: */
637: public function usePubQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
638: {
639: return $this
640: ->joinPub($relationAlias, $joinType)
641: ->useQuery($relationAlias ? $relationAlias : 'Pub', '\cli_db\propel\PubQuery');
642: }
643:
644: /**
645: * Filter the query by a related Synonym object
646: *
647: * @param Synonym|PropelObjectCollection $synonym The related object(s) to use as filter
648: * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
649: *
650: * @return FeatureSynonymQuery The current query, for fluid interface
651: * @throws PropelException - if the provided filter is invalid.
652: */
653: public function filterBySynonym($synonym, $comparison = null)
654: {
655: if ($synonym instanceof Synonym) {
656: return $this
657: ->addUsingAlias(FeatureSynonymPeer::SYNONYM_ID, $synonym->getSynonymId(), $comparison);
658: } elseif ($synonym instanceof PropelObjectCollection) {
659: if (null === $comparison) {
660: $comparison = Criteria::IN;
661: }
662:
663: return $this
664: ->addUsingAlias(FeatureSynonymPeer::SYNONYM_ID, $synonym->toKeyValue('PrimaryKey', 'SynonymId'), $comparison);
665: } else {
666: throw new PropelException('filterBySynonym() only accepts arguments of type Synonym or PropelCollection');
667: }
668: }
669:
670: /**
671: * Adds a JOIN clause to the query using the Synonym relation
672: *
673: * @param string $relationAlias optional alias for the relation
674: * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
675: *
676: * @return FeatureSynonymQuery The current query, for fluid interface
677: */
678: public function joinSynonym($relationAlias = null, $joinType = Criteria::INNER_JOIN)
679: {
680: $tableMap = $this->getTableMap();
681: $relationMap = $tableMap->getRelation('Synonym');
682:
683: // create a ModelJoin object for this join
684: $join = new ModelJoin();
685: $join->setJoinType($joinType);
686: $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
687: if ($previousJoin = $this->getPreviousJoin()) {
688: $join->setPreviousJoin($previousJoin);
689: }
690:
691: // add the ModelJoin to the current object
692: if ($relationAlias) {
693: $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
694: $this->addJoinObject($join, $relationAlias);
695: } else {
696: $this->addJoinObject($join, 'Synonym');
697: }
698:
699: return $this;
700: }
701:
702: /**
703: * Use the Synonym relation Synonym object
704: *
705: * @see useQuery()
706: *
707: * @param string $relationAlias optional alias for the relation,
708: * to be used as main alias in the secondary query
709: * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
710: *
711: * @return \cli_db\propel\SynonymQuery A secondary query class using the current class as primary query
712: */
713: public function useSynonymQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
714: {
715: return $this
716: ->joinSynonym($relationAlias, $joinType)
717: ->useQuery($relationAlias ? $relationAlias : 'Synonym', '\cli_db\propel\SynonymQuery');
718: }
719:
720: /**
721: * Exclude object from result
722: *
723: * @param FeatureSynonym $featureSynonym Object to remove from the list of results
724: *
725: * @return FeatureSynonymQuery The current query, for fluid interface
726: */
727: public function prune($featureSynonym = null)
728: {
729: if ($featureSynonym) {
730: $this->addUsingAlias(FeatureSynonymPeer::FEATURE_SYNONYM_ID, $featureSynonym->getFeatureSynonymId(), Criteria::NOT_EQUAL);
731: }
732:
733: return $this;
734: }
735:
736: }
737: