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