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\Dbxref;
16: use cli_db\propel\FeatureCvterm;
17: use cli_db\propel\FeatureCvtermDbxref;
18: use cli_db\propel\FeatureCvtermDbxrefPeer;
19: use cli_db\propel\FeatureCvtermDbxrefQuery;
20:
21: /**
22: * Base class that represents a query for the 'feature_cvterm_dbxref' table.
23: *
24: *
25: *
26: * @method FeatureCvtermDbxrefQuery orderByFeatureCvtermDbxrefId($order = Criteria::ASC) Order by the feature_cvterm_dbxref_id column
27: * @method FeatureCvtermDbxrefQuery orderByFeatureCvtermId($order = Criteria::ASC) Order by the feature_cvterm_id column
28: * @method FeatureCvtermDbxrefQuery orderByDbxrefId($order = Criteria::ASC) Order by the dbxref_id column
29: *
30: * @method FeatureCvtermDbxrefQuery groupByFeatureCvtermDbxrefId() Group by the feature_cvterm_dbxref_id column
31: * @method FeatureCvtermDbxrefQuery groupByFeatureCvtermId() Group by the feature_cvterm_id column
32: * @method FeatureCvtermDbxrefQuery groupByDbxrefId() Group by the dbxref_id column
33: *
34: * @method FeatureCvtermDbxrefQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
35: * @method FeatureCvtermDbxrefQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
36: * @method FeatureCvtermDbxrefQuery innerJoin($relation) Adds a INNER JOIN clause to the query
37: *
38: * @method FeatureCvtermDbxrefQuery leftJoinDbxref($relationAlias = null) Adds a LEFT JOIN clause to the query using the Dbxref relation
39: * @method FeatureCvtermDbxrefQuery rightJoinDbxref($relationAlias = null) Adds a RIGHT JOIN clause to the query using the Dbxref relation
40: * @method FeatureCvtermDbxrefQuery innerJoinDbxref($relationAlias = null) Adds a INNER JOIN clause to the query using the Dbxref relation
41: *
42: * @method FeatureCvtermDbxrefQuery leftJoinFeatureCvterm($relationAlias = null) Adds a LEFT JOIN clause to the query using the FeatureCvterm relation
43: * @method FeatureCvtermDbxrefQuery rightJoinFeatureCvterm($relationAlias = null) Adds a RIGHT JOIN clause to the query using the FeatureCvterm relation
44: * @method FeatureCvtermDbxrefQuery innerJoinFeatureCvterm($relationAlias = null) Adds a INNER JOIN clause to the query using the FeatureCvterm relation
45: *
46: * @method FeatureCvtermDbxref findOne(PropelPDO $con = null) Return the first FeatureCvtermDbxref matching the query
47: * @method FeatureCvtermDbxref findOneOrCreate(PropelPDO $con = null) Return the first FeatureCvtermDbxref matching the query, or a new FeatureCvtermDbxref object populated from the query conditions when no match is found
48: *
49: * @method FeatureCvtermDbxref findOneByFeatureCvtermId(int $feature_cvterm_id) Return the first FeatureCvtermDbxref filtered by the feature_cvterm_id column
50: * @method FeatureCvtermDbxref findOneByDbxrefId(int $dbxref_id) Return the first FeatureCvtermDbxref filtered by the dbxref_id column
51: *
52: * @method array findByFeatureCvtermDbxrefId(int $feature_cvterm_dbxref_id) Return FeatureCvtermDbxref objects filtered by the feature_cvterm_dbxref_id column
53: * @method array findByFeatureCvtermId(int $feature_cvterm_id) Return FeatureCvtermDbxref objects filtered by the feature_cvterm_id column
54: * @method array findByDbxrefId(int $dbxref_id) Return FeatureCvtermDbxref objects filtered by the dbxref_id column
55: *
56: * @package propel.generator.cli_db.om
57: */
58: abstract class BaseFeatureCvtermDbxrefQuery extends ModelCriteria
59: {
60: /**
61: * Initializes internal state of BaseFeatureCvtermDbxrefQuery object.
62: *
63: * @param string $dbName The dabase name
64: * @param string $modelName The phpName of a model, e.g. 'Book'
65: * @param string $modelAlias The alias for the model in this query, e.g. 'b'
66: */
67: public function __construct($dbName = 'cli_db', $modelName = 'cli_db\\propel\\FeatureCvtermDbxref', $modelAlias = null)
68: {
69: parent::__construct($dbName, $modelName, $modelAlias);
70: }
71:
72: /**
73: * Returns a new FeatureCvtermDbxrefQuery object.
74: *
75: * @param string $modelAlias The alias of a model in the query
76: * @param FeatureCvtermDbxrefQuery|Criteria $criteria Optional Criteria to build the query from
77: *
78: * @return FeatureCvtermDbxrefQuery
79: */
80: public static function create($modelAlias = null, $criteria = null)
81: {
82: if ($criteria instanceof FeatureCvtermDbxrefQuery) {
83: return $criteria;
84: }
85: $query = new FeatureCvtermDbxrefQuery();
86: if (null !== $modelAlias) {
87: $query->setModelAlias($modelAlias);
88: }
89: if ($criteria instanceof Criteria) {
90: $query->mergeWith($criteria);
91: }
92:
93: return $query;
94: }
95:
96: /**
97: * Find object by primary key.
98: * Propel uses the instance pool to skip the database if the object exists.
99: * Go fast if the query is untouched.
100: *
101: * <code>
102: * $obj = $c->findPk(12, $con);
103: * </code>
104: *
105: * @param mixed $key Primary key to use for the query
106: * @param PropelPDO $con an optional connection object
107: *
108: * @return FeatureCvtermDbxref|FeatureCvtermDbxref[]|mixed the result, formatted by the current formatter
109: */
110: public function findPk($key, $con = null)
111: {
112: if ($key === null) {
113: return null;
114: }
115: if ((null !== ($obj = FeatureCvtermDbxrefPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {
116: // the object is alredy in the instance pool
117: return $obj;
118: }
119: if ($con === null) {
120: $con = Propel::getConnection(FeatureCvtermDbxrefPeer::DATABASE_NAME, Propel::CONNECTION_READ);
121: }
122: $this->basePreSelect($con);
123: if ($this->formatter || $this->modelAlias || $this->with || $this->select
124: || $this->selectColumns || $this->asColumns || $this->selectModifiers
125: || $this->map || $this->having || $this->joins) {
126: return $this->findPkComplex($key, $con);
127: } else {
128: return $this->findPkSimple($key, $con);
129: }
130: }
131:
132: /**
133: * Alias of findPk to use instance pooling
134: *
135: * @param mixed $key Primary key to use for the query
136: * @param PropelPDO $con A connection object
137: *
138: * @return FeatureCvtermDbxref A model object, or null if the key is not found
139: * @throws PropelException
140: */
141: public function findOneByFeatureCvtermDbxrefId($key, $con = null)
142: {
143: return $this->findPk($key, $con);
144: }
145:
146: /**
147: * Find object by primary key using raw SQL to go fast.
148: * Bypass doSelect() and the object formatter by using generated code.
149: *
150: * @param mixed $key Primary key to use for the query
151: * @param PropelPDO $con A connection object
152: *
153: * @return FeatureCvtermDbxref A model object, or null if the key is not found
154: * @throws PropelException
155: */
156: protected function findPkSimple($key, $con)
157: {
158: $sql = 'SELECT "feature_cvterm_dbxref_id", "feature_cvterm_id", "dbxref_id" FROM "feature_cvterm_dbxref" WHERE "feature_cvterm_dbxref_id" = :p0';
159: try {
160: $stmt = $con->prepare($sql);
161: $stmt->bindValue(':p0', $key, PDO::PARAM_INT);
162: $stmt->execute();
163: } catch (Exception $e) {
164: Propel::log($e->getMessage(), Propel::LOG_ERR);
165: throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);
166: }
167: $obj = null;
168: if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
169: $obj = new FeatureCvtermDbxref();
170: $obj->hydrate($row);
171: FeatureCvtermDbxrefPeer::addInstanceToPool($obj, (string) $key);
172: }
173: $stmt->closeCursor();
174:
175: return $obj;
176: }
177:
178: /**
179: * Find object by primary key.
180: *
181: * @param mixed $key Primary key to use for the query
182: * @param PropelPDO $con A connection object
183: *
184: * @return FeatureCvtermDbxref|FeatureCvtermDbxref[]|mixed the result, formatted by the current formatter
185: */
186: protected function findPkComplex($key, $con)
187: {
188: // As the query uses a PK condition, no limit(1) is necessary.
189: $criteria = $this->isKeepQuery() ? clone $this : $this;
190: $stmt = $criteria
191: ->filterByPrimaryKey($key)
192: ->doSelect($con);
193:
194: return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
195: }
196:
197: /**
198: * Find objects by primary key
199: * <code>
200: * $objs = $c->findPks(array(12, 56, 832), $con);
201: * </code>
202: * @param array $keys Primary keys to use for the query
203: * @param PropelPDO $con an optional connection object
204: *
205: * @return PropelObjectCollection|FeatureCvtermDbxref[]|mixed the list of results, formatted by the current formatter
206: */
207: public function findPks($keys, $con = null)
208: {
209: if ($con === null) {
210: $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);
211: }
212: $this->basePreSelect($con);
213: $criteria = $this->isKeepQuery() ? clone $this : $this;
214: $stmt = $criteria
215: ->filterByPrimaryKeys($keys)
216: ->doSelect($con);
217:
218: return $criteria->getFormatter()->init($criteria)->format($stmt);
219: }
220:
221: /**
222: * Filter the query by primary key
223: *
224: * @param mixed $key Primary key to use for the query
225: *
226: * @return FeatureCvtermDbxrefQuery The current query, for fluid interface
227: */
228: public function filterByPrimaryKey($key)
229: {
230:
231: return $this->addUsingAlias(FeatureCvtermDbxrefPeer::FEATURE_CVTERM_DBXREF_ID, $key, Criteria::EQUAL);
232: }
233:
234: /**
235: * Filter the query by a list of primary keys
236: *
237: * @param array $keys The list of primary key to use for the query
238: *
239: * @return FeatureCvtermDbxrefQuery The current query, for fluid interface
240: */
241: public function filterByPrimaryKeys($keys)
242: {
243:
244: return $this->addUsingAlias(FeatureCvtermDbxrefPeer::FEATURE_CVTERM_DBXREF_ID, $keys, Criteria::IN);
245: }
246:
247: /**
248: * Filter the query on the feature_cvterm_dbxref_id column
249: *
250: * Example usage:
251: * <code>
252: * $query->filterByFeatureCvtermDbxrefId(1234); // WHERE feature_cvterm_dbxref_id = 1234
253: * $query->filterByFeatureCvtermDbxrefId(array(12, 34)); // WHERE feature_cvterm_dbxref_id IN (12, 34)
254: * $query->filterByFeatureCvtermDbxrefId(array('min' => 12)); // WHERE feature_cvterm_dbxref_id >= 12
255: * $query->filterByFeatureCvtermDbxrefId(array('max' => 12)); // WHERE feature_cvterm_dbxref_id <= 12
256: * </code>
257: *
258: * @param mixed $featureCvtermDbxrefId The value to use as filter.
259: * Use scalar values for equality.
260: * Use array values for in_array() equivalent.
261: * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
262: * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
263: *
264: * @return FeatureCvtermDbxrefQuery The current query, for fluid interface
265: */
266: public function filterByFeatureCvtermDbxrefId($featureCvtermDbxrefId = null, $comparison = null)
267: {
268: if (is_array($featureCvtermDbxrefId)) {
269: $useMinMax = false;
270: if (isset($featureCvtermDbxrefId['min'])) {
271: $this->addUsingAlias(FeatureCvtermDbxrefPeer::FEATURE_CVTERM_DBXREF_ID, $featureCvtermDbxrefId['min'], Criteria::GREATER_EQUAL);
272: $useMinMax = true;
273: }
274: if (isset($featureCvtermDbxrefId['max'])) {
275: $this->addUsingAlias(FeatureCvtermDbxrefPeer::FEATURE_CVTERM_DBXREF_ID, $featureCvtermDbxrefId['max'], Criteria::LESS_EQUAL);
276: $useMinMax = true;
277: }
278: if ($useMinMax) {
279: return $this;
280: }
281: if (null === $comparison) {
282: $comparison = Criteria::IN;
283: }
284: }
285:
286: return $this->addUsingAlias(FeatureCvtermDbxrefPeer::FEATURE_CVTERM_DBXREF_ID, $featureCvtermDbxrefId, $comparison);
287: }
288:
289: /**
290: * Filter the query on the feature_cvterm_id column
291: *
292: * Example usage:
293: * <code>
294: * $query->filterByFeatureCvtermId(1234); // WHERE feature_cvterm_id = 1234
295: * $query->filterByFeatureCvtermId(array(12, 34)); // WHERE feature_cvterm_id IN (12, 34)
296: * $query->filterByFeatureCvtermId(array('min' => 12)); // WHERE feature_cvterm_id >= 12
297: * $query->filterByFeatureCvtermId(array('max' => 12)); // WHERE feature_cvterm_id <= 12
298: * </code>
299: *
300: * @see filterByFeatureCvterm()
301: *
302: * @param mixed $featureCvtermId The value to use as filter.
303: * Use scalar values for equality.
304: * Use array values for in_array() equivalent.
305: * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
306: * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
307: *
308: * @return FeatureCvtermDbxrefQuery The current query, for fluid interface
309: */
310: public function filterByFeatureCvtermId($featureCvtermId = null, $comparison = null)
311: {
312: if (is_array($featureCvtermId)) {
313: $useMinMax = false;
314: if (isset($featureCvtermId['min'])) {
315: $this->addUsingAlias(FeatureCvtermDbxrefPeer::FEATURE_CVTERM_ID, $featureCvtermId['min'], Criteria::GREATER_EQUAL);
316: $useMinMax = true;
317: }
318: if (isset($featureCvtermId['max'])) {
319: $this->addUsingAlias(FeatureCvtermDbxrefPeer::FEATURE_CVTERM_ID, $featureCvtermId['max'], Criteria::LESS_EQUAL);
320: $useMinMax = true;
321: }
322: if ($useMinMax) {
323: return $this;
324: }
325: if (null === $comparison) {
326: $comparison = Criteria::IN;
327: }
328: }
329:
330: return $this->addUsingAlias(FeatureCvtermDbxrefPeer::FEATURE_CVTERM_ID, $featureCvtermId, $comparison);
331: }
332:
333: /**
334: * Filter the query on the dbxref_id column
335: *
336: * Example usage:
337: * <code>
338: * $query->filterByDbxrefId(1234); // WHERE dbxref_id = 1234
339: * $query->filterByDbxrefId(array(12, 34)); // WHERE dbxref_id IN (12, 34)
340: * $query->filterByDbxrefId(array('min' => 12)); // WHERE dbxref_id >= 12
341: * $query->filterByDbxrefId(array('max' => 12)); // WHERE dbxref_id <= 12
342: * </code>
343: *
344: * @see filterByDbxref()
345: *
346: * @param mixed $dbxrefId The value to use as filter.
347: * Use scalar values for equality.
348: * Use array values for in_array() equivalent.
349: * Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
350: * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
351: *
352: * @return FeatureCvtermDbxrefQuery The current query, for fluid interface
353: */
354: public function filterByDbxrefId($dbxrefId = null, $comparison = null)
355: {
356: if (is_array($dbxrefId)) {
357: $useMinMax = false;
358: if (isset($dbxrefId['min'])) {
359: $this->addUsingAlias(FeatureCvtermDbxrefPeer::DBXREF_ID, $dbxrefId['min'], Criteria::GREATER_EQUAL);
360: $useMinMax = true;
361: }
362: if (isset($dbxrefId['max'])) {
363: $this->addUsingAlias(FeatureCvtermDbxrefPeer::DBXREF_ID, $dbxrefId['max'], Criteria::LESS_EQUAL);
364: $useMinMax = true;
365: }
366: if ($useMinMax) {
367: return $this;
368: }
369: if (null === $comparison) {
370: $comparison = Criteria::IN;
371: }
372: }
373:
374: return $this->addUsingAlias(FeatureCvtermDbxrefPeer::DBXREF_ID, $dbxrefId, $comparison);
375: }
376:
377: /**
378: * Filter the query by a related Dbxref object
379: *
380: * @param Dbxref|PropelObjectCollection $dbxref The related object(s) to use as filter
381: * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
382: *
383: * @return FeatureCvtermDbxrefQuery The current query, for fluid interface
384: * @throws PropelException - if the provided filter is invalid.
385: */
386: public function filterByDbxref($dbxref, $comparison = null)
387: {
388: if ($dbxref instanceof Dbxref) {
389: return $this
390: ->addUsingAlias(FeatureCvtermDbxrefPeer::DBXREF_ID, $dbxref->getDbxrefId(), $comparison);
391: } elseif ($dbxref instanceof PropelObjectCollection) {
392: if (null === $comparison) {
393: $comparison = Criteria::IN;
394: }
395:
396: return $this
397: ->addUsingAlias(FeatureCvtermDbxrefPeer::DBXREF_ID, $dbxref->toKeyValue('PrimaryKey', 'DbxrefId'), $comparison);
398: } else {
399: throw new PropelException('filterByDbxref() only accepts arguments of type Dbxref or PropelCollection');
400: }
401: }
402:
403: /**
404: * Adds a JOIN clause to the query using the Dbxref relation
405: *
406: * @param string $relationAlias optional alias for the relation
407: * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
408: *
409: * @return FeatureCvtermDbxrefQuery The current query, for fluid interface
410: */
411: public function joinDbxref($relationAlias = null, $joinType = Criteria::INNER_JOIN)
412: {
413: $tableMap = $this->getTableMap();
414: $relationMap = $tableMap->getRelation('Dbxref');
415:
416: // create a ModelJoin object for this join
417: $join = new ModelJoin();
418: $join->setJoinType($joinType);
419: $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
420: if ($previousJoin = $this->getPreviousJoin()) {
421: $join->setPreviousJoin($previousJoin);
422: }
423:
424: // add the ModelJoin to the current object
425: if ($relationAlias) {
426: $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
427: $this->addJoinObject($join, $relationAlias);
428: } else {
429: $this->addJoinObject($join, 'Dbxref');
430: }
431:
432: return $this;
433: }
434:
435: /**
436: * Use the Dbxref relation Dbxref object
437: *
438: * @see useQuery()
439: *
440: * @param string $relationAlias optional alias for the relation,
441: * to be used as main alias in the secondary query
442: * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
443: *
444: * @return \cli_db\propel\DbxrefQuery A secondary query class using the current class as primary query
445: */
446: public function useDbxrefQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
447: {
448: return $this
449: ->joinDbxref($relationAlias, $joinType)
450: ->useQuery($relationAlias ? $relationAlias : 'Dbxref', '\cli_db\propel\DbxrefQuery');
451: }
452:
453: /**
454: * Filter the query by a related FeatureCvterm object
455: *
456: * @param FeatureCvterm|PropelObjectCollection $featureCvterm The related object(s) to use as filter
457: * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
458: *
459: * @return FeatureCvtermDbxrefQuery The current query, for fluid interface
460: * @throws PropelException - if the provided filter is invalid.
461: */
462: public function filterByFeatureCvterm($featureCvterm, $comparison = null)
463: {
464: if ($featureCvterm instanceof FeatureCvterm) {
465: return $this
466: ->addUsingAlias(FeatureCvtermDbxrefPeer::FEATURE_CVTERM_ID, $featureCvterm->getFeatureCvtermId(), $comparison);
467: } elseif ($featureCvterm instanceof PropelObjectCollection) {
468: if (null === $comparison) {
469: $comparison = Criteria::IN;
470: }
471:
472: return $this
473: ->addUsingAlias(FeatureCvtermDbxrefPeer::FEATURE_CVTERM_ID, $featureCvterm->toKeyValue('PrimaryKey', 'FeatureCvtermId'), $comparison);
474: } else {
475: throw new PropelException('filterByFeatureCvterm() only accepts arguments of type FeatureCvterm or PropelCollection');
476: }
477: }
478:
479: /**
480: * Adds a JOIN clause to the query using the FeatureCvterm relation
481: *
482: * @param string $relationAlias optional alias for the relation
483: * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
484: *
485: * @return FeatureCvtermDbxrefQuery The current query, for fluid interface
486: */
487: public function joinFeatureCvterm($relationAlias = null, $joinType = Criteria::INNER_JOIN)
488: {
489: $tableMap = $this->getTableMap();
490: $relationMap = $tableMap->getRelation('FeatureCvterm');
491:
492: // create a ModelJoin object for this join
493: $join = new ModelJoin();
494: $join->setJoinType($joinType);
495: $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
496: if ($previousJoin = $this->getPreviousJoin()) {
497: $join->setPreviousJoin($previousJoin);
498: }
499:
500: // add the ModelJoin to the current object
501: if ($relationAlias) {
502: $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
503: $this->addJoinObject($join, $relationAlias);
504: } else {
505: $this->addJoinObject($join, 'FeatureCvterm');
506: }
507:
508: return $this;
509: }
510:
511: /**
512: * Use the FeatureCvterm relation FeatureCvterm object
513: *
514: * @see useQuery()
515: *
516: * @param string $relationAlias optional alias for the relation,
517: * to be used as main alias in the secondary query
518: * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
519: *
520: * @return \cli_db\propel\FeatureCvtermQuery A secondary query class using the current class as primary query
521: */
522: public function useFeatureCvtermQuery($relationAlias = null, $joinType = Criteria::INNER_JOIN)
523: {
524: return $this
525: ->joinFeatureCvterm($relationAlias, $joinType)
526: ->useQuery($relationAlias ? $relationAlias : 'FeatureCvterm', '\cli_db\propel\FeatureCvtermQuery');
527: }
528:
529: /**
530: * Exclude object from result
531: *
532: * @param FeatureCvtermDbxref $featureCvtermDbxref Object to remove from the list of results
533: *
534: * @return FeatureCvtermDbxrefQuery The current query, for fluid interface
535: */
536: public function prune($featureCvtermDbxref = null)
537: {
538: if ($featureCvtermDbxref) {
539: $this->addUsingAlias(FeatureCvtermDbxrefPeer::FEATURE_CVTERM_DBXREF_ID, $featureCvtermDbxref->getFeatureCvtermDbxrefId(), Criteria::NOT_EQUAL);
540: }
541:
542: return $this;
543: }
544:
545: }
546: