1: <?php
2:
3: namespace cli_db\propel\om;
4:
5: use \BaseObject;
6: use \BasePeer;
7: use \Criteria;
8: use \Exception;
9: use \PDO;
10: use \Persistent;
11: use \Propel;
12: use \PropelCollection;
13: use \PropelException;
14: use \PropelObjectCollection;
15: use \PropelPDO;
16: use cli_db\propel\Cvterm;
17: use cli_db\propel\CvtermQuery;
18: use cli_db\propel\Feature;
19: use cli_db\propel\FeatureCvterm;
20: use cli_db\propel\FeatureCvtermDbxref;
21: use cli_db\propel\FeatureCvtermDbxrefQuery;
22: use cli_db\propel\FeatureCvtermPeer;
23: use cli_db\propel\FeatureCvtermPub;
24: use cli_db\propel\FeatureCvtermPubQuery;
25: use cli_db\propel\FeatureCvtermQuery;
26: use cli_db\propel\FeatureCvtermprop;
27: use cli_db\propel\FeatureCvtermpropQuery;
28: use cli_db\propel\FeatureQuery;
29: use cli_db\propel\Pub;
30: use cli_db\propel\PubQuery;
31:
32: 33: 34: 35: 36: 37: 38:
39: abstract class BaseFeatureCvterm extends BaseObject implements Persistent
40: {
41: 42: 43:
44: const PEER = 'cli_db\\propel\\FeatureCvtermPeer';
45:
46: 47: 48: 49: 50: 51:
52: protected static $peer;
53:
54: 55: 56: 57:
58: protected $startCopy = false;
59:
60: 61: 62: 63:
64: protected $feature_cvterm_id;
65:
66: 67: 68: 69:
70: protected $feature_id;
71:
72: 73: 74: 75:
76: protected $cvterm_id;
77:
78: 79: 80: 81:
82: protected $pub_id;
83:
84: 85: 86: 87: 88:
89: protected $is_not;
90:
91: 92: 93: 94: 95:
96: protected $rank;
97:
98: 99: 100:
101: protected $aCvterm;
102:
103: 104: 105:
106: protected $aFeature;
107:
108: 109: 110:
111: protected $aPub;
112:
113: 114: 115:
116: protected $collFeatureCvtermDbxrefs;
117: protected $collFeatureCvtermDbxrefsPartial;
118:
119: 120: 121:
122: protected $collFeatureCvtermPubs;
123: protected $collFeatureCvtermPubsPartial;
124:
125: 126: 127:
128: protected $collFeatureCvtermprops;
129: protected $collFeatureCvtermpropsPartial;
130:
131: 132: 133: 134: 135:
136: protected $alreadyInSave = false;
137:
138: 139: 140: 141: 142:
143: protected $alreadyInValidation = false;
144:
145: 146: 147: 148:
149: protected $alreadyInClearAllReferencesDeep = false;
150:
151: 152: 153: 154:
155: protected $featureCvtermDbxrefsScheduledForDeletion = null;
156:
157: 158: 159: 160:
161: protected $featureCvtermPubsScheduledForDeletion = null;
162:
163: 164: 165: 166:
167: protected $featureCvtermpropsScheduledForDeletion = null;
168:
169: 170: 171: 172: 173: 174:
175: public function applyDefaultValues()
176: {
177: $this->is_not = false;
178: $this->rank = 0;
179: }
180:
181: 182: 183: 184:
185: public function __construct()
186: {
187: parent::__construct();
188: $this->applyDefaultValues();
189: }
190:
191: 192: 193: 194: 195:
196: public function getFeatureCvtermId()
197: {
198: return $this->feature_cvterm_id;
199: }
200:
201: 202: 203: 204: 205:
206: public function getFeatureId()
207: {
208: return $this->feature_id;
209: }
210:
211: 212: 213: 214: 215:
216: public function getCvtermId()
217: {
218: return $this->cvterm_id;
219: }
220:
221: 222: 223: 224: 225:
226: public function getPubId()
227: {
228: return $this->pub_id;
229: }
230:
231: 232: 233: 234: 235:
236: public function getIsNot()
237: {
238: return $this->is_not;
239: }
240:
241: 242: 243: 244: 245:
246: public function getRank()
247: {
248: return $this->rank;
249: }
250:
251: 252: 253: 254: 255: 256:
257: public function setFeatureCvtermId($v)
258: {
259: if ($v !== null && is_numeric($v)) {
260: $v = (int) $v;
261: }
262:
263: if ($this->feature_cvterm_id !== $v) {
264: $this->feature_cvterm_id = $v;
265: $this->modifiedColumns[] = FeatureCvtermPeer::FEATURE_CVTERM_ID;
266: }
267:
268:
269: return $this;
270: }
271:
272: 273: 274: 275: 276: 277:
278: public function setFeatureId($v)
279: {
280: if ($v !== null && is_numeric($v)) {
281: $v = (int) $v;
282: }
283:
284: if ($this->feature_id !== $v) {
285: $this->feature_id = $v;
286: $this->modifiedColumns[] = FeatureCvtermPeer::FEATURE_ID;
287: }
288:
289: if ($this->aFeature !== null && $this->aFeature->getFeatureId() !== $v) {
290: $this->aFeature = null;
291: }
292:
293:
294: return $this;
295: }
296:
297: 298: 299: 300: 301: 302:
303: public function setCvtermId($v)
304: {
305: if ($v !== null && is_numeric($v)) {
306: $v = (int) $v;
307: }
308:
309: if ($this->cvterm_id !== $v) {
310: $this->cvterm_id = $v;
311: $this->modifiedColumns[] = FeatureCvtermPeer::CVTERM_ID;
312: }
313:
314: if ($this->aCvterm !== null && $this->aCvterm->getCvtermId() !== $v) {
315: $this->aCvterm = null;
316: }
317:
318:
319: return $this;
320: }
321:
322: 323: 324: 325: 326: 327:
328: public function setPubId($v)
329: {
330: if ($v !== null && is_numeric($v)) {
331: $v = (int) $v;
332: }
333:
334: if ($this->pub_id !== $v) {
335: $this->pub_id = $v;
336: $this->modifiedColumns[] = FeatureCvtermPeer::PUB_ID;
337: }
338:
339: if ($this->aPub !== null && $this->aPub->getPubId() !== $v) {
340: $this->aPub = null;
341: }
342:
343:
344: return $this;
345: }
346:
347: 348: 349: 350: 351: 352: 353: 354: 355: 356:
357: public function setIsNot($v)
358: {
359: if ($v !== null) {
360: if (is_string($v)) {
361: $v = in_array(strtolower($v), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
362: } else {
363: $v = (boolean) $v;
364: }
365: }
366:
367: if ($this->is_not !== $v) {
368: $this->is_not = $v;
369: $this->modifiedColumns[] = FeatureCvtermPeer::IS_NOT;
370: }
371:
372:
373: return $this;
374: }
375:
376: 377: 378: 379: 380: 381:
382: public function setRank($v)
383: {
384: if ($v !== null && is_numeric($v)) {
385: $v = (int) $v;
386: }
387:
388: if ($this->rank !== $v) {
389: $this->rank = $v;
390: $this->modifiedColumns[] = FeatureCvtermPeer::RANK;
391: }
392:
393:
394: return $this;
395: }
396:
397: 398: 399: 400: 401: 402: 403: 404:
405: public function hasOnlyDefaultValues()
406: {
407: if ($this->is_not !== false) {
408: return false;
409: }
410:
411: if ($this->rank !== 0) {
412: return false;
413: }
414:
415:
416: return true;
417: }
418:
419: 420: 421: 422: 423: 424: 425: 426: 427: 428: 429: 430: 431: 432:
433: public function hydrate($row, $startcol = 0, $rehydrate = false)
434: {
435: try {
436:
437: $this->feature_cvterm_id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null;
438: $this->feature_id = ($row[$startcol + 1] !== null) ? (int) $row[$startcol + 1] : null;
439: $this->cvterm_id = ($row[$startcol + 2] !== null) ? (int) $row[$startcol + 2] : null;
440: $this->pub_id = ($row[$startcol + 3] !== null) ? (int) $row[$startcol + 3] : null;
441: $this->is_not = ($row[$startcol + 4] !== null) ? (boolean) $row[$startcol + 4] : null;
442: $this->rank = ($row[$startcol + 5] !== null) ? (int) $row[$startcol + 5] : null;
443: $this->resetModified();
444:
445: $this->setNew(false);
446:
447: if ($rehydrate) {
448: $this->ensureConsistency();
449: }
450: $this->postHydrate($row, $startcol, $rehydrate);
451: return $startcol + 6;
452:
453: } catch (Exception $e) {
454: throw new PropelException("Error populating FeatureCvterm object", $e);
455: }
456: }
457:
458: 459: 460: 461: 462: 463: 464: 465: 466: 467: 468: 469: 470:
471: public function ensureConsistency()
472: {
473:
474: if ($this->aFeature !== null && $this->feature_id !== $this->aFeature->getFeatureId()) {
475: $this->aFeature = null;
476: }
477: if ($this->aCvterm !== null && $this->cvterm_id !== $this->aCvterm->getCvtermId()) {
478: $this->aCvterm = null;
479: }
480: if ($this->aPub !== null && $this->pub_id !== $this->aPub->getPubId()) {
481: $this->aPub = null;
482: }
483: }
484:
485: 486: 487: 488: 489: 490: 491: 492: 493: 494:
495: public function reload($deep = false, PropelPDO $con = null)
496: {
497: if ($this->isDeleted()) {
498: throw new PropelException("Cannot reload a deleted object.");
499: }
500:
501: if ($this->isNew()) {
502: throw new PropelException("Cannot reload an unsaved object.");
503: }
504:
505: if ($con === null) {
506: $con = Propel::getConnection(FeatureCvtermPeer::DATABASE_NAME, Propel::CONNECTION_READ);
507: }
508:
509:
510:
511:
512: $stmt = FeatureCvtermPeer::doSelectStmt($this->buildPkeyCriteria(), $con);
513: $row = $stmt->fetch(PDO::FETCH_NUM);
514: $stmt->closeCursor();
515: if (!$row) {
516: throw new PropelException('Cannot find matching row in the database to reload object values.');
517: }
518: $this->hydrate($row, 0, true);
519:
520: if ($deep) {
521:
522: $this->aCvterm = null;
523: $this->aFeature = null;
524: $this->aPub = null;
525: $this->collFeatureCvtermDbxrefs = null;
526:
527: $this->collFeatureCvtermPubs = null;
528:
529: $this->collFeatureCvtermprops = null;
530:
531: }
532: }
533:
534: 535: 536: 537: 538: 539: 540: 541: 542: 543:
544: public function delete(PropelPDO $con = null)
545: {
546: if ($this->isDeleted()) {
547: throw new PropelException("This object has already been deleted.");
548: }
549:
550: if ($con === null) {
551: $con = Propel::getConnection(FeatureCvtermPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
552: }
553:
554: $con->beginTransaction();
555: try {
556: $deleteQuery = FeatureCvtermQuery::create()
557: ->filterByPrimaryKey($this->getPrimaryKey());
558: $ret = $this->preDelete($con);
559: if ($ret) {
560: $deleteQuery->delete($con);
561: $this->postDelete($con);
562: $con->commit();
563: $this->setDeleted(true);
564: } else {
565: $con->commit();
566: }
567: } catch (Exception $e) {
568: $con->rollBack();
569: throw $e;
570: }
571: }
572:
573: 574: 575: 576: 577: 578: 579: 580: 581: 582: 583: 584: 585: 586:
587: public function save(PropelPDO $con = null)
588: {
589: if ($this->isDeleted()) {
590: throw new PropelException("You cannot save an object that has been deleted.");
591: }
592:
593: if ($con === null) {
594: $con = Propel::getConnection(FeatureCvtermPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
595: }
596:
597: $con->beginTransaction();
598: $isInsert = $this->isNew();
599: try {
600: $ret = $this->preSave($con);
601: if ($isInsert) {
602: $ret = $ret && $this->preInsert($con);
603: } else {
604: $ret = $ret && $this->preUpdate($con);
605: }
606: if ($ret) {
607: $affectedRows = $this->doSave($con);
608: if ($isInsert) {
609: $this->postInsert($con);
610: } else {
611: $this->postUpdate($con);
612: }
613: $this->postSave($con);
614: FeatureCvtermPeer::addInstanceToPool($this);
615: } else {
616: $affectedRows = 0;
617: }
618: $con->commit();
619:
620: return $affectedRows;
621: } catch (Exception $e) {
622: $con->rollBack();
623: throw $e;
624: }
625: }
626:
627: 628: 629: 630: 631: 632: 633: 634: 635: 636: 637:
638: protected function doSave(PropelPDO $con)
639: {
640: $affectedRows = 0;
641: if (!$this->alreadyInSave) {
642: $this->alreadyInSave = true;
643:
644:
645:
646:
647:
648:
649: if ($this->aCvterm !== null) {
650: if ($this->aCvterm->isModified() || $this->aCvterm->isNew()) {
651: $affectedRows += $this->aCvterm->save($con);
652: }
653: $this->setCvterm($this->aCvterm);
654: }
655:
656: if ($this->aFeature !== null) {
657: if ($this->aFeature->isModified() || $this->aFeature->isNew()) {
658: $affectedRows += $this->aFeature->save($con);
659: }
660: $this->setFeature($this->aFeature);
661: }
662:
663: if ($this->aPub !== null) {
664: if ($this->aPub->isModified() || $this->aPub->isNew()) {
665: $affectedRows += $this->aPub->save($con);
666: }
667: $this->setPub($this->aPub);
668: }
669:
670: if ($this->isNew() || $this->isModified()) {
671:
672: if ($this->isNew()) {
673: $this->doInsert($con);
674: } else {
675: $this->doUpdate($con);
676: }
677: $affectedRows += 1;
678: $this->resetModified();
679: }
680:
681: if ($this->featureCvtermDbxrefsScheduledForDeletion !== null) {
682: if (!$this->featureCvtermDbxrefsScheduledForDeletion->isEmpty()) {
683: FeatureCvtermDbxrefQuery::create()
684: ->filterByPrimaryKeys($this->featureCvtermDbxrefsScheduledForDeletion->getPrimaryKeys(false))
685: ->delete($con);
686: $this->featureCvtermDbxrefsScheduledForDeletion = null;
687: }
688: }
689:
690: if ($this->collFeatureCvtermDbxrefs !== null) {
691: foreach ($this->collFeatureCvtermDbxrefs as $referrerFK) {
692: if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
693: $affectedRows += $referrerFK->save($con);
694: }
695: }
696: }
697:
698: if ($this->featureCvtermPubsScheduledForDeletion !== null) {
699: if (!$this->featureCvtermPubsScheduledForDeletion->isEmpty()) {
700: FeatureCvtermPubQuery::create()
701: ->filterByPrimaryKeys($this->featureCvtermPubsScheduledForDeletion->getPrimaryKeys(false))
702: ->delete($con);
703: $this->featureCvtermPubsScheduledForDeletion = null;
704: }
705: }
706:
707: if ($this->collFeatureCvtermPubs !== null) {
708: foreach ($this->collFeatureCvtermPubs as $referrerFK) {
709: if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
710: $affectedRows += $referrerFK->save($con);
711: }
712: }
713: }
714:
715: if ($this->featureCvtermpropsScheduledForDeletion !== null) {
716: if (!$this->featureCvtermpropsScheduledForDeletion->isEmpty()) {
717: FeatureCvtermpropQuery::create()
718: ->filterByPrimaryKeys($this->featureCvtermpropsScheduledForDeletion->getPrimaryKeys(false))
719: ->delete($con);
720: $this->featureCvtermpropsScheduledForDeletion = null;
721: }
722: }
723:
724: if ($this->collFeatureCvtermprops !== null) {
725: foreach ($this->collFeatureCvtermprops as $referrerFK) {
726: if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
727: $affectedRows += $referrerFK->save($con);
728: }
729: }
730: }
731:
732: $this->alreadyInSave = false;
733:
734: }
735:
736: return $affectedRows;
737: }
738:
739: 740: 741: 742: 743: 744: 745: 746:
747: protected function doInsert(PropelPDO $con)
748: {
749: $modifiedColumns = array();
750: $index = 0;
751:
752: $this->modifiedColumns[] = FeatureCvtermPeer::FEATURE_CVTERM_ID;
753: if (null !== $this->feature_cvterm_id) {
754: throw new PropelException('Cannot insert a value for auto-increment primary key (' . FeatureCvtermPeer::FEATURE_CVTERM_ID . ')');
755: }
756: if (null === $this->feature_cvterm_id) {
757: try {
758: $stmt = $con->query("SELECT nextval('feature_cvterm_feature_cvterm_id_seq')");
759: $row = $stmt->fetch(PDO::FETCH_NUM);
760: $this->feature_cvterm_id = $row[0];
761: } catch (Exception $e) {
762: throw new PropelException('Unable to get sequence id.', $e);
763: }
764: }
765:
766:
767:
768: if ($this->isColumnModified(FeatureCvtermPeer::FEATURE_CVTERM_ID)) {
769: $modifiedColumns[':p' . $index++] = '"feature_cvterm_id"';
770: }
771: if ($this->isColumnModified(FeatureCvtermPeer::FEATURE_ID)) {
772: $modifiedColumns[':p' . $index++] = '"feature_id"';
773: }
774: if ($this->isColumnModified(FeatureCvtermPeer::CVTERM_ID)) {
775: $modifiedColumns[':p' . $index++] = '"cvterm_id"';
776: }
777: if ($this->isColumnModified(FeatureCvtermPeer::PUB_ID)) {
778: $modifiedColumns[':p' . $index++] = '"pub_id"';
779: }
780: if ($this->isColumnModified(FeatureCvtermPeer::IS_NOT)) {
781: $modifiedColumns[':p' . $index++] = '"is_not"';
782: }
783: if ($this->isColumnModified(FeatureCvtermPeer::RANK)) {
784: $modifiedColumns[':p' . $index++] = '"rank"';
785: }
786:
787: $sql = sprintf(
788: 'INSERT INTO "feature_cvterm" (%s) VALUES (%s)',
789: implode(', ', $modifiedColumns),
790: implode(', ', array_keys($modifiedColumns))
791: );
792:
793: try {
794: $stmt = $con->prepare($sql);
795: foreach ($modifiedColumns as $identifier => $columnName) {
796: switch ($columnName) {
797: case '"feature_cvterm_id"':
798: $stmt->bindValue($identifier, $this->feature_cvterm_id, PDO::PARAM_INT);
799: break;
800: case '"feature_id"':
801: $stmt->bindValue($identifier, $this->feature_id, PDO::PARAM_INT);
802: break;
803: case '"cvterm_id"':
804: $stmt->bindValue($identifier, $this->cvterm_id, PDO::PARAM_INT);
805: break;
806: case '"pub_id"':
807: $stmt->bindValue($identifier, $this->pub_id, PDO::PARAM_INT);
808: break;
809: case '"is_not"':
810: $stmt->bindValue($identifier, $this->is_not, PDO::PARAM_BOOL);
811: break;
812: case '"rank"':
813: $stmt->bindValue($identifier, $this->rank, PDO::PARAM_INT);
814: break;
815: }
816: }
817: $stmt->execute();
818: } catch (Exception $e) {
819: Propel::log($e->getMessage(), Propel::LOG_ERR);
820: throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), $e);
821: }
822:
823: $this->setNew(false);
824: }
825:
826: 827: 828: 829: 830: 831: 832:
833: protected function doUpdate(PropelPDO $con)
834: {
835: $selectCriteria = $this->buildPkeyCriteria();
836: $valuesCriteria = $this->buildCriteria();
837: BasePeer::doUpdate($selectCriteria, $valuesCriteria, $con);
838: }
839:
840: 841: 842: 843:
844: protected $validationFailures = array();
845:
846: 847: 848: 849: 850: 851: 852:
853: public function getValidationFailures()
854: {
855: return $this->validationFailures;
856: }
857:
858: 859: 860: 861: 862: 863: 864: 865: 866: 867: 868:
869: public function validate($columns = null)
870: {
871: $res = $this->doValidate($columns);
872: if ($res === true) {
873: $this->validationFailures = array();
874:
875: return true;
876: }
877:
878: $this->validationFailures = $res;
879:
880: return false;
881: }
882:
883: 884: 885: 886: 887: 888: 889: 890: 891: 892:
893: protected function doValidate($columns = null)
894: {
895: if (!$this->alreadyInValidation) {
896: $this->alreadyInValidation = true;
897: $retval = null;
898:
899: $failureMap = array();
900:
901:
902:
903:
904:
905:
906:
907: if ($this->aCvterm !== null) {
908: if (!$this->aCvterm->validate($columns)) {
909: $failureMap = array_merge($failureMap, $this->aCvterm->getValidationFailures());
910: }
911: }
912:
913: if ($this->aFeature !== null) {
914: if (!$this->aFeature->validate($columns)) {
915: $failureMap = array_merge($failureMap, $this->aFeature->getValidationFailures());
916: }
917: }
918:
919: if ($this->aPub !== null) {
920: if (!$this->aPub->validate($columns)) {
921: $failureMap = array_merge($failureMap, $this->aPub->getValidationFailures());
922: }
923: }
924:
925:
926: if (($retval = FeatureCvtermPeer::doValidate($this, $columns)) !== true) {
927: $failureMap = array_merge($failureMap, $retval);
928: }
929:
930:
931: if ($this->collFeatureCvtermDbxrefs !== null) {
932: foreach ($this->collFeatureCvtermDbxrefs as $referrerFK) {
933: if (!$referrerFK->validate($columns)) {
934: $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
935: }
936: }
937: }
938:
939: if ($this->collFeatureCvtermPubs !== null) {
940: foreach ($this->collFeatureCvtermPubs as $referrerFK) {
941: if (!$referrerFK->validate($columns)) {
942: $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
943: }
944: }
945: }
946:
947: if ($this->collFeatureCvtermprops !== null) {
948: foreach ($this->collFeatureCvtermprops as $referrerFK) {
949: if (!$referrerFK->validate($columns)) {
950: $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
951: }
952: }
953: }
954:
955:
956: $this->alreadyInValidation = false;
957: }
958:
959: return (!empty($failureMap) ? $failureMap : true);
960: }
961:
962: 963: 964: 965: 966: 967: 968: 969: 970: 971:
972: public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
973: {
974: $pos = FeatureCvtermPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
975: $field = $this->getByPosition($pos);
976:
977: return $field;
978: }
979:
980: 981: 982: 983: 984: 985: 986:
987: public function getByPosition($pos)
988: {
989: switch ($pos) {
990: case 0:
991: return $this->getFeatureCvtermId();
992: break;
993: case 1:
994: return $this->getFeatureId();
995: break;
996: case 2:
997: return $this->getCvtermId();
998: break;
999: case 3:
1000: return $this->getPubId();
1001: break;
1002: case 4:
1003: return $this->getIsNot();
1004: break;
1005: case 5:
1006: return $this->getRank();
1007: break;
1008: default:
1009: return null;
1010: break;
1011: }
1012: }
1013:
1014: 1015: 1016: 1017: 1018: 1019: 1020: 1021: 1022: 1023: 1024: 1025: 1026: 1027: 1028:
1029: public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
1030: {
1031: if (isset($alreadyDumpedObjects['FeatureCvterm'][$this->getPrimaryKey()])) {
1032: return '*RECURSION*';
1033: }
1034: $alreadyDumpedObjects['FeatureCvterm'][$this->getPrimaryKey()] = true;
1035: $keys = FeatureCvtermPeer::getFieldNames($keyType);
1036: $result = array(
1037: $keys[0] => $this->getFeatureCvtermId(),
1038: $keys[1] => $this->getFeatureId(),
1039: $keys[2] => $this->getCvtermId(),
1040: $keys[3] => $this->getPubId(),
1041: $keys[4] => $this->getIsNot(),
1042: $keys[5] => $this->getRank(),
1043: );
1044: if ($includeForeignObjects) {
1045: if (null !== $this->aCvterm) {
1046: $result['Cvterm'] = $this->aCvterm->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
1047: }
1048: if (null !== $this->aFeature) {
1049: $result['Feature'] = $this->aFeature->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
1050: }
1051: if (null !== $this->aPub) {
1052: $result['Pub'] = $this->aPub->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
1053: }
1054: if (null !== $this->collFeatureCvtermDbxrefs) {
1055: $result['FeatureCvtermDbxrefs'] = $this->collFeatureCvtermDbxrefs->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
1056: }
1057: if (null !== $this->collFeatureCvtermPubs) {
1058: $result['FeatureCvtermPubs'] = $this->collFeatureCvtermPubs->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
1059: }
1060: if (null !== $this->collFeatureCvtermprops) {
1061: $result['FeatureCvtermprops'] = $this->collFeatureCvtermprops->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
1062: }
1063: }
1064:
1065: return $result;
1066: }
1067:
1068: 1069: 1070: 1071: 1072: 1073: 1074: 1075: 1076: 1077: 1078:
1079: public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
1080: {
1081: $pos = FeatureCvtermPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
1082:
1083: $this->setByPosition($pos, $value);
1084: }
1085:
1086: 1087: 1088: 1089: 1090: 1091: 1092: 1093:
1094: public function setByPosition($pos, $value)
1095: {
1096: switch ($pos) {
1097: case 0:
1098: $this->setFeatureCvtermId($value);
1099: break;
1100: case 1:
1101: $this->setFeatureId($value);
1102: break;
1103: case 2:
1104: $this->setCvtermId($value);
1105: break;
1106: case 3:
1107: $this->setPubId($value);
1108: break;
1109: case 4:
1110: $this->setIsNot($value);
1111: break;
1112: case 5:
1113: $this->setRank($value);
1114: break;
1115: }
1116: }
1117:
1118: 1119: 1120: 1121: 1122: 1123: 1124: 1125: 1126: 1127: 1128: 1129: 1130: 1131: 1132: 1133: 1134:
1135: public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
1136: {
1137: $keys = FeatureCvtermPeer::getFieldNames($keyType);
1138:
1139: if (array_key_exists($keys[0], $arr)) $this->setFeatureCvtermId($arr[$keys[0]]);
1140: if (array_key_exists($keys[1], $arr)) $this->setFeatureId($arr[$keys[1]]);
1141: if (array_key_exists($keys[2], $arr)) $this->setCvtermId($arr[$keys[2]]);
1142: if (array_key_exists($keys[3], $arr)) $this->setPubId($arr[$keys[3]]);
1143: if (array_key_exists($keys[4], $arr)) $this->setIsNot($arr[$keys[4]]);
1144: if (array_key_exists($keys[5], $arr)) $this->setRank($arr[$keys[5]]);
1145: }
1146:
1147: 1148: 1149: 1150: 1151:
1152: public function buildCriteria()
1153: {
1154: $criteria = new Criteria(FeatureCvtermPeer::DATABASE_NAME);
1155:
1156: if ($this->isColumnModified(FeatureCvtermPeer::FEATURE_CVTERM_ID)) $criteria->add(FeatureCvtermPeer::FEATURE_CVTERM_ID, $this->feature_cvterm_id);
1157: if ($this->isColumnModified(FeatureCvtermPeer::FEATURE_ID)) $criteria->add(FeatureCvtermPeer::FEATURE_ID, $this->feature_id);
1158: if ($this->isColumnModified(FeatureCvtermPeer::CVTERM_ID)) $criteria->add(FeatureCvtermPeer::CVTERM_ID, $this->cvterm_id);
1159: if ($this->isColumnModified(FeatureCvtermPeer::PUB_ID)) $criteria->add(FeatureCvtermPeer::PUB_ID, $this->pub_id);
1160: if ($this->isColumnModified(FeatureCvtermPeer::IS_NOT)) $criteria->add(FeatureCvtermPeer::IS_NOT, $this->is_not);
1161: if ($this->isColumnModified(FeatureCvtermPeer::RANK)) $criteria->add(FeatureCvtermPeer::RANK, $this->rank);
1162:
1163: return $criteria;
1164: }
1165:
1166: 1167: 1168: 1169: 1170: 1171: 1172: 1173:
1174: public function buildPkeyCriteria()
1175: {
1176: $criteria = new Criteria(FeatureCvtermPeer::DATABASE_NAME);
1177: $criteria->add(FeatureCvtermPeer::FEATURE_CVTERM_ID, $this->feature_cvterm_id);
1178:
1179: return $criteria;
1180: }
1181:
1182: 1183: 1184: 1185:
1186: public function getPrimaryKey()
1187: {
1188: return $this->getFeatureCvtermId();
1189: }
1190:
1191: 1192: 1193: 1194: 1195: 1196:
1197: public function setPrimaryKey($key)
1198: {
1199: $this->setFeatureCvtermId($key);
1200: }
1201:
1202: 1203: 1204: 1205:
1206: public function isPrimaryKeyNull()
1207: {
1208:
1209: return null === $this->getFeatureCvtermId();
1210: }
1211:
1212: 1213: 1214: 1215: 1216: 1217: 1218: 1219: 1220: 1221: 1222:
1223: public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
1224: {
1225: $copyObj->setFeatureId($this->getFeatureId());
1226: $copyObj->setCvtermId($this->getCvtermId());
1227: $copyObj->setPubId($this->getPubId());
1228: $copyObj->setIsNot($this->getIsNot());
1229: $copyObj->setRank($this->getRank());
1230:
1231: if ($deepCopy && !$this->startCopy) {
1232:
1233:
1234: $copyObj->setNew(false);
1235:
1236: $this->startCopy = true;
1237:
1238: foreach ($this->getFeatureCvtermDbxrefs() as $relObj) {
1239: if ($relObj !== $this) {
1240: $copyObj->addFeatureCvtermDbxref($relObj->copy($deepCopy));
1241: }
1242: }
1243:
1244: foreach ($this->getFeatureCvtermPubs() as $relObj) {
1245: if ($relObj !== $this) {
1246: $copyObj->addFeatureCvtermPub($relObj->copy($deepCopy));
1247: }
1248: }
1249:
1250: foreach ($this->getFeatureCvtermprops() as $relObj) {
1251: if ($relObj !== $this) {
1252: $copyObj->addFeatureCvtermprop($relObj->copy($deepCopy));
1253: }
1254: }
1255:
1256:
1257: $this->startCopy = false;
1258: }
1259:
1260: if ($makeNew) {
1261: $copyObj->setNew(true);
1262: $copyObj->setFeatureCvtermId(NULL);
1263: }
1264: }
1265:
1266: 1267: 1268: 1269: 1270: 1271: 1272: 1273: 1274: 1275: 1276: 1277:
1278: public function copy($deepCopy = false)
1279: {
1280:
1281: $clazz = get_class($this);
1282: $copyObj = new $clazz();
1283: $this->copyInto($copyObj, $deepCopy);
1284:
1285: return $copyObj;
1286: }
1287:
1288: 1289: 1290: 1291: 1292: 1293: 1294: 1295: 1296:
1297: public function getPeer()
1298: {
1299: if (self::$peer === null) {
1300: self::$peer = new FeatureCvtermPeer();
1301: }
1302:
1303: return self::$peer;
1304: }
1305:
1306: 1307: 1308: 1309: 1310: 1311: 1312:
1313: public function setCvterm(Cvterm $v = null)
1314: {
1315: if ($v === null) {
1316: $this->setCvtermId(NULL);
1317: } else {
1318: $this->setCvtermId($v->getCvtermId());
1319: }
1320:
1321: $this->aCvterm = $v;
1322:
1323:
1324:
1325: if ($v !== null) {
1326: $v->addFeatureCvterm($this);
1327: }
1328:
1329:
1330: return $this;
1331: }
1332:
1333:
1334: 1335: 1336: 1337: 1338: 1339: 1340: 1341:
1342: public function getCvterm(PropelPDO $con = null, $doQuery = true)
1343: {
1344: if ($this->aCvterm === null && ($this->cvterm_id !== null) && $doQuery) {
1345: $this->aCvterm = CvtermQuery::create()->findPk($this->cvterm_id, $con);
1346: 1347: 1348: 1349: 1350: 1351: 1352:
1353: }
1354:
1355: return $this->aCvterm;
1356: }
1357:
1358: 1359: 1360: 1361: 1362: 1363: 1364:
1365: public function setFeature(Feature $v = null)
1366: {
1367: if ($v === null) {
1368: $this->setFeatureId(NULL);
1369: } else {
1370: $this->setFeatureId($v->getFeatureId());
1371: }
1372:
1373: $this->aFeature = $v;
1374:
1375:
1376:
1377: if ($v !== null) {
1378: $v->addFeatureCvterm($this);
1379: }
1380:
1381:
1382: return $this;
1383: }
1384:
1385:
1386: 1387: 1388: 1389: 1390: 1391: 1392: 1393:
1394: public function getFeature(PropelPDO $con = null, $doQuery = true)
1395: {
1396: if ($this->aFeature === null && ($this->feature_id !== null) && $doQuery) {
1397: $this->aFeature = FeatureQuery::create()->findPk($this->feature_id, $con);
1398: 1399: 1400: 1401: 1402: 1403: 1404:
1405: }
1406:
1407: return $this->aFeature;
1408: }
1409:
1410: 1411: 1412: 1413: 1414: 1415: 1416:
1417: public function setPub(Pub $v = null)
1418: {
1419: if ($v === null) {
1420: $this->setPubId(NULL);
1421: } else {
1422: $this->setPubId($v->getPubId());
1423: }
1424:
1425: $this->aPub = $v;
1426:
1427:
1428:
1429: if ($v !== null) {
1430: $v->addFeatureCvterm($this);
1431: }
1432:
1433:
1434: return $this;
1435: }
1436:
1437:
1438: 1439: 1440: 1441: 1442: 1443: 1444: 1445:
1446: public function getPub(PropelPDO $con = null, $doQuery = true)
1447: {
1448: if ($this->aPub === null && ($this->pub_id !== null) && $doQuery) {
1449: $this->aPub = PubQuery::create()->findPk($this->pub_id, $con);
1450: 1451: 1452: 1453: 1454: 1455: 1456:
1457: }
1458:
1459: return $this->aPub;
1460: }
1461:
1462:
1463: 1464: 1465: 1466: 1467: 1468: 1469: 1470:
1471: public function initRelation($relationName)
1472: {
1473: if ('FeatureCvtermDbxref' == $relationName) {
1474: $this->initFeatureCvtermDbxrefs();
1475: }
1476: if ('FeatureCvtermPub' == $relationName) {
1477: $this->initFeatureCvtermPubs();
1478: }
1479: if ('FeatureCvtermprop' == $relationName) {
1480: $this->initFeatureCvtermprops();
1481: }
1482: }
1483:
1484: 1485: 1486: 1487: 1488: 1489: 1490: 1491: 1492:
1493: public function clearFeatureCvtermDbxrefs()
1494: {
1495: $this->collFeatureCvtermDbxrefs = null;
1496: $this->collFeatureCvtermDbxrefsPartial = null;
1497:
1498: return $this;
1499: }
1500:
1501: 1502: 1503: 1504: 1505:
1506: public function resetPartialFeatureCvtermDbxrefs($v = true)
1507: {
1508: $this->collFeatureCvtermDbxrefsPartial = $v;
1509: }
1510:
1511: 1512: 1513: 1514: 1515: 1516: 1517: 1518: 1519: 1520: 1521: 1522:
1523: public function initFeatureCvtermDbxrefs($overrideExisting = true)
1524: {
1525: if (null !== $this->collFeatureCvtermDbxrefs && !$overrideExisting) {
1526: return;
1527: }
1528: $this->collFeatureCvtermDbxrefs = new PropelObjectCollection();
1529: $this->collFeatureCvtermDbxrefs->setModel('FeatureCvtermDbxref');
1530: }
1531:
1532: 1533: 1534: 1535: 1536: 1537: 1538: 1539: 1540: 1541: 1542: 1543: 1544: 1545:
1546: public function getFeatureCvtermDbxrefs($criteria = null, PropelPDO $con = null)
1547: {
1548: $partial = $this->collFeatureCvtermDbxrefsPartial && !$this->isNew();
1549: if (null === $this->collFeatureCvtermDbxrefs || null !== $criteria || $partial) {
1550: if ($this->isNew() && null === $this->collFeatureCvtermDbxrefs) {
1551:
1552: $this->initFeatureCvtermDbxrefs();
1553: } else {
1554: $collFeatureCvtermDbxrefs = FeatureCvtermDbxrefQuery::create(null, $criteria)
1555: ->filterByFeatureCvterm($this)
1556: ->find($con);
1557: if (null !== $criteria) {
1558: if (false !== $this->collFeatureCvtermDbxrefsPartial && count($collFeatureCvtermDbxrefs)) {
1559: $this->initFeatureCvtermDbxrefs(false);
1560:
1561: foreach($collFeatureCvtermDbxrefs as $obj) {
1562: if (false == $this->collFeatureCvtermDbxrefs->contains($obj)) {
1563: $this->collFeatureCvtermDbxrefs->append($obj);
1564: }
1565: }
1566:
1567: $this->collFeatureCvtermDbxrefsPartial = true;
1568: }
1569:
1570: $collFeatureCvtermDbxrefs->getInternalIterator()->rewind();
1571: return $collFeatureCvtermDbxrefs;
1572: }
1573:
1574: if($partial && $this->collFeatureCvtermDbxrefs) {
1575: foreach($this->collFeatureCvtermDbxrefs as $obj) {
1576: if($obj->isNew()) {
1577: $collFeatureCvtermDbxrefs[] = $obj;
1578: }
1579: }
1580: }
1581:
1582: $this->collFeatureCvtermDbxrefs = $collFeatureCvtermDbxrefs;
1583: $this->collFeatureCvtermDbxrefsPartial = false;
1584: }
1585: }
1586:
1587: return $this->collFeatureCvtermDbxrefs;
1588: }
1589:
1590: 1591: 1592: 1593: 1594: 1595: 1596: 1597: 1598: 1599:
1600: public function setFeatureCvtermDbxrefs(PropelCollection $featureCvtermDbxrefs, PropelPDO $con = null)
1601: {
1602: $featureCvtermDbxrefsToDelete = $this->getFeatureCvtermDbxrefs(new Criteria(), $con)->diff($featureCvtermDbxrefs);
1603:
1604: $this->featureCvtermDbxrefsScheduledForDeletion = unserialize(serialize($featureCvtermDbxrefsToDelete));
1605:
1606: foreach ($featureCvtermDbxrefsToDelete as $featureCvtermDbxrefRemoved) {
1607: $featureCvtermDbxrefRemoved->setFeatureCvterm(null);
1608: }
1609:
1610: $this->collFeatureCvtermDbxrefs = null;
1611: foreach ($featureCvtermDbxrefs as $featureCvtermDbxref) {
1612: $this->addFeatureCvtermDbxref($featureCvtermDbxref);
1613: }
1614:
1615: $this->collFeatureCvtermDbxrefs = $featureCvtermDbxrefs;
1616: $this->collFeatureCvtermDbxrefsPartial = false;
1617:
1618: return $this;
1619: }
1620:
1621: 1622: 1623: 1624: 1625: 1626: 1627: 1628: 1629:
1630: public function countFeatureCvtermDbxrefs(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
1631: {
1632: $partial = $this->collFeatureCvtermDbxrefsPartial && !$this->isNew();
1633: if (null === $this->collFeatureCvtermDbxrefs || null !== $criteria || $partial) {
1634: if ($this->isNew() && null === $this->collFeatureCvtermDbxrefs) {
1635: return 0;
1636: }
1637:
1638: if($partial && !$criteria) {
1639: return count($this->getFeatureCvtermDbxrefs());
1640: }
1641: $query = FeatureCvtermDbxrefQuery::create(null, $criteria);
1642: if ($distinct) {
1643: $query->distinct();
1644: }
1645:
1646: return $query
1647: ->filterByFeatureCvterm($this)
1648: ->count($con);
1649: }
1650:
1651: return count($this->collFeatureCvtermDbxrefs);
1652: }
1653:
1654: 1655: 1656: 1657: 1658: 1659: 1660:
1661: public function addFeatureCvtermDbxref(FeatureCvtermDbxref $l)
1662: {
1663: if ($this->collFeatureCvtermDbxrefs === null) {
1664: $this->initFeatureCvtermDbxrefs();
1665: $this->collFeatureCvtermDbxrefsPartial = true;
1666: }
1667: if (!in_array($l, $this->collFeatureCvtermDbxrefs->getArrayCopy(), true)) {
1668: $this->doAddFeatureCvtermDbxref($l);
1669: }
1670:
1671: return $this;
1672: }
1673:
1674: 1675: 1676:
1677: protected function doAddFeatureCvtermDbxref($featureCvtermDbxref)
1678: {
1679: $this->collFeatureCvtermDbxrefs[]= $featureCvtermDbxref;
1680: $featureCvtermDbxref->setFeatureCvterm($this);
1681: }
1682:
1683: 1684: 1685: 1686:
1687: public function removeFeatureCvtermDbxref($featureCvtermDbxref)
1688: {
1689: if ($this->getFeatureCvtermDbxrefs()->contains($featureCvtermDbxref)) {
1690: $this->collFeatureCvtermDbxrefs->remove($this->collFeatureCvtermDbxrefs->search($featureCvtermDbxref));
1691: if (null === $this->featureCvtermDbxrefsScheduledForDeletion) {
1692: $this->featureCvtermDbxrefsScheduledForDeletion = clone $this->collFeatureCvtermDbxrefs;
1693: $this->featureCvtermDbxrefsScheduledForDeletion->clear();
1694: }
1695: $this->featureCvtermDbxrefsScheduledForDeletion[]= clone $featureCvtermDbxref;
1696: $featureCvtermDbxref->setFeatureCvterm(null);
1697: }
1698:
1699: return $this;
1700: }
1701:
1702:
1703: 1704: 1705: 1706: 1707: 1708: 1709: 1710: 1711: 1712: 1713: 1714: 1715: 1716: 1717: 1718:
1719: public function getFeatureCvtermDbxrefsJoinDbxref($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
1720: {
1721: $query = FeatureCvtermDbxrefQuery::create(null, $criteria);
1722: $query->joinWith('Dbxref', $join_behavior);
1723:
1724: return $this->getFeatureCvtermDbxrefs($query, $con);
1725: }
1726:
1727: 1728: 1729: 1730: 1731: 1732: 1733: 1734: 1735:
1736: public function clearFeatureCvtermPubs()
1737: {
1738: $this->collFeatureCvtermPubs = null;
1739: $this->collFeatureCvtermPubsPartial = null;
1740:
1741: return $this;
1742: }
1743:
1744: 1745: 1746: 1747: 1748:
1749: public function resetPartialFeatureCvtermPubs($v = true)
1750: {
1751: $this->collFeatureCvtermPubsPartial = $v;
1752: }
1753:
1754: 1755: 1756: 1757: 1758: 1759: 1760: 1761: 1762: 1763: 1764: 1765:
1766: public function initFeatureCvtermPubs($overrideExisting = true)
1767: {
1768: if (null !== $this->collFeatureCvtermPubs && !$overrideExisting) {
1769: return;
1770: }
1771: $this->collFeatureCvtermPubs = new PropelObjectCollection();
1772: $this->collFeatureCvtermPubs->setModel('FeatureCvtermPub');
1773: }
1774:
1775: 1776: 1777: 1778: 1779: 1780: 1781: 1782: 1783: 1784: 1785: 1786: 1787: 1788:
1789: public function getFeatureCvtermPubs($criteria = null, PropelPDO $con = null)
1790: {
1791: $partial = $this->collFeatureCvtermPubsPartial && !$this->isNew();
1792: if (null === $this->collFeatureCvtermPubs || null !== $criteria || $partial) {
1793: if ($this->isNew() && null === $this->collFeatureCvtermPubs) {
1794:
1795: $this->initFeatureCvtermPubs();
1796: } else {
1797: $collFeatureCvtermPubs = FeatureCvtermPubQuery::create(null, $criteria)
1798: ->filterByFeatureCvterm($this)
1799: ->find($con);
1800: if (null !== $criteria) {
1801: if (false !== $this->collFeatureCvtermPubsPartial && count($collFeatureCvtermPubs)) {
1802: $this->initFeatureCvtermPubs(false);
1803:
1804: foreach($collFeatureCvtermPubs as $obj) {
1805: if (false == $this->collFeatureCvtermPubs->contains($obj)) {
1806: $this->collFeatureCvtermPubs->append($obj);
1807: }
1808: }
1809:
1810: $this->collFeatureCvtermPubsPartial = true;
1811: }
1812:
1813: $collFeatureCvtermPubs->getInternalIterator()->rewind();
1814: return $collFeatureCvtermPubs;
1815: }
1816:
1817: if($partial && $this->collFeatureCvtermPubs) {
1818: foreach($this->collFeatureCvtermPubs as $obj) {
1819: if($obj->isNew()) {
1820: $collFeatureCvtermPubs[] = $obj;
1821: }
1822: }
1823: }
1824:
1825: $this->collFeatureCvtermPubs = $collFeatureCvtermPubs;
1826: $this->collFeatureCvtermPubsPartial = false;
1827: }
1828: }
1829:
1830: return $this->collFeatureCvtermPubs;
1831: }
1832:
1833: 1834: 1835: 1836: 1837: 1838: 1839: 1840: 1841: 1842:
1843: public function setFeatureCvtermPubs(PropelCollection $featureCvtermPubs, PropelPDO $con = null)
1844: {
1845: $featureCvtermPubsToDelete = $this->getFeatureCvtermPubs(new Criteria(), $con)->diff($featureCvtermPubs);
1846:
1847: $this->featureCvtermPubsScheduledForDeletion = unserialize(serialize($featureCvtermPubsToDelete));
1848:
1849: foreach ($featureCvtermPubsToDelete as $featureCvtermPubRemoved) {
1850: $featureCvtermPubRemoved->setFeatureCvterm(null);
1851: }
1852:
1853: $this->collFeatureCvtermPubs = null;
1854: foreach ($featureCvtermPubs as $featureCvtermPub) {
1855: $this->addFeatureCvtermPub($featureCvtermPub);
1856: }
1857:
1858: $this->collFeatureCvtermPubs = $featureCvtermPubs;
1859: $this->collFeatureCvtermPubsPartial = false;
1860:
1861: return $this;
1862: }
1863:
1864: 1865: 1866: 1867: 1868: 1869: 1870: 1871: 1872:
1873: public function countFeatureCvtermPubs(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
1874: {
1875: $partial = $this->collFeatureCvtermPubsPartial && !$this->isNew();
1876: if (null === $this->collFeatureCvtermPubs || null !== $criteria || $partial) {
1877: if ($this->isNew() && null === $this->collFeatureCvtermPubs) {
1878: return 0;
1879: }
1880:
1881: if($partial && !$criteria) {
1882: return count($this->getFeatureCvtermPubs());
1883: }
1884: $query = FeatureCvtermPubQuery::create(null, $criteria);
1885: if ($distinct) {
1886: $query->distinct();
1887: }
1888:
1889: return $query
1890: ->filterByFeatureCvterm($this)
1891: ->count($con);
1892: }
1893:
1894: return count($this->collFeatureCvtermPubs);
1895: }
1896:
1897: 1898: 1899: 1900: 1901: 1902: 1903:
1904: public function addFeatureCvtermPub(FeatureCvtermPub $l)
1905: {
1906: if ($this->collFeatureCvtermPubs === null) {
1907: $this->initFeatureCvtermPubs();
1908: $this->collFeatureCvtermPubsPartial = true;
1909: }
1910: if (!in_array($l, $this->collFeatureCvtermPubs->getArrayCopy(), true)) {
1911: $this->doAddFeatureCvtermPub($l);
1912: }
1913:
1914: return $this;
1915: }
1916:
1917: 1918: 1919:
1920: protected function doAddFeatureCvtermPub($featureCvtermPub)
1921: {
1922: $this->collFeatureCvtermPubs[]= $featureCvtermPub;
1923: $featureCvtermPub->setFeatureCvterm($this);
1924: }
1925:
1926: 1927: 1928: 1929:
1930: public function removeFeatureCvtermPub($featureCvtermPub)
1931: {
1932: if ($this->getFeatureCvtermPubs()->contains($featureCvtermPub)) {
1933: $this->collFeatureCvtermPubs->remove($this->collFeatureCvtermPubs->search($featureCvtermPub));
1934: if (null === $this->featureCvtermPubsScheduledForDeletion) {
1935: $this->featureCvtermPubsScheduledForDeletion = clone $this->collFeatureCvtermPubs;
1936: $this->featureCvtermPubsScheduledForDeletion->clear();
1937: }
1938: $this->featureCvtermPubsScheduledForDeletion[]= clone $featureCvtermPub;
1939: $featureCvtermPub->setFeatureCvterm(null);
1940: }
1941:
1942: return $this;
1943: }
1944:
1945:
1946: 1947: 1948: 1949: 1950: 1951: 1952: 1953: 1954: 1955: 1956: 1957: 1958: 1959: 1960: 1961:
1962: public function getFeatureCvtermPubsJoinPub($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
1963: {
1964: $query = FeatureCvtermPubQuery::create(null, $criteria);
1965: $query->joinWith('Pub', $join_behavior);
1966:
1967: return $this->getFeatureCvtermPubs($query, $con);
1968: }
1969:
1970: 1971: 1972: 1973: 1974: 1975: 1976: 1977: 1978:
1979: public function clearFeatureCvtermprops()
1980: {
1981: $this->collFeatureCvtermprops = null;
1982: $this->collFeatureCvtermpropsPartial = null;
1983:
1984: return $this;
1985: }
1986:
1987: 1988: 1989: 1990: 1991:
1992: public function resetPartialFeatureCvtermprops($v = true)
1993: {
1994: $this->collFeatureCvtermpropsPartial = $v;
1995: }
1996:
1997: 1998: 1999: 2000: 2001: 2002: 2003: 2004: 2005: 2006: 2007: 2008:
2009: public function initFeatureCvtermprops($overrideExisting = true)
2010: {
2011: if (null !== $this->collFeatureCvtermprops && !$overrideExisting) {
2012: return;
2013: }
2014: $this->collFeatureCvtermprops = new PropelObjectCollection();
2015: $this->collFeatureCvtermprops->setModel('FeatureCvtermprop');
2016: }
2017:
2018: 2019: 2020: 2021: 2022: 2023: 2024: 2025: 2026: 2027: 2028: 2029: 2030: 2031:
2032: public function getFeatureCvtermprops($criteria = null, PropelPDO $con = null)
2033: {
2034: $partial = $this->collFeatureCvtermpropsPartial && !$this->isNew();
2035: if (null === $this->collFeatureCvtermprops || null !== $criteria || $partial) {
2036: if ($this->isNew() && null === $this->collFeatureCvtermprops) {
2037:
2038: $this->initFeatureCvtermprops();
2039: } else {
2040: $collFeatureCvtermprops = FeatureCvtermpropQuery::create(null, $criteria)
2041: ->filterByFeatureCvterm($this)
2042: ->find($con);
2043: if (null !== $criteria) {
2044: if (false !== $this->collFeatureCvtermpropsPartial && count($collFeatureCvtermprops)) {
2045: $this->initFeatureCvtermprops(false);
2046:
2047: foreach($collFeatureCvtermprops as $obj) {
2048: if (false == $this->collFeatureCvtermprops->contains($obj)) {
2049: $this->collFeatureCvtermprops->append($obj);
2050: }
2051: }
2052:
2053: $this->collFeatureCvtermpropsPartial = true;
2054: }
2055:
2056: $collFeatureCvtermprops->getInternalIterator()->rewind();
2057: return $collFeatureCvtermprops;
2058: }
2059:
2060: if($partial && $this->collFeatureCvtermprops) {
2061: foreach($this->collFeatureCvtermprops as $obj) {
2062: if($obj->isNew()) {
2063: $collFeatureCvtermprops[] = $obj;
2064: }
2065: }
2066: }
2067:
2068: $this->collFeatureCvtermprops = $collFeatureCvtermprops;
2069: $this->collFeatureCvtermpropsPartial = false;
2070: }
2071: }
2072:
2073: return $this->collFeatureCvtermprops;
2074: }
2075:
2076: 2077: 2078: 2079: 2080: 2081: 2082: 2083: 2084: 2085:
2086: public function setFeatureCvtermprops(PropelCollection $featureCvtermprops, PropelPDO $con = null)
2087: {
2088: $featureCvtermpropsToDelete = $this->getFeatureCvtermprops(new Criteria(), $con)->diff($featureCvtermprops);
2089:
2090: $this->featureCvtermpropsScheduledForDeletion = unserialize(serialize($featureCvtermpropsToDelete));
2091:
2092: foreach ($featureCvtermpropsToDelete as $featureCvtermpropRemoved) {
2093: $featureCvtermpropRemoved->setFeatureCvterm(null);
2094: }
2095:
2096: $this->collFeatureCvtermprops = null;
2097: foreach ($featureCvtermprops as $featureCvtermprop) {
2098: $this->addFeatureCvtermprop($featureCvtermprop);
2099: }
2100:
2101: $this->collFeatureCvtermprops = $featureCvtermprops;
2102: $this->collFeatureCvtermpropsPartial = false;
2103:
2104: return $this;
2105: }
2106:
2107: 2108: 2109: 2110: 2111: 2112: 2113: 2114: 2115:
2116: public function countFeatureCvtermprops(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
2117: {
2118: $partial = $this->collFeatureCvtermpropsPartial && !$this->isNew();
2119: if (null === $this->collFeatureCvtermprops || null !== $criteria || $partial) {
2120: if ($this->isNew() && null === $this->collFeatureCvtermprops) {
2121: return 0;
2122: }
2123:
2124: if($partial && !$criteria) {
2125: return count($this->getFeatureCvtermprops());
2126: }
2127: $query = FeatureCvtermpropQuery::create(null, $criteria);
2128: if ($distinct) {
2129: $query->distinct();
2130: }
2131:
2132: return $query
2133: ->filterByFeatureCvterm($this)
2134: ->count($con);
2135: }
2136:
2137: return count($this->collFeatureCvtermprops);
2138: }
2139:
2140: 2141: 2142: 2143: 2144: 2145: 2146:
2147: public function addFeatureCvtermprop(FeatureCvtermprop $l)
2148: {
2149: if ($this->collFeatureCvtermprops === null) {
2150: $this->initFeatureCvtermprops();
2151: $this->collFeatureCvtermpropsPartial = true;
2152: }
2153: if (!in_array($l, $this->collFeatureCvtermprops->getArrayCopy(), true)) {
2154: $this->doAddFeatureCvtermprop($l);
2155: }
2156:
2157: return $this;
2158: }
2159:
2160: 2161: 2162:
2163: protected function doAddFeatureCvtermprop($featureCvtermprop)
2164: {
2165: $this->collFeatureCvtermprops[]= $featureCvtermprop;
2166: $featureCvtermprop->setFeatureCvterm($this);
2167: }
2168:
2169: 2170: 2171: 2172:
2173: public function removeFeatureCvtermprop($featureCvtermprop)
2174: {
2175: if ($this->getFeatureCvtermprops()->contains($featureCvtermprop)) {
2176: $this->collFeatureCvtermprops->remove($this->collFeatureCvtermprops->search($featureCvtermprop));
2177: if (null === $this->featureCvtermpropsScheduledForDeletion) {
2178: $this->featureCvtermpropsScheduledForDeletion = clone $this->collFeatureCvtermprops;
2179: $this->featureCvtermpropsScheduledForDeletion->clear();
2180: }
2181: $this->featureCvtermpropsScheduledForDeletion[]= clone $featureCvtermprop;
2182: $featureCvtermprop->setFeatureCvterm(null);
2183: }
2184:
2185: return $this;
2186: }
2187:
2188:
2189: 2190: 2191: 2192: 2193: 2194: 2195: 2196: 2197: 2198: 2199: 2200: 2201: 2202: 2203: 2204:
2205: public function getFeatureCvtermpropsJoinCvterm($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
2206: {
2207: $query = FeatureCvtermpropQuery::create(null, $criteria);
2208: $query->joinWith('Cvterm', $join_behavior);
2209:
2210: return $this->getFeatureCvtermprops($query, $con);
2211: }
2212:
2213: 2214: 2215:
2216: public function clear()
2217: {
2218: $this->feature_cvterm_id = null;
2219: $this->feature_id = null;
2220: $this->cvterm_id = null;
2221: $this->pub_id = null;
2222: $this->is_not = null;
2223: $this->rank = null;
2224: $this->alreadyInSave = false;
2225: $this->alreadyInValidation = false;
2226: $this->alreadyInClearAllReferencesDeep = false;
2227: $this->clearAllReferences();
2228: $this->applyDefaultValues();
2229: $this->resetModified();
2230: $this->setNew(true);
2231: $this->setDeleted(false);
2232: }
2233:
2234: 2235: 2236: 2237: 2238: 2239: 2240: 2241: 2242:
2243: public function clearAllReferences($deep = false)
2244: {
2245: if ($deep && !$this->alreadyInClearAllReferencesDeep) {
2246: $this->alreadyInClearAllReferencesDeep = true;
2247: if ($this->collFeatureCvtermDbxrefs) {
2248: foreach ($this->collFeatureCvtermDbxrefs as $o) {
2249: $o->clearAllReferences($deep);
2250: }
2251: }
2252: if ($this->collFeatureCvtermPubs) {
2253: foreach ($this->collFeatureCvtermPubs as $o) {
2254: $o->clearAllReferences($deep);
2255: }
2256: }
2257: if ($this->collFeatureCvtermprops) {
2258: foreach ($this->collFeatureCvtermprops as $o) {
2259: $o->clearAllReferences($deep);
2260: }
2261: }
2262: if ($this->aCvterm instanceof Persistent) {
2263: $this->aCvterm->clearAllReferences($deep);
2264: }
2265: if ($this->aFeature instanceof Persistent) {
2266: $this->aFeature->clearAllReferences($deep);
2267: }
2268: if ($this->aPub instanceof Persistent) {
2269: $this->aPub->clearAllReferences($deep);
2270: }
2271:
2272: $this->alreadyInClearAllReferencesDeep = false;
2273: }
2274:
2275: if ($this->collFeatureCvtermDbxrefs instanceof PropelCollection) {
2276: $this->collFeatureCvtermDbxrefs->clearIterator();
2277: }
2278: $this->collFeatureCvtermDbxrefs = null;
2279: if ($this->collFeatureCvtermPubs instanceof PropelCollection) {
2280: $this->collFeatureCvtermPubs->clearIterator();
2281: }
2282: $this->collFeatureCvtermPubs = null;
2283: if ($this->collFeatureCvtermprops instanceof PropelCollection) {
2284: $this->collFeatureCvtermprops->clearIterator();
2285: }
2286: $this->collFeatureCvtermprops = null;
2287: $this->aCvterm = null;
2288: $this->aFeature = null;
2289: $this->aPub = null;
2290: }
2291:
2292: 2293: 2294: 2295: 2296:
2297: public function __toString()
2298: {
2299: return (string) $this->exportTo(FeatureCvtermPeer::DEFAULT_STRING_FORMAT);
2300: }
2301:
2302: 2303: 2304: 2305: 2306:
2307: public function isAlreadyInSave()
2308: {
2309: return $this->alreadyInSave;
2310: }
2311:
2312: }
2313: