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\BiomaterialRelationship;
17: use cli_db\propel\BiomaterialRelationshipQuery;
18: use cli_db\propel\Biomaterialprop;
19: use cli_db\propel\BiomaterialpropQuery;
20: use cli_db\propel\Contact;
21: use cli_db\propel\ContactQuery;
22: use cli_db\propel\Cv;
23: use cli_db\propel\CvQuery;
24: use cli_db\propel\Cvterm;
25: use cli_db\propel\CvtermPeer;
26: use cli_db\propel\CvtermQuery;
27: use cli_db\propel\Feature;
28: use cli_db\propel\FeatureCvterm;
29: use cli_db\propel\FeatureCvtermQuery;
30: use cli_db\propel\FeatureCvtermprop;
31: use cli_db\propel\FeatureCvtermpropQuery;
32: use cli_db\propel\FeatureQuery;
33: use cli_db\propel\Protocol;
34: use cli_db\propel\ProtocolQuery;
35: use cli_db\propel\Pub;
36: use cli_db\propel\PubQuery;
37: use cli_db\propel\PubRelationship;
38: use cli_db\propel\PubRelationshipQuery;
39: use cli_db\propel\Pubprop;
40: use cli_db\propel\PubpropQuery;
41: use cli_db\propel\Synonym;
42: use cli_db\propel\SynonymQuery;
43:
44: 45: 46: 47: 48: 49: 50:
51: abstract class BaseCvterm extends BaseObject implements Persistent
52: {
53: 54: 55:
56: const PEER = 'cli_db\\propel\\CvtermPeer';
57:
58: 59: 60: 61: 62: 63:
64: protected static $peer;
65:
66: 67: 68: 69:
70: protected $startCopy = false;
71:
72: 73: 74: 75:
76: protected $cvterm_id;
77:
78: 79: 80: 81:
82: protected $cv_id;
83:
84: 85: 86: 87:
88: protected $name;
89:
90: 91: 92: 93:
94: protected $definition;
95:
96: 97: 98: 99:
100: protected $dbxref_id;
101:
102: 103: 104: 105: 106:
107: protected $is_obsolete;
108:
109: 110: 111: 112: 113:
114: protected $is_relationshiptype;
115:
116: 117: 118:
119: protected $aCv;
120:
121: 122: 123:
124: protected $collBiomaterialRelationships;
125: protected $collBiomaterialRelationshipsPartial;
126:
127: 128: 129:
130: protected $collBiomaterialprops;
131: protected $collBiomaterialpropsPartial;
132:
133: 134: 135:
136: protected $collContacts;
137: protected $collContactsPartial;
138:
139: 140: 141:
142: protected $collFeatures;
143: protected $collFeaturesPartial;
144:
145: 146: 147:
148: protected $collFeatureCvterms;
149: protected $collFeatureCvtermsPartial;
150:
151: 152: 153:
154: protected $collFeatureCvtermprops;
155: protected $collFeatureCvtermpropsPartial;
156:
157: 158: 159:
160: protected $collProtocols;
161: protected $collProtocolsPartial;
162:
163: 164: 165:
166: protected $collPubs;
167: protected $collPubsPartial;
168:
169: 170: 171:
172: protected $collPubRelationships;
173: protected $collPubRelationshipsPartial;
174:
175: 176: 177:
178: protected $collPubprops;
179: protected $collPubpropsPartial;
180:
181: 182: 183:
184: protected $collSynonyms;
185: protected $collSynonymsPartial;
186:
187: 188: 189: 190: 191:
192: protected $alreadyInSave = false;
193:
194: 195: 196: 197: 198:
199: protected $alreadyInValidation = false;
200:
201: 202: 203: 204:
205: protected $alreadyInClearAllReferencesDeep = false;
206:
207: 208: 209: 210:
211: protected $biomaterialRelationshipsScheduledForDeletion = null;
212:
213: 214: 215: 216:
217: protected $biomaterialpropsScheduledForDeletion = null;
218:
219: 220: 221: 222:
223: protected $contactsScheduledForDeletion = null;
224:
225: 226: 227: 228:
229: protected $featuresScheduledForDeletion = null;
230:
231: 232: 233: 234:
235: protected $featureCvtermsScheduledForDeletion = null;
236:
237: 238: 239: 240:
241: protected $featureCvtermpropsScheduledForDeletion = null;
242:
243: 244: 245: 246:
247: protected $protocolsScheduledForDeletion = null;
248:
249: 250: 251: 252:
253: protected $pubsScheduledForDeletion = null;
254:
255: 256: 257: 258:
259: protected $pubRelationshipsScheduledForDeletion = null;
260:
261: 262: 263: 264:
265: protected $pubpropsScheduledForDeletion = null;
266:
267: 268: 269: 270:
271: protected $synonymsScheduledForDeletion = null;
272:
273: 274: 275: 276: 277: 278:
279: public function applyDefaultValues()
280: {
281: $this->is_obsolete = 0;
282: $this->is_relationshiptype = 0;
283: }
284:
285: 286: 287: 288:
289: public function __construct()
290: {
291: parent::__construct();
292: $this->applyDefaultValues();
293: }
294:
295: 296: 297: 298: 299:
300: public function getCvtermId()
301: {
302: return $this->cvterm_id;
303: }
304:
305: 306: 307: 308: 309:
310: public function getCvId()
311: {
312: return $this->cv_id;
313: }
314:
315: 316: 317: 318: 319:
320: public function getName()
321: {
322: return $this->name;
323: }
324:
325: 326: 327: 328: 329:
330: public function getDefinition()
331: {
332: return $this->definition;
333: }
334:
335: 336: 337: 338: 339:
340: public function getDbxrefId()
341: {
342: return $this->dbxref_id;
343: }
344:
345: 346: 347: 348: 349:
350: public function getIsObsolete()
351: {
352: return $this->is_obsolete;
353: }
354:
355: 356: 357: 358: 359:
360: public function getIsRelationshiptype()
361: {
362: return $this->is_relationshiptype;
363: }
364:
365: 366: 367: 368: 369: 370:
371: public function setCvtermId($v)
372: {
373: if ($v !== null && is_numeric($v)) {
374: $v = (int) $v;
375: }
376:
377: if ($this->cvterm_id !== $v) {
378: $this->cvterm_id = $v;
379: $this->modifiedColumns[] = CvtermPeer::CVTERM_ID;
380: }
381:
382:
383: return $this;
384: }
385:
386: 387: 388: 389: 390: 391:
392: public function setCvId($v)
393: {
394: if ($v !== null && is_numeric($v)) {
395: $v = (int) $v;
396: }
397:
398: if ($this->cv_id !== $v) {
399: $this->cv_id = $v;
400: $this->modifiedColumns[] = CvtermPeer::CV_ID;
401: }
402:
403: if ($this->aCv !== null && $this->aCv->getCvId() !== $v) {
404: $this->aCv = null;
405: }
406:
407:
408: return $this;
409: }
410:
411: 412: 413: 414: 415: 416:
417: public function setName($v)
418: {
419: if ($v !== null && is_numeric($v)) {
420: $v = (string) $v;
421: }
422:
423: if ($this->name !== $v) {
424: $this->name = $v;
425: $this->modifiedColumns[] = CvtermPeer::NAME;
426: }
427:
428:
429: return $this;
430: }
431:
432: 433: 434: 435: 436: 437:
438: public function setDefinition($v)
439: {
440: if ($v !== null && is_numeric($v)) {
441: $v = (string) $v;
442: }
443:
444: if ($this->definition !== $v) {
445: $this->definition = $v;
446: $this->modifiedColumns[] = CvtermPeer::DEFINITION;
447: }
448:
449:
450: return $this;
451: }
452:
453: 454: 455: 456: 457: 458:
459: public function setDbxrefId($v)
460: {
461: if ($v !== null && is_numeric($v)) {
462: $v = (int) $v;
463: }
464:
465: if ($this->dbxref_id !== $v) {
466: $this->dbxref_id = $v;
467: $this->modifiedColumns[] = CvtermPeer::DBXREF_ID;
468: }
469:
470:
471: return $this;
472: }
473:
474: 475: 476: 477: 478: 479:
480: public function setIsObsolete($v)
481: {
482: if ($v !== null && is_numeric($v)) {
483: $v = (int) $v;
484: }
485:
486: if ($this->is_obsolete !== $v) {
487: $this->is_obsolete = $v;
488: $this->modifiedColumns[] = CvtermPeer::IS_OBSOLETE;
489: }
490:
491:
492: return $this;
493: }
494:
495: 496: 497: 498: 499: 500:
501: public function setIsRelationshiptype($v)
502: {
503: if ($v !== null && is_numeric($v)) {
504: $v = (int) $v;
505: }
506:
507: if ($this->is_relationshiptype !== $v) {
508: $this->is_relationshiptype = $v;
509: $this->modifiedColumns[] = CvtermPeer::IS_RELATIONSHIPTYPE;
510: }
511:
512:
513: return $this;
514: }
515:
516: 517: 518: 519: 520: 521: 522: 523:
524: public function hasOnlyDefaultValues()
525: {
526: if ($this->is_obsolete !== 0) {
527: return false;
528: }
529:
530: if ($this->is_relationshiptype !== 0) {
531: return false;
532: }
533:
534:
535: return true;
536: }
537:
538: 539: 540: 541: 542: 543: 544: 545: 546: 547: 548: 549: 550: 551:
552: public function hydrate($row, $startcol = 0, $rehydrate = false)
553: {
554: try {
555:
556: $this->cvterm_id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null;
557: $this->cv_id = ($row[$startcol + 1] !== null) ? (int) $row[$startcol + 1] : null;
558: $this->name = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null;
559: $this->definition = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null;
560: $this->dbxref_id = ($row[$startcol + 4] !== null) ? (int) $row[$startcol + 4] : null;
561: $this->is_obsolete = ($row[$startcol + 5] !== null) ? (int) $row[$startcol + 5] : null;
562: $this->is_relationshiptype = ($row[$startcol + 6] !== null) ? (int) $row[$startcol + 6] : null;
563: $this->resetModified();
564:
565: $this->setNew(false);
566:
567: if ($rehydrate) {
568: $this->ensureConsistency();
569: }
570: $this->postHydrate($row, $startcol, $rehydrate);
571: return $startcol + 7;
572:
573: } catch (Exception $e) {
574: throw new PropelException("Error populating Cvterm object", $e);
575: }
576: }
577:
578: 579: 580: 581: 582: 583: 584: 585: 586: 587: 588: 589: 590:
591: public function ensureConsistency()
592: {
593:
594: if ($this->aCv !== null && $this->cv_id !== $this->aCv->getCvId()) {
595: $this->aCv = null;
596: }
597: }
598:
599: 600: 601: 602: 603: 604: 605: 606: 607: 608:
609: public function reload($deep = false, PropelPDO $con = null)
610: {
611: if ($this->isDeleted()) {
612: throw new PropelException("Cannot reload a deleted object.");
613: }
614:
615: if ($this->isNew()) {
616: throw new PropelException("Cannot reload an unsaved object.");
617: }
618:
619: if ($con === null) {
620: $con = Propel::getConnection(CvtermPeer::DATABASE_NAME, Propel::CONNECTION_READ);
621: }
622:
623:
624:
625:
626: $stmt = CvtermPeer::doSelectStmt($this->buildPkeyCriteria(), $con);
627: $row = $stmt->fetch(PDO::FETCH_NUM);
628: $stmt->closeCursor();
629: if (!$row) {
630: throw new PropelException('Cannot find matching row in the database to reload object values.');
631: }
632: $this->hydrate($row, 0, true);
633:
634: if ($deep) {
635:
636: $this->aCv = null;
637: $this->collBiomaterialRelationships = null;
638:
639: $this->collBiomaterialprops = null;
640:
641: $this->collContacts = null;
642:
643: $this->collFeatures = null;
644:
645: $this->collFeatureCvterms = null;
646:
647: $this->collFeatureCvtermprops = null;
648:
649: $this->collProtocols = null;
650:
651: $this->collPubs = null;
652:
653: $this->collPubRelationships = null;
654:
655: $this->collPubprops = null;
656:
657: $this->collSynonyms = null;
658:
659: }
660: }
661:
662: 663: 664: 665: 666: 667: 668: 669: 670: 671:
672: public function delete(PropelPDO $con = null)
673: {
674: if ($this->isDeleted()) {
675: throw new PropelException("This object has already been deleted.");
676: }
677:
678: if ($con === null) {
679: $con = Propel::getConnection(CvtermPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
680: }
681:
682: $con->beginTransaction();
683: try {
684: $deleteQuery = CvtermQuery::create()
685: ->filterByPrimaryKey($this->getPrimaryKey());
686: $ret = $this->preDelete($con);
687: if ($ret) {
688: $deleteQuery->delete($con);
689: $this->postDelete($con);
690: $con->commit();
691: $this->setDeleted(true);
692: } else {
693: $con->commit();
694: }
695: } catch (Exception $e) {
696: $con->rollBack();
697: throw $e;
698: }
699: }
700:
701: 702: 703: 704: 705: 706: 707: 708: 709: 710: 711: 712: 713: 714:
715: public function save(PropelPDO $con = null)
716: {
717: if ($this->isDeleted()) {
718: throw new PropelException("You cannot save an object that has been deleted.");
719: }
720:
721: if ($con === null) {
722: $con = Propel::getConnection(CvtermPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
723: }
724:
725: $con->beginTransaction();
726: $isInsert = $this->isNew();
727: try {
728: $ret = $this->preSave($con);
729: if ($isInsert) {
730: $ret = $ret && $this->preInsert($con);
731: } else {
732: $ret = $ret && $this->preUpdate($con);
733: }
734: if ($ret) {
735: $affectedRows = $this->doSave($con);
736: if ($isInsert) {
737: $this->postInsert($con);
738: } else {
739: $this->postUpdate($con);
740: }
741: $this->postSave($con);
742: CvtermPeer::addInstanceToPool($this);
743: } else {
744: $affectedRows = 0;
745: }
746: $con->commit();
747:
748: return $affectedRows;
749: } catch (Exception $e) {
750: $con->rollBack();
751: throw $e;
752: }
753: }
754:
755: 756: 757: 758: 759: 760: 761: 762: 763: 764: 765:
766: protected function doSave(PropelPDO $con)
767: {
768: $affectedRows = 0;
769: if (!$this->alreadyInSave) {
770: $this->alreadyInSave = true;
771:
772:
773:
774:
775:
776:
777: if ($this->aCv !== null) {
778: if ($this->aCv->isModified() || $this->aCv->isNew()) {
779: $affectedRows += $this->aCv->save($con);
780: }
781: $this->setCv($this->aCv);
782: }
783:
784: if ($this->isNew() || $this->isModified()) {
785:
786: if ($this->isNew()) {
787: $this->doInsert($con);
788: } else {
789: $this->doUpdate($con);
790: }
791: $affectedRows += 1;
792: $this->resetModified();
793: }
794:
795: if ($this->biomaterialRelationshipsScheduledForDeletion !== null) {
796: if (!$this->biomaterialRelationshipsScheduledForDeletion->isEmpty()) {
797: BiomaterialRelationshipQuery::create()
798: ->filterByPrimaryKeys($this->biomaterialRelationshipsScheduledForDeletion->getPrimaryKeys(false))
799: ->delete($con);
800: $this->biomaterialRelationshipsScheduledForDeletion = null;
801: }
802: }
803:
804: if ($this->collBiomaterialRelationships !== null) {
805: foreach ($this->collBiomaterialRelationships as $referrerFK) {
806: if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
807: $affectedRows += $referrerFK->save($con);
808: }
809: }
810: }
811:
812: if ($this->biomaterialpropsScheduledForDeletion !== null) {
813: if (!$this->biomaterialpropsScheduledForDeletion->isEmpty()) {
814: BiomaterialpropQuery::create()
815: ->filterByPrimaryKeys($this->biomaterialpropsScheduledForDeletion->getPrimaryKeys(false))
816: ->delete($con);
817: $this->biomaterialpropsScheduledForDeletion = null;
818: }
819: }
820:
821: if ($this->collBiomaterialprops !== null) {
822: foreach ($this->collBiomaterialprops as $referrerFK) {
823: if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
824: $affectedRows += $referrerFK->save($con);
825: }
826: }
827: }
828:
829: if ($this->contactsScheduledForDeletion !== null) {
830: if (!$this->contactsScheduledForDeletion->isEmpty()) {
831: foreach ($this->contactsScheduledForDeletion as $contact) {
832:
833: $contact->save($con);
834: }
835: $this->contactsScheduledForDeletion = null;
836: }
837: }
838:
839: if ($this->collContacts !== null) {
840: foreach ($this->collContacts as $referrerFK) {
841: if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
842: $affectedRows += $referrerFK->save($con);
843: }
844: }
845: }
846:
847: if ($this->featuresScheduledForDeletion !== null) {
848: if (!$this->featuresScheduledForDeletion->isEmpty()) {
849: FeatureQuery::create()
850: ->filterByPrimaryKeys($this->featuresScheduledForDeletion->getPrimaryKeys(false))
851: ->delete($con);
852: $this->featuresScheduledForDeletion = null;
853: }
854: }
855:
856: if ($this->collFeatures !== null) {
857: foreach ($this->collFeatures as $referrerFK) {
858: if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
859: $affectedRows += $referrerFK->save($con);
860: }
861: }
862: }
863:
864: if ($this->featureCvtermsScheduledForDeletion !== null) {
865: if (!$this->featureCvtermsScheduledForDeletion->isEmpty()) {
866: FeatureCvtermQuery::create()
867: ->filterByPrimaryKeys($this->featureCvtermsScheduledForDeletion->getPrimaryKeys(false))
868: ->delete($con);
869: $this->featureCvtermsScheduledForDeletion = null;
870: }
871: }
872:
873: if ($this->collFeatureCvterms !== null) {
874: foreach ($this->collFeatureCvterms as $referrerFK) {
875: if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
876: $affectedRows += $referrerFK->save($con);
877: }
878: }
879: }
880:
881: if ($this->featureCvtermpropsScheduledForDeletion !== null) {
882: if (!$this->featureCvtermpropsScheduledForDeletion->isEmpty()) {
883: FeatureCvtermpropQuery::create()
884: ->filterByPrimaryKeys($this->featureCvtermpropsScheduledForDeletion->getPrimaryKeys(false))
885: ->delete($con);
886: $this->featureCvtermpropsScheduledForDeletion = null;
887: }
888: }
889:
890: if ($this->collFeatureCvtermprops !== null) {
891: foreach ($this->collFeatureCvtermprops as $referrerFK) {
892: if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
893: $affectedRows += $referrerFK->save($con);
894: }
895: }
896: }
897:
898: if ($this->protocolsScheduledForDeletion !== null) {
899: if (!$this->protocolsScheduledForDeletion->isEmpty()) {
900: ProtocolQuery::create()
901: ->filterByPrimaryKeys($this->protocolsScheduledForDeletion->getPrimaryKeys(false))
902: ->delete($con);
903: $this->protocolsScheduledForDeletion = null;
904: }
905: }
906:
907: if ($this->collProtocols !== null) {
908: foreach ($this->collProtocols as $referrerFK) {
909: if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
910: $affectedRows += $referrerFK->save($con);
911: }
912: }
913: }
914:
915: if ($this->pubsScheduledForDeletion !== null) {
916: if (!$this->pubsScheduledForDeletion->isEmpty()) {
917: PubQuery::create()
918: ->filterByPrimaryKeys($this->pubsScheduledForDeletion->getPrimaryKeys(false))
919: ->delete($con);
920: $this->pubsScheduledForDeletion = null;
921: }
922: }
923:
924: if ($this->collPubs !== null) {
925: foreach ($this->collPubs as $referrerFK) {
926: if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
927: $affectedRows += $referrerFK->save($con);
928: }
929: }
930: }
931:
932: if ($this->pubRelationshipsScheduledForDeletion !== null) {
933: if (!$this->pubRelationshipsScheduledForDeletion->isEmpty()) {
934: PubRelationshipQuery::create()
935: ->filterByPrimaryKeys($this->pubRelationshipsScheduledForDeletion->getPrimaryKeys(false))
936: ->delete($con);
937: $this->pubRelationshipsScheduledForDeletion = null;
938: }
939: }
940:
941: if ($this->collPubRelationships !== null) {
942: foreach ($this->collPubRelationships as $referrerFK) {
943: if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
944: $affectedRows += $referrerFK->save($con);
945: }
946: }
947: }
948:
949: if ($this->pubpropsScheduledForDeletion !== null) {
950: if (!$this->pubpropsScheduledForDeletion->isEmpty()) {
951: PubpropQuery::create()
952: ->filterByPrimaryKeys($this->pubpropsScheduledForDeletion->getPrimaryKeys(false))
953: ->delete($con);
954: $this->pubpropsScheduledForDeletion = null;
955: }
956: }
957:
958: if ($this->collPubprops !== null) {
959: foreach ($this->collPubprops as $referrerFK) {
960: if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
961: $affectedRows += $referrerFK->save($con);
962: }
963: }
964: }
965:
966: if ($this->synonymsScheduledForDeletion !== null) {
967: if (!$this->synonymsScheduledForDeletion->isEmpty()) {
968: SynonymQuery::create()
969: ->filterByPrimaryKeys($this->synonymsScheduledForDeletion->getPrimaryKeys(false))
970: ->delete($con);
971: $this->synonymsScheduledForDeletion = null;
972: }
973: }
974:
975: if ($this->collSynonyms !== null) {
976: foreach ($this->collSynonyms as $referrerFK) {
977: if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
978: $affectedRows += $referrerFK->save($con);
979: }
980: }
981: }
982:
983: $this->alreadyInSave = false;
984:
985: }
986:
987: return $affectedRows;
988: }
989:
990: 991: 992: 993: 994: 995: 996: 997:
998: protected function doInsert(PropelPDO $con)
999: {
1000: $modifiedColumns = array();
1001: $index = 0;
1002:
1003: $this->modifiedColumns[] = CvtermPeer::CVTERM_ID;
1004: if (null !== $this->cvterm_id) {
1005: throw new PropelException('Cannot insert a value for auto-increment primary key (' . CvtermPeer::CVTERM_ID . ')');
1006: }
1007: if (null === $this->cvterm_id) {
1008: try {
1009: $stmt = $con->query("SELECT nextval('cvterm_cvterm_id_seq')");
1010: $row = $stmt->fetch(PDO::FETCH_NUM);
1011: $this->cvterm_id = $row[0];
1012: } catch (Exception $e) {
1013: throw new PropelException('Unable to get sequence id.', $e);
1014: }
1015: }
1016:
1017:
1018:
1019: if ($this->isColumnModified(CvtermPeer::CVTERM_ID)) {
1020: $modifiedColumns[':p' . $index++] = '"cvterm_id"';
1021: }
1022: if ($this->isColumnModified(CvtermPeer::CV_ID)) {
1023: $modifiedColumns[':p' . $index++] = '"cv_id"';
1024: }
1025: if ($this->isColumnModified(CvtermPeer::NAME)) {
1026: $modifiedColumns[':p' . $index++] = '"name"';
1027: }
1028: if ($this->isColumnModified(CvtermPeer::DEFINITION)) {
1029: $modifiedColumns[':p' . $index++] = '"definition"';
1030: }
1031: if ($this->isColumnModified(CvtermPeer::DBXREF_ID)) {
1032: $modifiedColumns[':p' . $index++] = '"dbxref_id"';
1033: }
1034: if ($this->isColumnModified(CvtermPeer::IS_OBSOLETE)) {
1035: $modifiedColumns[':p' . $index++] = '"is_obsolete"';
1036: }
1037: if ($this->isColumnModified(CvtermPeer::IS_RELATIONSHIPTYPE)) {
1038: $modifiedColumns[':p' . $index++] = '"is_relationshiptype"';
1039: }
1040:
1041: $sql = sprintf(
1042: 'INSERT INTO "cvterm" (%s) VALUES (%s)',
1043: implode(', ', $modifiedColumns),
1044: implode(', ', array_keys($modifiedColumns))
1045: );
1046:
1047: try {
1048: $stmt = $con->prepare($sql);
1049: foreach ($modifiedColumns as $identifier => $columnName) {
1050: switch ($columnName) {
1051: case '"cvterm_id"':
1052: $stmt->bindValue($identifier, $this->cvterm_id, PDO::PARAM_INT);
1053: break;
1054: case '"cv_id"':
1055: $stmt->bindValue($identifier, $this->cv_id, PDO::PARAM_INT);
1056: break;
1057: case '"name"':
1058: $stmt->bindValue($identifier, $this->name, PDO::PARAM_STR);
1059: break;
1060: case '"definition"':
1061: $stmt->bindValue($identifier, $this->definition, PDO::PARAM_STR);
1062: break;
1063: case '"dbxref_id"':
1064: $stmt->bindValue($identifier, $this->dbxref_id, PDO::PARAM_INT);
1065: break;
1066: case '"is_obsolete"':
1067: $stmt->bindValue($identifier, $this->is_obsolete, PDO::PARAM_INT);
1068: break;
1069: case '"is_relationshiptype"':
1070: $stmt->bindValue($identifier, $this->is_relationshiptype, PDO::PARAM_INT);
1071: break;
1072: }
1073: }
1074: $stmt->execute();
1075: } catch (Exception $e) {
1076: Propel::log($e->getMessage(), Propel::LOG_ERR);
1077: throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), $e);
1078: }
1079:
1080: $this->setNew(false);
1081: }
1082:
1083: 1084: 1085: 1086: 1087: 1088: 1089:
1090: protected function doUpdate(PropelPDO $con)
1091: {
1092: $selectCriteria = $this->buildPkeyCriteria();
1093: $valuesCriteria = $this->buildCriteria();
1094: BasePeer::doUpdate($selectCriteria, $valuesCriteria, $con);
1095: }
1096:
1097: 1098: 1099: 1100:
1101: protected $validationFailures = array();
1102:
1103: 1104: 1105: 1106: 1107: 1108: 1109:
1110: public function getValidationFailures()
1111: {
1112: return $this->validationFailures;
1113: }
1114:
1115: 1116: 1117: 1118: 1119: 1120: 1121: 1122: 1123: 1124: 1125:
1126: public function validate($columns = null)
1127: {
1128: $res = $this->doValidate($columns);
1129: if ($res === true) {
1130: $this->validationFailures = array();
1131:
1132: return true;
1133: }
1134:
1135: $this->validationFailures = $res;
1136:
1137: return false;
1138: }
1139:
1140: 1141: 1142: 1143: 1144: 1145: 1146: 1147: 1148: 1149:
1150: protected function doValidate($columns = null)
1151: {
1152: if (!$this->alreadyInValidation) {
1153: $this->alreadyInValidation = true;
1154: $retval = null;
1155:
1156: $failureMap = array();
1157:
1158:
1159:
1160:
1161:
1162:
1163:
1164: if ($this->aCv !== null) {
1165: if (!$this->aCv->validate($columns)) {
1166: $failureMap = array_merge($failureMap, $this->aCv->getValidationFailures());
1167: }
1168: }
1169:
1170:
1171: if (($retval = CvtermPeer::doValidate($this, $columns)) !== true) {
1172: $failureMap = array_merge($failureMap, $retval);
1173: }
1174:
1175:
1176: if ($this->collBiomaterialRelationships !== null) {
1177: foreach ($this->collBiomaterialRelationships as $referrerFK) {
1178: if (!$referrerFK->validate($columns)) {
1179: $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
1180: }
1181: }
1182: }
1183:
1184: if ($this->collBiomaterialprops !== null) {
1185: foreach ($this->collBiomaterialprops as $referrerFK) {
1186: if (!$referrerFK->validate($columns)) {
1187: $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
1188: }
1189: }
1190: }
1191:
1192: if ($this->collContacts !== null) {
1193: foreach ($this->collContacts as $referrerFK) {
1194: if (!$referrerFK->validate($columns)) {
1195: $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
1196: }
1197: }
1198: }
1199:
1200: if ($this->collFeatures !== null) {
1201: foreach ($this->collFeatures as $referrerFK) {
1202: if (!$referrerFK->validate($columns)) {
1203: $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
1204: }
1205: }
1206: }
1207:
1208: if ($this->collFeatureCvterms !== null) {
1209: foreach ($this->collFeatureCvterms as $referrerFK) {
1210: if (!$referrerFK->validate($columns)) {
1211: $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
1212: }
1213: }
1214: }
1215:
1216: if ($this->collFeatureCvtermprops !== null) {
1217: foreach ($this->collFeatureCvtermprops as $referrerFK) {
1218: if (!$referrerFK->validate($columns)) {
1219: $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
1220: }
1221: }
1222: }
1223:
1224: if ($this->collProtocols !== null) {
1225: foreach ($this->collProtocols as $referrerFK) {
1226: if (!$referrerFK->validate($columns)) {
1227: $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
1228: }
1229: }
1230: }
1231:
1232: if ($this->collPubs !== null) {
1233: foreach ($this->collPubs as $referrerFK) {
1234: if (!$referrerFK->validate($columns)) {
1235: $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
1236: }
1237: }
1238: }
1239:
1240: if ($this->collPubRelationships !== null) {
1241: foreach ($this->collPubRelationships as $referrerFK) {
1242: if (!$referrerFK->validate($columns)) {
1243: $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
1244: }
1245: }
1246: }
1247:
1248: if ($this->collPubprops !== null) {
1249: foreach ($this->collPubprops as $referrerFK) {
1250: if (!$referrerFK->validate($columns)) {
1251: $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
1252: }
1253: }
1254: }
1255:
1256: if ($this->collSynonyms !== null) {
1257: foreach ($this->collSynonyms as $referrerFK) {
1258: if (!$referrerFK->validate($columns)) {
1259: $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
1260: }
1261: }
1262: }
1263:
1264:
1265: $this->alreadyInValidation = false;
1266: }
1267:
1268: return (!empty($failureMap) ? $failureMap : true);
1269: }
1270:
1271: 1272: 1273: 1274: 1275: 1276: 1277: 1278: 1279: 1280:
1281: public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
1282: {
1283: $pos = CvtermPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
1284: $field = $this->getByPosition($pos);
1285:
1286: return $field;
1287: }
1288:
1289: 1290: 1291: 1292: 1293: 1294: 1295:
1296: public function getByPosition($pos)
1297: {
1298: switch ($pos) {
1299: case 0:
1300: return $this->getCvtermId();
1301: break;
1302: case 1:
1303: return $this->getCvId();
1304: break;
1305: case 2:
1306: return $this->getName();
1307: break;
1308: case 3:
1309: return $this->getDefinition();
1310: break;
1311: case 4:
1312: return $this->getDbxrefId();
1313: break;
1314: case 5:
1315: return $this->getIsObsolete();
1316: break;
1317: case 6:
1318: return $this->getIsRelationshiptype();
1319: break;
1320: default:
1321: return null;
1322: break;
1323: }
1324: }
1325:
1326: 1327: 1328: 1329: 1330: 1331: 1332: 1333: 1334: 1335: 1336: 1337: 1338: 1339: 1340:
1341: public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
1342: {
1343: if (isset($alreadyDumpedObjects['Cvterm'][$this->getPrimaryKey()])) {
1344: return '*RECURSION*';
1345: }
1346: $alreadyDumpedObjects['Cvterm'][$this->getPrimaryKey()] = true;
1347: $keys = CvtermPeer::getFieldNames($keyType);
1348: $result = array(
1349: $keys[0] => $this->getCvtermId(),
1350: $keys[1] => $this->getCvId(),
1351: $keys[2] => $this->getName(),
1352: $keys[3] => $this->getDefinition(),
1353: $keys[4] => $this->getDbxrefId(),
1354: $keys[5] => $this->getIsObsolete(),
1355: $keys[6] => $this->getIsRelationshiptype(),
1356: );
1357: if ($includeForeignObjects) {
1358: if (null !== $this->aCv) {
1359: $result['Cv'] = $this->aCv->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
1360: }
1361: if (null !== $this->collBiomaterialRelationships) {
1362: $result['BiomaterialRelationships'] = $this->collBiomaterialRelationships->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
1363: }
1364: if (null !== $this->collBiomaterialprops) {
1365: $result['Biomaterialprops'] = $this->collBiomaterialprops->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
1366: }
1367: if (null !== $this->collContacts) {
1368: $result['Contacts'] = $this->collContacts->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
1369: }
1370: if (null !== $this->collFeatures) {
1371: $result['Features'] = $this->collFeatures->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
1372: }
1373: if (null !== $this->collFeatureCvterms) {
1374: $result['FeatureCvterms'] = $this->collFeatureCvterms->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
1375: }
1376: if (null !== $this->collFeatureCvtermprops) {
1377: $result['FeatureCvtermprops'] = $this->collFeatureCvtermprops->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
1378: }
1379: if (null !== $this->collProtocols) {
1380: $result['Protocols'] = $this->collProtocols->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
1381: }
1382: if (null !== $this->collPubs) {
1383: $result['Pubs'] = $this->collPubs->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
1384: }
1385: if (null !== $this->collPubRelationships) {
1386: $result['PubRelationships'] = $this->collPubRelationships->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
1387: }
1388: if (null !== $this->collPubprops) {
1389: $result['Pubprops'] = $this->collPubprops->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
1390: }
1391: if (null !== $this->collSynonyms) {
1392: $result['Synonyms'] = $this->collSynonyms->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
1393: }
1394: }
1395:
1396: return $result;
1397: }
1398:
1399: 1400: 1401: 1402: 1403: 1404: 1405: 1406: 1407: 1408: 1409:
1410: public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
1411: {
1412: $pos = CvtermPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
1413:
1414: $this->setByPosition($pos, $value);
1415: }
1416:
1417: 1418: 1419: 1420: 1421: 1422: 1423: 1424:
1425: public function setByPosition($pos, $value)
1426: {
1427: switch ($pos) {
1428: case 0:
1429: $this->setCvtermId($value);
1430: break;
1431: case 1:
1432: $this->setCvId($value);
1433: break;
1434: case 2:
1435: $this->setName($value);
1436: break;
1437: case 3:
1438: $this->setDefinition($value);
1439: break;
1440: case 4:
1441: $this->setDbxrefId($value);
1442: break;
1443: case 5:
1444: $this->setIsObsolete($value);
1445: break;
1446: case 6:
1447: $this->setIsRelationshiptype($value);
1448: break;
1449: }
1450: }
1451:
1452: 1453: 1454: 1455: 1456: 1457: 1458: 1459: 1460: 1461: 1462: 1463: 1464: 1465: 1466: 1467: 1468:
1469: public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
1470: {
1471: $keys = CvtermPeer::getFieldNames($keyType);
1472:
1473: if (array_key_exists($keys[0], $arr)) $this->setCvtermId($arr[$keys[0]]);
1474: if (array_key_exists($keys[1], $arr)) $this->setCvId($arr[$keys[1]]);
1475: if (array_key_exists($keys[2], $arr)) $this->setName($arr[$keys[2]]);
1476: if (array_key_exists($keys[3], $arr)) $this->setDefinition($arr[$keys[3]]);
1477: if (array_key_exists($keys[4], $arr)) $this->setDbxrefId($arr[$keys[4]]);
1478: if (array_key_exists($keys[5], $arr)) $this->setIsObsolete($arr[$keys[5]]);
1479: if (array_key_exists($keys[6], $arr)) $this->setIsRelationshiptype($arr[$keys[6]]);
1480: }
1481:
1482: 1483: 1484: 1485: 1486:
1487: public function buildCriteria()
1488: {
1489: $criteria = new Criteria(CvtermPeer::DATABASE_NAME);
1490:
1491: if ($this->isColumnModified(CvtermPeer::CVTERM_ID)) $criteria->add(CvtermPeer::CVTERM_ID, $this->cvterm_id);
1492: if ($this->isColumnModified(CvtermPeer::CV_ID)) $criteria->add(CvtermPeer::CV_ID, $this->cv_id);
1493: if ($this->isColumnModified(CvtermPeer::NAME)) $criteria->add(CvtermPeer::NAME, $this->name);
1494: if ($this->isColumnModified(CvtermPeer::DEFINITION)) $criteria->add(CvtermPeer::DEFINITION, $this->definition);
1495: if ($this->isColumnModified(CvtermPeer::DBXREF_ID)) $criteria->add(CvtermPeer::DBXREF_ID, $this->dbxref_id);
1496: if ($this->isColumnModified(CvtermPeer::IS_OBSOLETE)) $criteria->add(CvtermPeer::IS_OBSOLETE, $this->is_obsolete);
1497: if ($this->isColumnModified(CvtermPeer::IS_RELATIONSHIPTYPE)) $criteria->add(CvtermPeer::IS_RELATIONSHIPTYPE, $this->is_relationshiptype);
1498:
1499: return $criteria;
1500: }
1501:
1502: 1503: 1504: 1505: 1506: 1507: 1508: 1509:
1510: public function buildPkeyCriteria()
1511: {
1512: $criteria = new Criteria(CvtermPeer::DATABASE_NAME);
1513: $criteria->add(CvtermPeer::CVTERM_ID, $this->cvterm_id);
1514:
1515: return $criteria;
1516: }
1517:
1518: 1519: 1520: 1521:
1522: public function getPrimaryKey()
1523: {
1524: return $this->getCvtermId();
1525: }
1526:
1527: 1528: 1529: 1530: 1531: 1532:
1533: public function setPrimaryKey($key)
1534: {
1535: $this->setCvtermId($key);
1536: }
1537:
1538: 1539: 1540: 1541:
1542: public function isPrimaryKeyNull()
1543: {
1544:
1545: return null === $this->getCvtermId();
1546: }
1547:
1548: 1549: 1550: 1551: 1552: 1553: 1554: 1555: 1556: 1557: 1558:
1559: public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
1560: {
1561: $copyObj->setCvId($this->getCvId());
1562: $copyObj->setName($this->getName());
1563: $copyObj->setDefinition($this->getDefinition());
1564: $copyObj->setDbxrefId($this->getDbxrefId());
1565: $copyObj->setIsObsolete($this->getIsObsolete());
1566: $copyObj->setIsRelationshiptype($this->getIsRelationshiptype());
1567:
1568: if ($deepCopy && !$this->startCopy) {
1569:
1570:
1571: $copyObj->setNew(false);
1572:
1573: $this->startCopy = true;
1574:
1575: foreach ($this->getBiomaterialRelationships() as $relObj) {
1576: if ($relObj !== $this) {
1577: $copyObj->addBiomaterialRelationship($relObj->copy($deepCopy));
1578: }
1579: }
1580:
1581: foreach ($this->getBiomaterialprops() as $relObj) {
1582: if ($relObj !== $this) {
1583: $copyObj->addBiomaterialprop($relObj->copy($deepCopy));
1584: }
1585: }
1586:
1587: foreach ($this->getContacts() as $relObj) {
1588: if ($relObj !== $this) {
1589: $copyObj->addContact($relObj->copy($deepCopy));
1590: }
1591: }
1592:
1593: foreach ($this->getFeatures() as $relObj) {
1594: if ($relObj !== $this) {
1595: $copyObj->addFeature($relObj->copy($deepCopy));
1596: }
1597: }
1598:
1599: foreach ($this->getFeatureCvterms() as $relObj) {
1600: if ($relObj !== $this) {
1601: $copyObj->addFeatureCvterm($relObj->copy($deepCopy));
1602: }
1603: }
1604:
1605: foreach ($this->getFeatureCvtermprops() as $relObj) {
1606: if ($relObj !== $this) {
1607: $copyObj->addFeatureCvtermprop($relObj->copy($deepCopy));
1608: }
1609: }
1610:
1611: foreach ($this->getProtocols() as $relObj) {
1612: if ($relObj !== $this) {
1613: $copyObj->addProtocol($relObj->copy($deepCopy));
1614: }
1615: }
1616:
1617: foreach ($this->getPubs() as $relObj) {
1618: if ($relObj !== $this) {
1619: $copyObj->addPub($relObj->copy($deepCopy));
1620: }
1621: }
1622:
1623: foreach ($this->getPubRelationships() as $relObj) {
1624: if ($relObj !== $this) {
1625: $copyObj->addPubRelationship($relObj->copy($deepCopy));
1626: }
1627: }
1628:
1629: foreach ($this->getPubprops() as $relObj) {
1630: if ($relObj !== $this) {
1631: $copyObj->addPubprop($relObj->copy($deepCopy));
1632: }
1633: }
1634:
1635: foreach ($this->getSynonyms() as $relObj) {
1636: if ($relObj !== $this) {
1637: $copyObj->addSynonym($relObj->copy($deepCopy));
1638: }
1639: }
1640:
1641:
1642: $this->startCopy = false;
1643: }
1644:
1645: if ($makeNew) {
1646: $copyObj->setNew(true);
1647: $copyObj->setCvtermId(NULL);
1648: }
1649: }
1650:
1651: 1652: 1653: 1654: 1655: 1656: 1657: 1658: 1659: 1660: 1661: 1662:
1663: public function copy($deepCopy = false)
1664: {
1665:
1666: $clazz = get_class($this);
1667: $copyObj = new $clazz();
1668: $this->copyInto($copyObj, $deepCopy);
1669:
1670: return $copyObj;
1671: }
1672:
1673: 1674: 1675: 1676: 1677: 1678: 1679: 1680: 1681:
1682: public function getPeer()
1683: {
1684: if (self::$peer === null) {
1685: self::$peer = new CvtermPeer();
1686: }
1687:
1688: return self::$peer;
1689: }
1690:
1691: 1692: 1693: 1694: 1695: 1696: 1697:
1698: public function setCv(Cv $v = null)
1699: {
1700: if ($v === null) {
1701: $this->setCvId(NULL);
1702: } else {
1703: $this->setCvId($v->getCvId());
1704: }
1705:
1706: $this->aCv = $v;
1707:
1708:
1709:
1710: if ($v !== null) {
1711: $v->addCvterm($this);
1712: }
1713:
1714:
1715: return $this;
1716: }
1717:
1718:
1719: 1720: 1721: 1722: 1723: 1724: 1725: 1726:
1727: public function getCv(PropelPDO $con = null, $doQuery = true)
1728: {
1729: if ($this->aCv === null && ($this->cv_id !== null) && $doQuery) {
1730: $this->aCv = CvQuery::create()->findPk($this->cv_id, $con);
1731: 1732: 1733: 1734: 1735: 1736: 1737:
1738: }
1739:
1740: return $this->aCv;
1741: }
1742:
1743:
1744: 1745: 1746: 1747: 1748: 1749: 1750: 1751:
1752: public function initRelation($relationName)
1753: {
1754: if ('BiomaterialRelationship' == $relationName) {
1755: $this->initBiomaterialRelationships();
1756: }
1757: if ('Biomaterialprop' == $relationName) {
1758: $this->initBiomaterialprops();
1759: }
1760: if ('Contact' == $relationName) {
1761: $this->initContacts();
1762: }
1763: if ('Feature' == $relationName) {
1764: $this->initFeatures();
1765: }
1766: if ('FeatureCvterm' == $relationName) {
1767: $this->initFeatureCvterms();
1768: }
1769: if ('FeatureCvtermprop' == $relationName) {
1770: $this->initFeatureCvtermprops();
1771: }
1772: if ('Protocol' == $relationName) {
1773: $this->initProtocols();
1774: }
1775: if ('Pub' == $relationName) {
1776: $this->initPubs();
1777: }
1778: if ('PubRelationship' == $relationName) {
1779: $this->initPubRelationships();
1780: }
1781: if ('Pubprop' == $relationName) {
1782: $this->initPubprops();
1783: }
1784: if ('Synonym' == $relationName) {
1785: $this->initSynonyms();
1786: }
1787: }
1788:
1789: 1790: 1791: 1792: 1793: 1794: 1795: 1796: 1797:
1798: public function clearBiomaterialRelationships()
1799: {
1800: $this->collBiomaterialRelationships = null;
1801: $this->collBiomaterialRelationshipsPartial = null;
1802:
1803: return $this;
1804: }
1805:
1806: 1807: 1808: 1809: 1810:
1811: public function resetPartialBiomaterialRelationships($v = true)
1812: {
1813: $this->collBiomaterialRelationshipsPartial = $v;
1814: }
1815:
1816: 1817: 1818: 1819: 1820: 1821: 1822: 1823: 1824: 1825: 1826: 1827:
1828: public function initBiomaterialRelationships($overrideExisting = true)
1829: {
1830: if (null !== $this->collBiomaterialRelationships && !$overrideExisting) {
1831: return;
1832: }
1833: $this->collBiomaterialRelationships = new PropelObjectCollection();
1834: $this->collBiomaterialRelationships->setModel('BiomaterialRelationship');
1835: }
1836:
1837: 1838: 1839: 1840: 1841: 1842: 1843: 1844: 1845: 1846: 1847: 1848: 1849: 1850:
1851: public function getBiomaterialRelationships($criteria = null, PropelPDO $con = null)
1852: {
1853: $partial = $this->collBiomaterialRelationshipsPartial && !$this->isNew();
1854: if (null === $this->collBiomaterialRelationships || null !== $criteria || $partial) {
1855: if ($this->isNew() && null === $this->collBiomaterialRelationships) {
1856:
1857: $this->initBiomaterialRelationships();
1858: } else {
1859: $collBiomaterialRelationships = BiomaterialRelationshipQuery::create(null, $criteria)
1860: ->filterByCvterm($this)
1861: ->find($con);
1862: if (null !== $criteria) {
1863: if (false !== $this->collBiomaterialRelationshipsPartial && count($collBiomaterialRelationships)) {
1864: $this->initBiomaterialRelationships(false);
1865:
1866: foreach($collBiomaterialRelationships as $obj) {
1867: if (false == $this->collBiomaterialRelationships->contains($obj)) {
1868: $this->collBiomaterialRelationships->append($obj);
1869: }
1870: }
1871:
1872: $this->collBiomaterialRelationshipsPartial = true;
1873: }
1874:
1875: $collBiomaterialRelationships->getInternalIterator()->rewind();
1876: return $collBiomaterialRelationships;
1877: }
1878:
1879: if($partial && $this->collBiomaterialRelationships) {
1880: foreach($this->collBiomaterialRelationships as $obj) {
1881: if($obj->isNew()) {
1882: $collBiomaterialRelationships[] = $obj;
1883: }
1884: }
1885: }
1886:
1887: $this->collBiomaterialRelationships = $collBiomaterialRelationships;
1888: $this->collBiomaterialRelationshipsPartial = false;
1889: }
1890: }
1891:
1892: return $this->collBiomaterialRelationships;
1893: }
1894:
1895: 1896: 1897: 1898: 1899: 1900: 1901: 1902: 1903: 1904:
1905: public function setBiomaterialRelationships(PropelCollection $biomaterialRelationships, PropelPDO $con = null)
1906: {
1907: $biomaterialRelationshipsToDelete = $this->getBiomaterialRelationships(new Criteria(), $con)->diff($biomaterialRelationships);
1908:
1909: $this->biomaterialRelationshipsScheduledForDeletion = unserialize(serialize($biomaterialRelationshipsToDelete));
1910:
1911: foreach ($biomaterialRelationshipsToDelete as $biomaterialRelationshipRemoved) {
1912: $biomaterialRelationshipRemoved->setCvterm(null);
1913: }
1914:
1915: $this->collBiomaterialRelationships = null;
1916: foreach ($biomaterialRelationships as $biomaterialRelationship) {
1917: $this->addBiomaterialRelationship($biomaterialRelationship);
1918: }
1919:
1920: $this->collBiomaterialRelationships = $biomaterialRelationships;
1921: $this->collBiomaterialRelationshipsPartial = false;
1922:
1923: return $this;
1924: }
1925:
1926: 1927: 1928: 1929: 1930: 1931: 1932: 1933: 1934:
1935: public function countBiomaterialRelationships(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
1936: {
1937: $partial = $this->collBiomaterialRelationshipsPartial && !$this->isNew();
1938: if (null === $this->collBiomaterialRelationships || null !== $criteria || $partial) {
1939: if ($this->isNew() && null === $this->collBiomaterialRelationships) {
1940: return 0;
1941: }
1942:
1943: if($partial && !$criteria) {
1944: return count($this->getBiomaterialRelationships());
1945: }
1946: $query = BiomaterialRelationshipQuery::create(null, $criteria);
1947: if ($distinct) {
1948: $query->distinct();
1949: }
1950:
1951: return $query
1952: ->filterByCvterm($this)
1953: ->count($con);
1954: }
1955:
1956: return count($this->collBiomaterialRelationships);
1957: }
1958:
1959: 1960: 1961: 1962: 1963: 1964: 1965:
1966: public function addBiomaterialRelationship(BiomaterialRelationship $l)
1967: {
1968: if ($this->collBiomaterialRelationships === null) {
1969: $this->initBiomaterialRelationships();
1970: $this->collBiomaterialRelationshipsPartial = true;
1971: }
1972: if (!in_array($l, $this->collBiomaterialRelationships->getArrayCopy(), true)) {
1973: $this->doAddBiomaterialRelationship($l);
1974: }
1975:
1976: return $this;
1977: }
1978:
1979: 1980: 1981:
1982: protected function doAddBiomaterialRelationship($biomaterialRelationship)
1983: {
1984: $this->collBiomaterialRelationships[]= $biomaterialRelationship;
1985: $biomaterialRelationship->setCvterm($this);
1986: }
1987:
1988: 1989: 1990: 1991:
1992: public function removeBiomaterialRelationship($biomaterialRelationship)
1993: {
1994: if ($this->getBiomaterialRelationships()->contains($biomaterialRelationship)) {
1995: $this->collBiomaterialRelationships->remove($this->collBiomaterialRelationships->search($biomaterialRelationship));
1996: if (null === $this->biomaterialRelationshipsScheduledForDeletion) {
1997: $this->biomaterialRelationshipsScheduledForDeletion = clone $this->collBiomaterialRelationships;
1998: $this->biomaterialRelationshipsScheduledForDeletion->clear();
1999: }
2000: $this->biomaterialRelationshipsScheduledForDeletion[]= clone $biomaterialRelationship;
2001: $biomaterialRelationship->setCvterm(null);
2002: }
2003:
2004: return $this;
2005: }
2006:
2007:
2008: 2009: 2010: 2011: 2012: 2013: 2014: 2015: 2016: 2017: 2018: 2019: 2020: 2021: 2022: 2023:
2024: public function getBiomaterialRelationshipsJoinBiomaterialRelatedByObjectId($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
2025: {
2026: $query = BiomaterialRelationshipQuery::create(null, $criteria);
2027: $query->joinWith('BiomaterialRelatedByObjectId', $join_behavior);
2028:
2029: return $this->getBiomaterialRelationships($query, $con);
2030: }
2031:
2032:
2033: 2034: 2035: 2036: 2037: 2038: 2039: 2040: 2041: 2042: 2043: 2044: 2045: 2046: 2047: 2048:
2049: public function getBiomaterialRelationshipsJoinBiomaterialRelatedBySubjectId($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
2050: {
2051: $query = BiomaterialRelationshipQuery::create(null, $criteria);
2052: $query->joinWith('BiomaterialRelatedBySubjectId', $join_behavior);
2053:
2054: return $this->getBiomaterialRelationships($query, $con);
2055: }
2056:
2057: 2058: 2059: 2060: 2061: 2062: 2063: 2064: 2065:
2066: public function clearBiomaterialprops()
2067: {
2068: $this->collBiomaterialprops = null;
2069: $this->collBiomaterialpropsPartial = null;
2070:
2071: return $this;
2072: }
2073:
2074: 2075: 2076: 2077: 2078:
2079: public function resetPartialBiomaterialprops($v = true)
2080: {
2081: $this->collBiomaterialpropsPartial = $v;
2082: }
2083:
2084: 2085: 2086: 2087: 2088: 2089: 2090: 2091: 2092: 2093: 2094: 2095:
2096: public function initBiomaterialprops($overrideExisting = true)
2097: {
2098: if (null !== $this->collBiomaterialprops && !$overrideExisting) {
2099: return;
2100: }
2101: $this->collBiomaterialprops = new PropelObjectCollection();
2102: $this->collBiomaterialprops->setModel('Biomaterialprop');
2103: }
2104:
2105: 2106: 2107: 2108: 2109: 2110: 2111: 2112: 2113: 2114: 2115: 2116: 2117: 2118:
2119: public function getBiomaterialprops($criteria = null, PropelPDO $con = null)
2120: {
2121: $partial = $this->collBiomaterialpropsPartial && !$this->isNew();
2122: if (null === $this->collBiomaterialprops || null !== $criteria || $partial) {
2123: if ($this->isNew() && null === $this->collBiomaterialprops) {
2124:
2125: $this->initBiomaterialprops();
2126: } else {
2127: $collBiomaterialprops = BiomaterialpropQuery::create(null, $criteria)
2128: ->filterByCvterm($this)
2129: ->find($con);
2130: if (null !== $criteria) {
2131: if (false !== $this->collBiomaterialpropsPartial && count($collBiomaterialprops)) {
2132: $this->initBiomaterialprops(false);
2133:
2134: foreach($collBiomaterialprops as $obj) {
2135: if (false == $this->collBiomaterialprops->contains($obj)) {
2136: $this->collBiomaterialprops->append($obj);
2137: }
2138: }
2139:
2140: $this->collBiomaterialpropsPartial = true;
2141: }
2142:
2143: $collBiomaterialprops->getInternalIterator()->rewind();
2144: return $collBiomaterialprops;
2145: }
2146:
2147: if($partial && $this->collBiomaterialprops) {
2148: foreach($this->collBiomaterialprops as $obj) {
2149: if($obj->isNew()) {
2150: $collBiomaterialprops[] = $obj;
2151: }
2152: }
2153: }
2154:
2155: $this->collBiomaterialprops = $collBiomaterialprops;
2156: $this->collBiomaterialpropsPartial = false;
2157: }
2158: }
2159:
2160: return $this->collBiomaterialprops;
2161: }
2162:
2163: 2164: 2165: 2166: 2167: 2168: 2169: 2170: 2171: 2172:
2173: public function setBiomaterialprops(PropelCollection $biomaterialprops, PropelPDO $con = null)
2174: {
2175: $biomaterialpropsToDelete = $this->getBiomaterialprops(new Criteria(), $con)->diff($biomaterialprops);
2176:
2177: $this->biomaterialpropsScheduledForDeletion = unserialize(serialize($biomaterialpropsToDelete));
2178:
2179: foreach ($biomaterialpropsToDelete as $biomaterialpropRemoved) {
2180: $biomaterialpropRemoved->setCvterm(null);
2181: }
2182:
2183: $this->collBiomaterialprops = null;
2184: foreach ($biomaterialprops as $biomaterialprop) {
2185: $this->addBiomaterialprop($biomaterialprop);
2186: }
2187:
2188: $this->collBiomaterialprops = $biomaterialprops;
2189: $this->collBiomaterialpropsPartial = false;
2190:
2191: return $this;
2192: }
2193:
2194: 2195: 2196: 2197: 2198: 2199: 2200: 2201: 2202:
2203: public function countBiomaterialprops(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
2204: {
2205: $partial = $this->collBiomaterialpropsPartial && !$this->isNew();
2206: if (null === $this->collBiomaterialprops || null !== $criteria || $partial) {
2207: if ($this->isNew() && null === $this->collBiomaterialprops) {
2208: return 0;
2209: }
2210:
2211: if($partial && !$criteria) {
2212: return count($this->getBiomaterialprops());
2213: }
2214: $query = BiomaterialpropQuery::create(null, $criteria);
2215: if ($distinct) {
2216: $query->distinct();
2217: }
2218:
2219: return $query
2220: ->filterByCvterm($this)
2221: ->count($con);
2222: }
2223:
2224: return count($this->collBiomaterialprops);
2225: }
2226:
2227: 2228: 2229: 2230: 2231: 2232: 2233:
2234: public function addBiomaterialprop(Biomaterialprop $l)
2235: {
2236: if ($this->collBiomaterialprops === null) {
2237: $this->initBiomaterialprops();
2238: $this->collBiomaterialpropsPartial = true;
2239: }
2240: if (!in_array($l, $this->collBiomaterialprops->getArrayCopy(), true)) {
2241: $this->doAddBiomaterialprop($l);
2242: }
2243:
2244: return $this;
2245: }
2246:
2247: 2248: 2249:
2250: protected function doAddBiomaterialprop($biomaterialprop)
2251: {
2252: $this->collBiomaterialprops[]= $biomaterialprop;
2253: $biomaterialprop->setCvterm($this);
2254: }
2255:
2256: 2257: 2258: 2259:
2260: public function removeBiomaterialprop($biomaterialprop)
2261: {
2262: if ($this->getBiomaterialprops()->contains($biomaterialprop)) {
2263: $this->collBiomaterialprops->remove($this->collBiomaterialprops->search($biomaterialprop));
2264: if (null === $this->biomaterialpropsScheduledForDeletion) {
2265: $this->biomaterialpropsScheduledForDeletion = clone $this->collBiomaterialprops;
2266: $this->biomaterialpropsScheduledForDeletion->clear();
2267: }
2268: $this->biomaterialpropsScheduledForDeletion[]= clone $biomaterialprop;
2269: $biomaterialprop->setCvterm(null);
2270: }
2271:
2272: return $this;
2273: }
2274:
2275:
2276: 2277: 2278: 2279: 2280: 2281: 2282: 2283: 2284: 2285: 2286: 2287: 2288: 2289: 2290: 2291:
2292: public function getBiomaterialpropsJoinBiomaterial($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
2293: {
2294: $query = BiomaterialpropQuery::create(null, $criteria);
2295: $query->joinWith('Biomaterial', $join_behavior);
2296:
2297: return $this->getBiomaterialprops($query, $con);
2298: }
2299:
2300: 2301: 2302: 2303: 2304: 2305: 2306: 2307: 2308:
2309: public function clearContacts()
2310: {
2311: $this->collContacts = null;
2312: $this->collContactsPartial = null;
2313:
2314: return $this;
2315: }
2316:
2317: 2318: 2319: 2320: 2321:
2322: public function resetPartialContacts($v = true)
2323: {
2324: $this->collContactsPartial = $v;
2325: }
2326:
2327: 2328: 2329: 2330: 2331: 2332: 2333: 2334: 2335: 2336: 2337: 2338:
2339: public function initContacts($overrideExisting = true)
2340: {
2341: if (null !== $this->collContacts && !$overrideExisting) {
2342: return;
2343: }
2344: $this->collContacts = new PropelObjectCollection();
2345: $this->collContacts->setModel('Contact');
2346: }
2347:
2348: 2349: 2350: 2351: 2352: 2353: 2354: 2355: 2356: 2357: 2358: 2359: 2360: 2361:
2362: public function getContacts($criteria = null, PropelPDO $con = null)
2363: {
2364: $partial = $this->collContactsPartial && !$this->isNew();
2365: if (null === $this->collContacts || null !== $criteria || $partial) {
2366: if ($this->isNew() && null === $this->collContacts) {
2367:
2368: $this->initContacts();
2369: } else {
2370: $collContacts = ContactQuery::create(null, $criteria)
2371: ->filterByCvterm($this)
2372: ->find($con);
2373: if (null !== $criteria) {
2374: if (false !== $this->collContactsPartial && count($collContacts)) {
2375: $this->initContacts(false);
2376:
2377: foreach($collContacts as $obj) {
2378: if (false == $this->collContacts->contains($obj)) {
2379: $this->collContacts->append($obj);
2380: }
2381: }
2382:
2383: $this->collContactsPartial = true;
2384: }
2385:
2386: $collContacts->getInternalIterator()->rewind();
2387: return $collContacts;
2388: }
2389:
2390: if($partial && $this->collContacts) {
2391: foreach($this->collContacts as $obj) {
2392: if($obj->isNew()) {
2393: $collContacts[] = $obj;
2394: }
2395: }
2396: }
2397:
2398: $this->collContacts = $collContacts;
2399: $this->collContactsPartial = false;
2400: }
2401: }
2402:
2403: return $this->collContacts;
2404: }
2405:
2406: 2407: 2408: 2409: 2410: 2411: 2412: 2413: 2414: 2415:
2416: public function setContacts(PropelCollection $contacts, PropelPDO $con = null)
2417: {
2418: $contactsToDelete = $this->getContacts(new Criteria(), $con)->diff($contacts);
2419:
2420: $this->contactsScheduledForDeletion = unserialize(serialize($contactsToDelete));
2421:
2422: foreach ($contactsToDelete as $contactRemoved) {
2423: $contactRemoved->setCvterm(null);
2424: }
2425:
2426: $this->collContacts = null;
2427: foreach ($contacts as $contact) {
2428: $this->addContact($contact);
2429: }
2430:
2431: $this->collContacts = $contacts;
2432: $this->collContactsPartial = false;
2433:
2434: return $this;
2435: }
2436:
2437: 2438: 2439: 2440: 2441: 2442: 2443: 2444: 2445:
2446: public function countContacts(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
2447: {
2448: $partial = $this->collContactsPartial && !$this->isNew();
2449: if (null === $this->collContacts || null !== $criteria || $partial) {
2450: if ($this->isNew() && null === $this->collContacts) {
2451: return 0;
2452: }
2453:
2454: if($partial && !$criteria) {
2455: return count($this->getContacts());
2456: }
2457: $query = ContactQuery::create(null, $criteria);
2458: if ($distinct) {
2459: $query->distinct();
2460: }
2461:
2462: return $query
2463: ->filterByCvterm($this)
2464: ->count($con);
2465: }
2466:
2467: return count($this->collContacts);
2468: }
2469:
2470: 2471: 2472: 2473: 2474: 2475: 2476:
2477: public function addContact(Contact $l)
2478: {
2479: if ($this->collContacts === null) {
2480: $this->initContacts();
2481: $this->collContactsPartial = true;
2482: }
2483: if (!in_array($l, $this->collContacts->getArrayCopy(), true)) {
2484: $this->doAddContact($l);
2485: }
2486:
2487: return $this;
2488: }
2489:
2490: 2491: 2492:
2493: protected function doAddContact($contact)
2494: {
2495: $this->collContacts[]= $contact;
2496: $contact->setCvterm($this);
2497: }
2498:
2499: 2500: 2501: 2502:
2503: public function removeContact($contact)
2504: {
2505: if ($this->getContacts()->contains($contact)) {
2506: $this->collContacts->remove($this->collContacts->search($contact));
2507: if (null === $this->contactsScheduledForDeletion) {
2508: $this->contactsScheduledForDeletion = clone $this->collContacts;
2509: $this->contactsScheduledForDeletion->clear();
2510: }
2511: $this->contactsScheduledForDeletion[]= $contact;
2512: $contact->setCvterm(null);
2513: }
2514:
2515: return $this;
2516: }
2517:
2518: 2519: 2520: 2521: 2522: 2523: 2524: 2525: 2526:
2527: public function clearFeatures()
2528: {
2529: $this->collFeatures = null;
2530: $this->collFeaturesPartial = null;
2531:
2532: return $this;
2533: }
2534:
2535: 2536: 2537: 2538: 2539:
2540: public function resetPartialFeatures($v = true)
2541: {
2542: $this->collFeaturesPartial = $v;
2543: }
2544:
2545: 2546: 2547: 2548: 2549: 2550: 2551: 2552: 2553: 2554: 2555: 2556:
2557: public function initFeatures($overrideExisting = true)
2558: {
2559: if (null !== $this->collFeatures && !$overrideExisting) {
2560: return;
2561: }
2562: $this->collFeatures = new PropelObjectCollection();
2563: $this->collFeatures->setModel('Feature');
2564: }
2565:
2566: 2567: 2568: 2569: 2570: 2571: 2572: 2573: 2574: 2575: 2576: 2577: 2578: 2579:
2580: public function getFeatures($criteria = null, PropelPDO $con = null)
2581: {
2582: $partial = $this->collFeaturesPartial && !$this->isNew();
2583: if (null === $this->collFeatures || null !== $criteria || $partial) {
2584: if ($this->isNew() && null === $this->collFeatures) {
2585:
2586: $this->initFeatures();
2587: } else {
2588: $collFeatures = FeatureQuery::create(null, $criteria)
2589: ->filterByCvterm($this)
2590: ->find($con);
2591: if (null !== $criteria) {
2592: if (false !== $this->collFeaturesPartial && count($collFeatures)) {
2593: $this->initFeatures(false);
2594:
2595: foreach($collFeatures as $obj) {
2596: if (false == $this->collFeatures->contains($obj)) {
2597: $this->collFeatures->append($obj);
2598: }
2599: }
2600:
2601: $this->collFeaturesPartial = true;
2602: }
2603:
2604: $collFeatures->getInternalIterator()->rewind();
2605: return $collFeatures;
2606: }
2607:
2608: if($partial && $this->collFeatures) {
2609: foreach($this->collFeatures as $obj) {
2610: if($obj->isNew()) {
2611: $collFeatures[] = $obj;
2612: }
2613: }
2614: }
2615:
2616: $this->collFeatures = $collFeatures;
2617: $this->collFeaturesPartial = false;
2618: }
2619: }
2620:
2621: return $this->collFeatures;
2622: }
2623:
2624: 2625: 2626: 2627: 2628: 2629: 2630: 2631: 2632: 2633:
2634: public function setFeatures(PropelCollection $features, PropelPDO $con = null)
2635: {
2636: $featuresToDelete = $this->getFeatures(new Criteria(), $con)->diff($features);
2637:
2638: $this->featuresScheduledForDeletion = unserialize(serialize($featuresToDelete));
2639:
2640: foreach ($featuresToDelete as $featureRemoved) {
2641: $featureRemoved->setCvterm(null);
2642: }
2643:
2644: $this->collFeatures = null;
2645: foreach ($features as $feature) {
2646: $this->addFeature($feature);
2647: }
2648:
2649: $this->collFeatures = $features;
2650: $this->collFeaturesPartial = false;
2651:
2652: return $this;
2653: }
2654:
2655: 2656: 2657: 2658: 2659: 2660: 2661: 2662: 2663:
2664: public function countFeatures(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
2665: {
2666: $partial = $this->collFeaturesPartial && !$this->isNew();
2667: if (null === $this->collFeatures || null !== $criteria || $partial) {
2668: if ($this->isNew() && null === $this->collFeatures) {
2669: return 0;
2670: }
2671:
2672: if($partial && !$criteria) {
2673: return count($this->getFeatures());
2674: }
2675: $query = FeatureQuery::create(null, $criteria);
2676: if ($distinct) {
2677: $query->distinct();
2678: }
2679:
2680: return $query
2681: ->filterByCvterm($this)
2682: ->count($con);
2683: }
2684:
2685: return count($this->collFeatures);
2686: }
2687:
2688: 2689: 2690: 2691: 2692: 2693: 2694:
2695: public function addFeature(Feature $l)
2696: {
2697: if ($this->collFeatures === null) {
2698: $this->initFeatures();
2699: $this->collFeaturesPartial = true;
2700: }
2701: if (!in_array($l, $this->collFeatures->getArrayCopy(), true)) {
2702: $this->doAddFeature($l);
2703: }
2704:
2705: return $this;
2706: }
2707:
2708: 2709: 2710:
2711: protected function doAddFeature($feature)
2712: {
2713: $this->collFeatures[]= $feature;
2714: $feature->setCvterm($this);
2715: }
2716:
2717: 2718: 2719: 2720:
2721: public function removeFeature($feature)
2722: {
2723: if ($this->getFeatures()->contains($feature)) {
2724: $this->collFeatures->remove($this->collFeatures->search($feature));
2725: if (null === $this->featuresScheduledForDeletion) {
2726: $this->featuresScheduledForDeletion = clone $this->collFeatures;
2727: $this->featuresScheduledForDeletion->clear();
2728: }
2729: $this->featuresScheduledForDeletion[]= clone $feature;
2730: $feature->setCvterm(null);
2731: }
2732:
2733: return $this;
2734: }
2735:
2736:
2737: 2738: 2739: 2740: 2741: 2742: 2743: 2744: 2745: 2746: 2747: 2748: 2749: 2750: 2751: 2752:
2753: public function getFeaturesJoinDbxref($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
2754: {
2755: $query = FeatureQuery::create(null, $criteria);
2756: $query->joinWith('Dbxref', $join_behavior);
2757:
2758: return $this->getFeatures($query, $con);
2759: }
2760:
2761:
2762: 2763: 2764: 2765: 2766: 2767: 2768: 2769: 2770: 2771: 2772: 2773: 2774: 2775: 2776: 2777:
2778: public function getFeaturesJoinOrganism($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
2779: {
2780: $query = FeatureQuery::create(null, $criteria);
2781: $query->joinWith('Organism', $join_behavior);
2782:
2783: return $this->getFeatures($query, $con);
2784: }
2785:
2786: 2787: 2788: 2789: 2790: 2791: 2792: 2793: 2794:
2795: public function clearFeatureCvterms()
2796: {
2797: $this->collFeatureCvterms = null;
2798: $this->collFeatureCvtermsPartial = null;
2799:
2800: return $this;
2801: }
2802:
2803: 2804: 2805: 2806: 2807:
2808: public function resetPartialFeatureCvterms($v = true)
2809: {
2810: $this->collFeatureCvtermsPartial = $v;
2811: }
2812:
2813: 2814: 2815: 2816: 2817: 2818: 2819: 2820: 2821: 2822: 2823: 2824:
2825: public function initFeatureCvterms($overrideExisting = true)
2826: {
2827: if (null !== $this->collFeatureCvterms && !$overrideExisting) {
2828: return;
2829: }
2830: $this->collFeatureCvterms = new PropelObjectCollection();
2831: $this->collFeatureCvterms->setModel('FeatureCvterm');
2832: }
2833:
2834: 2835: 2836: 2837: 2838: 2839: 2840: 2841: 2842: 2843: 2844: 2845: 2846: 2847:
2848: public function getFeatureCvterms($criteria = null, PropelPDO $con = null)
2849: {
2850: $partial = $this->collFeatureCvtermsPartial && !$this->isNew();
2851: if (null === $this->collFeatureCvterms || null !== $criteria || $partial) {
2852: if ($this->isNew() && null === $this->collFeatureCvterms) {
2853:
2854: $this->initFeatureCvterms();
2855: } else {
2856: $collFeatureCvterms = FeatureCvtermQuery::create(null, $criteria)
2857: ->filterByCvterm($this)
2858: ->find($con);
2859: if (null !== $criteria) {
2860: if (false !== $this->collFeatureCvtermsPartial && count($collFeatureCvterms)) {
2861: $this->initFeatureCvterms(false);
2862:
2863: foreach($collFeatureCvterms as $obj) {
2864: if (false == $this->collFeatureCvterms->contains($obj)) {
2865: $this->collFeatureCvterms->append($obj);
2866: }
2867: }
2868:
2869: $this->collFeatureCvtermsPartial = true;
2870: }
2871:
2872: $collFeatureCvterms->getInternalIterator()->rewind();
2873: return $collFeatureCvterms;
2874: }
2875:
2876: if($partial && $this->collFeatureCvterms) {
2877: foreach($this->collFeatureCvterms as $obj) {
2878: if($obj->isNew()) {
2879: $collFeatureCvterms[] = $obj;
2880: }
2881: }
2882: }
2883:
2884: $this->collFeatureCvterms = $collFeatureCvterms;
2885: $this->collFeatureCvtermsPartial = false;
2886: }
2887: }
2888:
2889: return $this->collFeatureCvterms;
2890: }
2891:
2892: 2893: 2894: 2895: 2896: 2897: 2898: 2899: 2900: 2901:
2902: public function setFeatureCvterms(PropelCollection $featureCvterms, PropelPDO $con = null)
2903: {
2904: $featureCvtermsToDelete = $this->getFeatureCvterms(new Criteria(), $con)->diff($featureCvterms);
2905:
2906: $this->featureCvtermsScheduledForDeletion = unserialize(serialize($featureCvtermsToDelete));
2907:
2908: foreach ($featureCvtermsToDelete as $featureCvtermRemoved) {
2909: $featureCvtermRemoved->setCvterm(null);
2910: }
2911:
2912: $this->collFeatureCvterms = null;
2913: foreach ($featureCvterms as $featureCvterm) {
2914: $this->addFeatureCvterm($featureCvterm);
2915: }
2916:
2917: $this->collFeatureCvterms = $featureCvterms;
2918: $this->collFeatureCvtermsPartial = false;
2919:
2920: return $this;
2921: }
2922:
2923: 2924: 2925: 2926: 2927: 2928: 2929: 2930: 2931:
2932: public function countFeatureCvterms(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
2933: {
2934: $partial = $this->collFeatureCvtermsPartial && !$this->isNew();
2935: if (null === $this->collFeatureCvterms || null !== $criteria || $partial) {
2936: if ($this->isNew() && null === $this->collFeatureCvterms) {
2937: return 0;
2938: }
2939:
2940: if($partial && !$criteria) {
2941: return count($this->getFeatureCvterms());
2942: }
2943: $query = FeatureCvtermQuery::create(null, $criteria);
2944: if ($distinct) {
2945: $query->distinct();
2946: }
2947:
2948: return $query
2949: ->filterByCvterm($this)
2950: ->count($con);
2951: }
2952:
2953: return count($this->collFeatureCvterms);
2954: }
2955:
2956: 2957: 2958: 2959: 2960: 2961: 2962:
2963: public function addFeatureCvterm(FeatureCvterm $l)
2964: {
2965: if ($this->collFeatureCvterms === null) {
2966: $this->initFeatureCvterms();
2967: $this->collFeatureCvtermsPartial = true;
2968: }
2969: if (!in_array($l, $this->collFeatureCvterms->getArrayCopy(), true)) {
2970: $this->doAddFeatureCvterm($l);
2971: }
2972:
2973: return $this;
2974: }
2975:
2976: 2977: 2978:
2979: protected function doAddFeatureCvterm($featureCvterm)
2980: {
2981: $this->collFeatureCvterms[]= $featureCvterm;
2982: $featureCvterm->setCvterm($this);
2983: }
2984:
2985: 2986: 2987: 2988:
2989: public function removeFeatureCvterm($featureCvterm)
2990: {
2991: if ($this->getFeatureCvterms()->contains($featureCvterm)) {
2992: $this->collFeatureCvterms->remove($this->collFeatureCvterms->search($featureCvterm));
2993: if (null === $this->featureCvtermsScheduledForDeletion) {
2994: $this->featureCvtermsScheduledForDeletion = clone $this->collFeatureCvterms;
2995: $this->featureCvtermsScheduledForDeletion->clear();
2996: }
2997: $this->featureCvtermsScheduledForDeletion[]= clone $featureCvterm;
2998: $featureCvterm->setCvterm(null);
2999: }
3000:
3001: return $this;
3002: }
3003:
3004:
3005: 3006: 3007: 3008: 3009: 3010: 3011: 3012: 3013: 3014: 3015: 3016: 3017: 3018: 3019: 3020:
3021: public function getFeatureCvtermsJoinFeature($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
3022: {
3023: $query = FeatureCvtermQuery::create(null, $criteria);
3024: $query->joinWith('Feature', $join_behavior);
3025:
3026: return $this->getFeatureCvterms($query, $con);
3027: }
3028:
3029:
3030: 3031: 3032: 3033: 3034: 3035: 3036: 3037: 3038: 3039: 3040: 3041: 3042: 3043: 3044: 3045:
3046: public function getFeatureCvtermsJoinPub($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
3047: {
3048: $query = FeatureCvtermQuery::create(null, $criteria);
3049: $query->joinWith('Pub', $join_behavior);
3050:
3051: return $this->getFeatureCvterms($query, $con);
3052: }
3053:
3054: 3055: 3056: 3057: 3058: 3059: 3060: 3061: 3062:
3063: public function clearFeatureCvtermprops()
3064: {
3065: $this->collFeatureCvtermprops = null;
3066: $this->collFeatureCvtermpropsPartial = null;
3067:
3068: return $this;
3069: }
3070:
3071: 3072: 3073: 3074: 3075:
3076: public function resetPartialFeatureCvtermprops($v = true)
3077: {
3078: $this->collFeatureCvtermpropsPartial = $v;
3079: }
3080:
3081: 3082: 3083: 3084: 3085: 3086: 3087: 3088: 3089: 3090: 3091: 3092:
3093: public function initFeatureCvtermprops($overrideExisting = true)
3094: {
3095: if (null !== $this->collFeatureCvtermprops && !$overrideExisting) {
3096: return;
3097: }
3098: $this->collFeatureCvtermprops = new PropelObjectCollection();
3099: $this->collFeatureCvtermprops->setModel('FeatureCvtermprop');
3100: }
3101:
3102: 3103: 3104: 3105: 3106: 3107: 3108: 3109: 3110: 3111: 3112: 3113: 3114: 3115:
3116: public function getFeatureCvtermprops($criteria = null, PropelPDO $con = null)
3117: {
3118: $partial = $this->collFeatureCvtermpropsPartial && !$this->isNew();
3119: if (null === $this->collFeatureCvtermprops || null !== $criteria || $partial) {
3120: if ($this->isNew() && null === $this->collFeatureCvtermprops) {
3121:
3122: $this->initFeatureCvtermprops();
3123: } else {
3124: $collFeatureCvtermprops = FeatureCvtermpropQuery::create(null, $criteria)
3125: ->filterByCvterm($this)
3126: ->find($con);
3127: if (null !== $criteria) {
3128: if (false !== $this->collFeatureCvtermpropsPartial && count($collFeatureCvtermprops)) {
3129: $this->initFeatureCvtermprops(false);
3130:
3131: foreach($collFeatureCvtermprops as $obj) {
3132: if (false == $this->collFeatureCvtermprops->contains($obj)) {
3133: $this->collFeatureCvtermprops->append($obj);
3134: }
3135: }
3136:
3137: $this->collFeatureCvtermpropsPartial = true;
3138: }
3139:
3140: $collFeatureCvtermprops->getInternalIterator()->rewind();
3141: return $collFeatureCvtermprops;
3142: }
3143:
3144: if($partial && $this->collFeatureCvtermprops) {
3145: foreach($this->collFeatureCvtermprops as $obj) {
3146: if($obj->isNew()) {
3147: $collFeatureCvtermprops[] = $obj;
3148: }
3149: }
3150: }
3151:
3152: $this->collFeatureCvtermprops = $collFeatureCvtermprops;
3153: $this->collFeatureCvtermpropsPartial = false;
3154: }
3155: }
3156:
3157: return $this->collFeatureCvtermprops;
3158: }
3159:
3160: 3161: 3162: 3163: 3164: 3165: 3166: 3167: 3168: 3169:
3170: public function setFeatureCvtermprops(PropelCollection $featureCvtermprops, PropelPDO $con = null)
3171: {
3172: $featureCvtermpropsToDelete = $this->getFeatureCvtermprops(new Criteria(), $con)->diff($featureCvtermprops);
3173:
3174: $this->featureCvtermpropsScheduledForDeletion = unserialize(serialize($featureCvtermpropsToDelete));
3175:
3176: foreach ($featureCvtermpropsToDelete as $featureCvtermpropRemoved) {
3177: $featureCvtermpropRemoved->setCvterm(null);
3178: }
3179:
3180: $this->collFeatureCvtermprops = null;
3181: foreach ($featureCvtermprops as $featureCvtermprop) {
3182: $this->addFeatureCvtermprop($featureCvtermprop);
3183: }
3184:
3185: $this->collFeatureCvtermprops = $featureCvtermprops;
3186: $this->collFeatureCvtermpropsPartial = false;
3187:
3188: return $this;
3189: }
3190:
3191: 3192: 3193: 3194: 3195: 3196: 3197: 3198: 3199:
3200: public function countFeatureCvtermprops(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
3201: {
3202: $partial = $this->collFeatureCvtermpropsPartial && !$this->isNew();
3203: if (null === $this->collFeatureCvtermprops || null !== $criteria || $partial) {
3204: if ($this->isNew() && null === $this->collFeatureCvtermprops) {
3205: return 0;
3206: }
3207:
3208: if($partial && !$criteria) {
3209: return count($this->getFeatureCvtermprops());
3210: }
3211: $query = FeatureCvtermpropQuery::create(null, $criteria);
3212: if ($distinct) {
3213: $query->distinct();
3214: }
3215:
3216: return $query
3217: ->filterByCvterm($this)
3218: ->count($con);
3219: }
3220:
3221: return count($this->collFeatureCvtermprops);
3222: }
3223:
3224: 3225: 3226: 3227: 3228: 3229: 3230:
3231: public function addFeatureCvtermprop(FeatureCvtermprop $l)
3232: {
3233: if ($this->collFeatureCvtermprops === null) {
3234: $this->initFeatureCvtermprops();
3235: $this->collFeatureCvtermpropsPartial = true;
3236: }
3237: if (!in_array($l, $this->collFeatureCvtermprops->getArrayCopy(), true)) {
3238: $this->doAddFeatureCvtermprop($l);
3239: }
3240:
3241: return $this;
3242: }
3243:
3244: 3245: 3246:
3247: protected function doAddFeatureCvtermprop($featureCvtermprop)
3248: {
3249: $this->collFeatureCvtermprops[]= $featureCvtermprop;
3250: $featureCvtermprop->setCvterm($this);
3251: }
3252:
3253: 3254: 3255: 3256:
3257: public function removeFeatureCvtermprop($featureCvtermprop)
3258: {
3259: if ($this->getFeatureCvtermprops()->contains($featureCvtermprop)) {
3260: $this->collFeatureCvtermprops->remove($this->collFeatureCvtermprops->search($featureCvtermprop));
3261: if (null === $this->featureCvtermpropsScheduledForDeletion) {
3262: $this->featureCvtermpropsScheduledForDeletion = clone $this->collFeatureCvtermprops;
3263: $this->featureCvtermpropsScheduledForDeletion->clear();
3264: }
3265: $this->featureCvtermpropsScheduledForDeletion[]= clone $featureCvtermprop;
3266: $featureCvtermprop->setCvterm(null);
3267: }
3268:
3269: return $this;
3270: }
3271:
3272:
3273: 3274: 3275: 3276: 3277: 3278: 3279: 3280: 3281: 3282: 3283: 3284: 3285: 3286: 3287: 3288:
3289: public function getFeatureCvtermpropsJoinFeatureCvterm($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
3290: {
3291: $query = FeatureCvtermpropQuery::create(null, $criteria);
3292: $query->joinWith('FeatureCvterm', $join_behavior);
3293:
3294: return $this->getFeatureCvtermprops($query, $con);
3295: }
3296:
3297: 3298: 3299: 3300: 3301: 3302: 3303: 3304: 3305:
3306: public function clearProtocols()
3307: {
3308: $this->collProtocols = null;
3309: $this->collProtocolsPartial = null;
3310:
3311: return $this;
3312: }
3313:
3314: 3315: 3316: 3317: 3318:
3319: public function resetPartialProtocols($v = true)
3320: {
3321: $this->collProtocolsPartial = $v;
3322: }
3323:
3324: 3325: 3326: 3327: 3328: 3329: 3330: 3331: 3332: 3333: 3334: 3335:
3336: public function initProtocols($overrideExisting = true)
3337: {
3338: if (null !== $this->collProtocols && !$overrideExisting) {
3339: return;
3340: }
3341: $this->collProtocols = new PropelObjectCollection();
3342: $this->collProtocols->setModel('Protocol');
3343: }
3344:
3345: 3346: 3347: 3348: 3349: 3350: 3351: 3352: 3353: 3354: 3355: 3356: 3357: 3358:
3359: public function getProtocols($criteria = null, PropelPDO $con = null)
3360: {
3361: $partial = $this->collProtocolsPartial && !$this->isNew();
3362: if (null === $this->collProtocols || null !== $criteria || $partial) {
3363: if ($this->isNew() && null === $this->collProtocols) {
3364:
3365: $this->initProtocols();
3366: } else {
3367: $collProtocols = ProtocolQuery::create(null, $criteria)
3368: ->filterByCvterm($this)
3369: ->find($con);
3370: if (null !== $criteria) {
3371: if (false !== $this->collProtocolsPartial && count($collProtocols)) {
3372: $this->initProtocols(false);
3373:
3374: foreach($collProtocols as $obj) {
3375: if (false == $this->collProtocols->contains($obj)) {
3376: $this->collProtocols->append($obj);
3377: }
3378: }
3379:
3380: $this->collProtocolsPartial = true;
3381: }
3382:
3383: $collProtocols->getInternalIterator()->rewind();
3384: return $collProtocols;
3385: }
3386:
3387: if($partial && $this->collProtocols) {
3388: foreach($this->collProtocols as $obj) {
3389: if($obj->isNew()) {
3390: $collProtocols[] = $obj;
3391: }
3392: }
3393: }
3394:
3395: $this->collProtocols = $collProtocols;
3396: $this->collProtocolsPartial = false;
3397: }
3398: }
3399:
3400: return $this->collProtocols;
3401: }
3402:
3403: 3404: 3405: 3406: 3407: 3408: 3409: 3410: 3411: 3412:
3413: public function setProtocols(PropelCollection $protocols, PropelPDO $con = null)
3414: {
3415: $protocolsToDelete = $this->getProtocols(new Criteria(), $con)->diff($protocols);
3416:
3417: $this->protocolsScheduledForDeletion = unserialize(serialize($protocolsToDelete));
3418:
3419: foreach ($protocolsToDelete as $protocolRemoved) {
3420: $protocolRemoved->setCvterm(null);
3421: }
3422:
3423: $this->collProtocols = null;
3424: foreach ($protocols as $protocol) {
3425: $this->addProtocol($protocol);
3426: }
3427:
3428: $this->collProtocols = $protocols;
3429: $this->collProtocolsPartial = false;
3430:
3431: return $this;
3432: }
3433:
3434: 3435: 3436: 3437: 3438: 3439: 3440: 3441: 3442:
3443: public function countProtocols(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
3444: {
3445: $partial = $this->collProtocolsPartial && !$this->isNew();
3446: if (null === $this->collProtocols || null !== $criteria || $partial) {
3447: if ($this->isNew() && null === $this->collProtocols) {
3448: return 0;
3449: }
3450:
3451: if($partial && !$criteria) {
3452: return count($this->getProtocols());
3453: }
3454: $query = ProtocolQuery::create(null, $criteria);
3455: if ($distinct) {
3456: $query->distinct();
3457: }
3458:
3459: return $query
3460: ->filterByCvterm($this)
3461: ->count($con);
3462: }
3463:
3464: return count($this->collProtocols);
3465: }
3466:
3467: 3468: 3469: 3470: 3471: 3472: 3473:
3474: public function addProtocol(Protocol $l)
3475: {
3476: if ($this->collProtocols === null) {
3477: $this->initProtocols();
3478: $this->collProtocolsPartial = true;
3479: }
3480: if (!in_array($l, $this->collProtocols->getArrayCopy(), true)) {
3481: $this->doAddProtocol($l);
3482: }
3483:
3484: return $this;
3485: }
3486:
3487: 3488: 3489:
3490: protected function doAddProtocol($protocol)
3491: {
3492: $this->collProtocols[]= $protocol;
3493: $protocol->setCvterm($this);
3494: }
3495:
3496: 3497: 3498: 3499:
3500: public function removeProtocol($protocol)
3501: {
3502: if ($this->getProtocols()->contains($protocol)) {
3503: $this->collProtocols->remove($this->collProtocols->search($protocol));
3504: if (null === $this->protocolsScheduledForDeletion) {
3505: $this->protocolsScheduledForDeletion = clone $this->collProtocols;
3506: $this->protocolsScheduledForDeletion->clear();
3507: }
3508: $this->protocolsScheduledForDeletion[]= clone $protocol;
3509: $protocol->setCvterm(null);
3510: }
3511:
3512: return $this;
3513: }
3514:
3515: 3516: 3517: 3518: 3519: 3520: 3521: 3522: 3523:
3524: public function clearPubs()
3525: {
3526: $this->collPubs = null;
3527: $this->collPubsPartial = null;
3528:
3529: return $this;
3530: }
3531:
3532: 3533: 3534: 3535: 3536:
3537: public function resetPartialPubs($v = true)
3538: {
3539: $this->collPubsPartial = $v;
3540: }
3541:
3542: 3543: 3544: 3545: 3546: 3547: 3548: 3549: 3550: 3551: 3552: 3553:
3554: public function initPubs($overrideExisting = true)
3555: {
3556: if (null !== $this->collPubs && !$overrideExisting) {
3557: return;
3558: }
3559: $this->collPubs = new PropelObjectCollection();
3560: $this->collPubs->setModel('Pub');
3561: }
3562:
3563: 3564: 3565: 3566: 3567: 3568: 3569: 3570: 3571: 3572: 3573: 3574: 3575: 3576:
3577: public function getPubs($criteria = null, PropelPDO $con = null)
3578: {
3579: $partial = $this->collPubsPartial && !$this->isNew();
3580: if (null === $this->collPubs || null !== $criteria || $partial) {
3581: if ($this->isNew() && null === $this->collPubs) {
3582:
3583: $this->initPubs();
3584: } else {
3585: $collPubs = PubQuery::create(null, $criteria)
3586: ->filterByCvterm($this)
3587: ->find($con);
3588: if (null !== $criteria) {
3589: if (false !== $this->collPubsPartial && count($collPubs)) {
3590: $this->initPubs(false);
3591:
3592: foreach($collPubs as $obj) {
3593: if (false == $this->collPubs->contains($obj)) {
3594: $this->collPubs->append($obj);
3595: }
3596: }
3597:
3598: $this->collPubsPartial = true;
3599: }
3600:
3601: $collPubs->getInternalIterator()->rewind();
3602: return $collPubs;
3603: }
3604:
3605: if($partial && $this->collPubs) {
3606: foreach($this->collPubs as $obj) {
3607: if($obj->isNew()) {
3608: $collPubs[] = $obj;
3609: }
3610: }
3611: }
3612:
3613: $this->collPubs = $collPubs;
3614: $this->collPubsPartial = false;
3615: }
3616: }
3617:
3618: return $this->collPubs;
3619: }
3620:
3621: 3622: 3623: 3624: 3625: 3626: 3627: 3628: 3629: 3630:
3631: public function setPubs(PropelCollection $pubs, PropelPDO $con = null)
3632: {
3633: $pubsToDelete = $this->getPubs(new Criteria(), $con)->diff($pubs);
3634:
3635: $this->pubsScheduledForDeletion = unserialize(serialize($pubsToDelete));
3636:
3637: foreach ($pubsToDelete as $pubRemoved) {
3638: $pubRemoved->setCvterm(null);
3639: }
3640:
3641: $this->collPubs = null;
3642: foreach ($pubs as $pub) {
3643: $this->addPub($pub);
3644: }
3645:
3646: $this->collPubs = $pubs;
3647: $this->collPubsPartial = false;
3648:
3649: return $this;
3650: }
3651:
3652: 3653: 3654: 3655: 3656: 3657: 3658: 3659: 3660:
3661: public function countPubs(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
3662: {
3663: $partial = $this->collPubsPartial && !$this->isNew();
3664: if (null === $this->collPubs || null !== $criteria || $partial) {
3665: if ($this->isNew() && null === $this->collPubs) {
3666: return 0;
3667: }
3668:
3669: if($partial && !$criteria) {
3670: return count($this->getPubs());
3671: }
3672: $query = PubQuery::create(null, $criteria);
3673: if ($distinct) {
3674: $query->distinct();
3675: }
3676:
3677: return $query
3678: ->filterByCvterm($this)
3679: ->count($con);
3680: }
3681:
3682: return count($this->collPubs);
3683: }
3684:
3685: 3686: 3687: 3688: 3689: 3690: 3691:
3692: public function addPub(Pub $l)
3693: {
3694: if ($this->collPubs === null) {
3695: $this->initPubs();
3696: $this->collPubsPartial = true;
3697: }
3698: if (!in_array($l, $this->collPubs->getArrayCopy(), true)) {
3699: $this->doAddPub($l);
3700: }
3701:
3702: return $this;
3703: }
3704:
3705: 3706: 3707:
3708: protected function doAddPub($pub)
3709: {
3710: $this->collPubs[]= $pub;
3711: $pub->setCvterm($this);
3712: }
3713:
3714: 3715: 3716: 3717:
3718: public function removePub($pub)
3719: {
3720: if ($this->getPubs()->contains($pub)) {
3721: $this->collPubs->remove($this->collPubs->search($pub));
3722: if (null === $this->pubsScheduledForDeletion) {
3723: $this->pubsScheduledForDeletion = clone $this->collPubs;
3724: $this->pubsScheduledForDeletion->clear();
3725: }
3726: $this->pubsScheduledForDeletion[]= clone $pub;
3727: $pub->setCvterm(null);
3728: }
3729:
3730: return $this;
3731: }
3732:
3733: 3734: 3735: 3736: 3737: 3738: 3739: 3740: 3741:
3742: public function clearPubRelationships()
3743: {
3744: $this->collPubRelationships = null;
3745: $this->collPubRelationshipsPartial = null;
3746:
3747: return $this;
3748: }
3749:
3750: 3751: 3752: 3753: 3754:
3755: public function resetPartialPubRelationships($v = true)
3756: {
3757: $this->collPubRelationshipsPartial = $v;
3758: }
3759:
3760: 3761: 3762: 3763: 3764: 3765: 3766: 3767: 3768: 3769: 3770: 3771:
3772: public function initPubRelationships($overrideExisting = true)
3773: {
3774: if (null !== $this->collPubRelationships && !$overrideExisting) {
3775: return;
3776: }
3777: $this->collPubRelationships = new PropelObjectCollection();
3778: $this->collPubRelationships->setModel('PubRelationship');
3779: }
3780:
3781: 3782: 3783: 3784: 3785: 3786: 3787: 3788: 3789: 3790: 3791: 3792: 3793: 3794:
3795: public function getPubRelationships($criteria = null, PropelPDO $con = null)
3796: {
3797: $partial = $this->collPubRelationshipsPartial && !$this->isNew();
3798: if (null === $this->collPubRelationships || null !== $criteria || $partial) {
3799: if ($this->isNew() && null === $this->collPubRelationships) {
3800:
3801: $this->initPubRelationships();
3802: } else {
3803: $collPubRelationships = PubRelationshipQuery::create(null, $criteria)
3804: ->filterByCvterm($this)
3805: ->find($con);
3806: if (null !== $criteria) {
3807: if (false !== $this->collPubRelationshipsPartial && count($collPubRelationships)) {
3808: $this->initPubRelationships(false);
3809:
3810: foreach($collPubRelationships as $obj) {
3811: if (false == $this->collPubRelationships->contains($obj)) {
3812: $this->collPubRelationships->append($obj);
3813: }
3814: }
3815:
3816: $this->collPubRelationshipsPartial = true;
3817: }
3818:
3819: $collPubRelationships->getInternalIterator()->rewind();
3820: return $collPubRelationships;
3821: }
3822:
3823: if($partial && $this->collPubRelationships) {
3824: foreach($this->collPubRelationships as $obj) {
3825: if($obj->isNew()) {
3826: $collPubRelationships[] = $obj;
3827: }
3828: }
3829: }
3830:
3831: $this->collPubRelationships = $collPubRelationships;
3832: $this->collPubRelationshipsPartial = false;
3833: }
3834: }
3835:
3836: return $this->collPubRelationships;
3837: }
3838:
3839: 3840: 3841: 3842: 3843: 3844: 3845: 3846: 3847: 3848:
3849: public function setPubRelationships(PropelCollection $pubRelationships, PropelPDO $con = null)
3850: {
3851: $pubRelationshipsToDelete = $this->getPubRelationships(new Criteria(), $con)->diff($pubRelationships);
3852:
3853: $this->pubRelationshipsScheduledForDeletion = unserialize(serialize($pubRelationshipsToDelete));
3854:
3855: foreach ($pubRelationshipsToDelete as $pubRelationshipRemoved) {
3856: $pubRelationshipRemoved->setCvterm(null);
3857: }
3858:
3859: $this->collPubRelationships = null;
3860: foreach ($pubRelationships as $pubRelationship) {
3861: $this->addPubRelationship($pubRelationship);
3862: }
3863:
3864: $this->collPubRelationships = $pubRelationships;
3865: $this->collPubRelationshipsPartial = false;
3866:
3867: return $this;
3868: }
3869:
3870: 3871: 3872: 3873: 3874: 3875: 3876: 3877: 3878:
3879: public function countPubRelationships(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
3880: {
3881: $partial = $this->collPubRelationshipsPartial && !$this->isNew();
3882: if (null === $this->collPubRelationships || null !== $criteria || $partial) {
3883: if ($this->isNew() && null === $this->collPubRelationships) {
3884: return 0;
3885: }
3886:
3887: if($partial && !$criteria) {
3888: return count($this->getPubRelationships());
3889: }
3890: $query = PubRelationshipQuery::create(null, $criteria);
3891: if ($distinct) {
3892: $query->distinct();
3893: }
3894:
3895: return $query
3896: ->filterByCvterm($this)
3897: ->count($con);
3898: }
3899:
3900: return count($this->collPubRelationships);
3901: }
3902:
3903: 3904: 3905: 3906: 3907: 3908: 3909:
3910: public function addPubRelationship(PubRelationship $l)
3911: {
3912: if ($this->collPubRelationships === null) {
3913: $this->initPubRelationships();
3914: $this->collPubRelationshipsPartial = true;
3915: }
3916: if (!in_array($l, $this->collPubRelationships->getArrayCopy(), true)) {
3917: $this->doAddPubRelationship($l);
3918: }
3919:
3920: return $this;
3921: }
3922:
3923: 3924: 3925:
3926: protected function doAddPubRelationship($pubRelationship)
3927: {
3928: $this->collPubRelationships[]= $pubRelationship;
3929: $pubRelationship->setCvterm($this);
3930: }
3931:
3932: 3933: 3934: 3935:
3936: public function removePubRelationship($pubRelationship)
3937: {
3938: if ($this->getPubRelationships()->contains($pubRelationship)) {
3939: $this->collPubRelationships->remove($this->collPubRelationships->search($pubRelationship));
3940: if (null === $this->pubRelationshipsScheduledForDeletion) {
3941: $this->pubRelationshipsScheduledForDeletion = clone $this->collPubRelationships;
3942: $this->pubRelationshipsScheduledForDeletion->clear();
3943: }
3944: $this->pubRelationshipsScheduledForDeletion[]= clone $pubRelationship;
3945: $pubRelationship->setCvterm(null);
3946: }
3947:
3948: return $this;
3949: }
3950:
3951:
3952: 3953: 3954: 3955: 3956: 3957: 3958: 3959: 3960: 3961: 3962: 3963: 3964: 3965: 3966: 3967:
3968: public function getPubRelationshipsJoinPubRelatedByObjectId($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
3969: {
3970: $query = PubRelationshipQuery::create(null, $criteria);
3971: $query->joinWith('PubRelatedByObjectId', $join_behavior);
3972:
3973: return $this->getPubRelationships($query, $con);
3974: }
3975:
3976:
3977: 3978: 3979: 3980: 3981: 3982: 3983: 3984: 3985: 3986: 3987: 3988: 3989: 3990: 3991: 3992:
3993: public function getPubRelationshipsJoinPubRelatedBySubjectId($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
3994: {
3995: $query = PubRelationshipQuery::create(null, $criteria);
3996: $query->joinWith('PubRelatedBySubjectId', $join_behavior);
3997:
3998: return $this->getPubRelationships($query, $con);
3999: }
4000:
4001: 4002: 4003: 4004: 4005: 4006: 4007: 4008: 4009:
4010: public function clearPubprops()
4011: {
4012: $this->collPubprops = null;
4013: $this->collPubpropsPartial = null;
4014:
4015: return $this;
4016: }
4017:
4018: 4019: 4020: 4021: 4022:
4023: public function resetPartialPubprops($v = true)
4024: {
4025: $this->collPubpropsPartial = $v;
4026: }
4027:
4028: 4029: 4030: 4031: 4032: 4033: 4034: 4035: 4036: 4037: 4038: 4039:
4040: public function initPubprops($overrideExisting = true)
4041: {
4042: if (null !== $this->collPubprops && !$overrideExisting) {
4043: return;
4044: }
4045: $this->collPubprops = new PropelObjectCollection();
4046: $this->collPubprops->setModel('Pubprop');
4047: }
4048:
4049: 4050: 4051: 4052: 4053: 4054: 4055: 4056: 4057: 4058: 4059: 4060: 4061: 4062:
4063: public function getPubprops($criteria = null, PropelPDO $con = null)
4064: {
4065: $partial = $this->collPubpropsPartial && !$this->isNew();
4066: if (null === $this->collPubprops || null !== $criteria || $partial) {
4067: if ($this->isNew() && null === $this->collPubprops) {
4068:
4069: $this->initPubprops();
4070: } else {
4071: $collPubprops = PubpropQuery::create(null, $criteria)
4072: ->filterByCvterm($this)
4073: ->find($con);
4074: if (null !== $criteria) {
4075: if (false !== $this->collPubpropsPartial && count($collPubprops)) {
4076: $this->initPubprops(false);
4077:
4078: foreach($collPubprops as $obj) {
4079: if (false == $this->collPubprops->contains($obj)) {
4080: $this->collPubprops->append($obj);
4081: }
4082: }
4083:
4084: $this->collPubpropsPartial = true;
4085: }
4086:
4087: $collPubprops->getInternalIterator()->rewind();
4088: return $collPubprops;
4089: }
4090:
4091: if($partial && $this->collPubprops) {
4092: foreach($this->collPubprops as $obj) {
4093: if($obj->isNew()) {
4094: $collPubprops[] = $obj;
4095: }
4096: }
4097: }
4098:
4099: $this->collPubprops = $collPubprops;
4100: $this->collPubpropsPartial = false;
4101: }
4102: }
4103:
4104: return $this->collPubprops;
4105: }
4106:
4107: 4108: 4109: 4110: 4111: 4112: 4113: 4114: 4115: 4116:
4117: public function setPubprops(PropelCollection $pubprops, PropelPDO $con = null)
4118: {
4119: $pubpropsToDelete = $this->getPubprops(new Criteria(), $con)->diff($pubprops);
4120:
4121: $this->pubpropsScheduledForDeletion = unserialize(serialize($pubpropsToDelete));
4122:
4123: foreach ($pubpropsToDelete as $pubpropRemoved) {
4124: $pubpropRemoved->setCvterm(null);
4125: }
4126:
4127: $this->collPubprops = null;
4128: foreach ($pubprops as $pubprop) {
4129: $this->addPubprop($pubprop);
4130: }
4131:
4132: $this->collPubprops = $pubprops;
4133: $this->collPubpropsPartial = false;
4134:
4135: return $this;
4136: }
4137:
4138: 4139: 4140: 4141: 4142: 4143: 4144: 4145: 4146:
4147: public function countPubprops(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
4148: {
4149: $partial = $this->collPubpropsPartial && !$this->isNew();
4150: if (null === $this->collPubprops || null !== $criteria || $partial) {
4151: if ($this->isNew() && null === $this->collPubprops) {
4152: return 0;
4153: }
4154:
4155: if($partial && !$criteria) {
4156: return count($this->getPubprops());
4157: }
4158: $query = PubpropQuery::create(null, $criteria);
4159: if ($distinct) {
4160: $query->distinct();
4161: }
4162:
4163: return $query
4164: ->filterByCvterm($this)
4165: ->count($con);
4166: }
4167:
4168: return count($this->collPubprops);
4169: }
4170:
4171: 4172: 4173: 4174: 4175: 4176: 4177:
4178: public function addPubprop(Pubprop $l)
4179: {
4180: if ($this->collPubprops === null) {
4181: $this->initPubprops();
4182: $this->collPubpropsPartial = true;
4183: }
4184: if (!in_array($l, $this->collPubprops->getArrayCopy(), true)) {
4185: $this->doAddPubprop($l);
4186: }
4187:
4188: return $this;
4189: }
4190:
4191: 4192: 4193:
4194: protected function doAddPubprop($pubprop)
4195: {
4196: $this->collPubprops[]= $pubprop;
4197: $pubprop->setCvterm($this);
4198: }
4199:
4200: 4201: 4202: 4203:
4204: public function removePubprop($pubprop)
4205: {
4206: if ($this->getPubprops()->contains($pubprop)) {
4207: $this->collPubprops->remove($this->collPubprops->search($pubprop));
4208: if (null === $this->pubpropsScheduledForDeletion) {
4209: $this->pubpropsScheduledForDeletion = clone $this->collPubprops;
4210: $this->pubpropsScheduledForDeletion->clear();
4211: }
4212: $this->pubpropsScheduledForDeletion[]= clone $pubprop;
4213: $pubprop->setCvterm(null);
4214: }
4215:
4216: return $this;
4217: }
4218:
4219:
4220: 4221: 4222: 4223: 4224: 4225: 4226: 4227: 4228: 4229: 4230: 4231: 4232: 4233: 4234: 4235:
4236: public function getPubpropsJoinPub($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
4237: {
4238: $query = PubpropQuery::create(null, $criteria);
4239: $query->joinWith('Pub', $join_behavior);
4240:
4241: return $this->getPubprops($query, $con);
4242: }
4243:
4244: 4245: 4246: 4247: 4248: 4249: 4250: 4251: 4252:
4253: public function clearSynonyms()
4254: {
4255: $this->collSynonyms = null;
4256: $this->collSynonymsPartial = null;
4257:
4258: return $this;
4259: }
4260:
4261: 4262: 4263: 4264: 4265:
4266: public function resetPartialSynonyms($v = true)
4267: {
4268: $this->collSynonymsPartial = $v;
4269: }
4270:
4271: 4272: 4273: 4274: 4275: 4276: 4277: 4278: 4279: 4280: 4281: 4282:
4283: public function initSynonyms($overrideExisting = true)
4284: {
4285: if (null !== $this->collSynonyms && !$overrideExisting) {
4286: return;
4287: }
4288: $this->collSynonyms = new PropelObjectCollection();
4289: $this->collSynonyms->setModel('Synonym');
4290: }
4291:
4292: 4293: 4294: 4295: 4296: 4297: 4298: 4299: 4300: 4301: 4302: 4303: 4304: 4305:
4306: public function getSynonyms($criteria = null, PropelPDO $con = null)
4307: {
4308: $partial = $this->collSynonymsPartial && !$this->isNew();
4309: if (null === $this->collSynonyms || null !== $criteria || $partial) {
4310: if ($this->isNew() && null === $this->collSynonyms) {
4311:
4312: $this->initSynonyms();
4313: } else {
4314: $collSynonyms = SynonymQuery::create(null, $criteria)
4315: ->filterByCvterm($this)
4316: ->find($con);
4317: if (null !== $criteria) {
4318: if (false !== $this->collSynonymsPartial && count($collSynonyms)) {
4319: $this->initSynonyms(false);
4320:
4321: foreach($collSynonyms as $obj) {
4322: if (false == $this->collSynonyms->contains($obj)) {
4323: $this->collSynonyms->append($obj);
4324: }
4325: }
4326:
4327: $this->collSynonymsPartial = true;
4328: }
4329:
4330: $collSynonyms->getInternalIterator()->rewind();
4331: return $collSynonyms;
4332: }
4333:
4334: if($partial && $this->collSynonyms) {
4335: foreach($this->collSynonyms as $obj) {
4336: if($obj->isNew()) {
4337: $collSynonyms[] = $obj;
4338: }
4339: }
4340: }
4341:
4342: $this->collSynonyms = $collSynonyms;
4343: $this->collSynonymsPartial = false;
4344: }
4345: }
4346:
4347: return $this->collSynonyms;
4348: }
4349:
4350: 4351: 4352: 4353: 4354: 4355: 4356: 4357: 4358: 4359:
4360: public function setSynonyms(PropelCollection $synonyms, PropelPDO $con = null)
4361: {
4362: $synonymsToDelete = $this->getSynonyms(new Criteria(), $con)->diff($synonyms);
4363:
4364: $this->synonymsScheduledForDeletion = unserialize(serialize($synonymsToDelete));
4365:
4366: foreach ($synonymsToDelete as $synonymRemoved) {
4367: $synonymRemoved->setCvterm(null);
4368: }
4369:
4370: $this->collSynonyms = null;
4371: foreach ($synonyms as $synonym) {
4372: $this->addSynonym($synonym);
4373: }
4374:
4375: $this->collSynonyms = $synonyms;
4376: $this->collSynonymsPartial = false;
4377:
4378: return $this;
4379: }
4380:
4381: 4382: 4383: 4384: 4385: 4386: 4387: 4388: 4389:
4390: public function countSynonyms(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
4391: {
4392: $partial = $this->collSynonymsPartial && !$this->isNew();
4393: if (null === $this->collSynonyms || null !== $criteria || $partial) {
4394: if ($this->isNew() && null === $this->collSynonyms) {
4395: return 0;
4396: }
4397:
4398: if($partial && !$criteria) {
4399: return count($this->getSynonyms());
4400: }
4401: $query = SynonymQuery::create(null, $criteria);
4402: if ($distinct) {
4403: $query->distinct();
4404: }
4405:
4406: return $query
4407: ->filterByCvterm($this)
4408: ->count($con);
4409: }
4410:
4411: return count($this->collSynonyms);
4412: }
4413:
4414: 4415: 4416: 4417: 4418: 4419: 4420:
4421: public function addSynonym(Synonym $l)
4422: {
4423: if ($this->collSynonyms === null) {
4424: $this->initSynonyms();
4425: $this->collSynonymsPartial = true;
4426: }
4427: if (!in_array($l, $this->collSynonyms->getArrayCopy(), true)) {
4428: $this->doAddSynonym($l);
4429: }
4430:
4431: return $this;
4432: }
4433:
4434: 4435: 4436:
4437: protected function doAddSynonym($synonym)
4438: {
4439: $this->collSynonyms[]= $synonym;
4440: $synonym->setCvterm($this);
4441: }
4442:
4443: 4444: 4445: 4446:
4447: public function removeSynonym($synonym)
4448: {
4449: if ($this->getSynonyms()->contains($synonym)) {
4450: $this->collSynonyms->remove($this->collSynonyms->search($synonym));
4451: if (null === $this->synonymsScheduledForDeletion) {
4452: $this->synonymsScheduledForDeletion = clone $this->collSynonyms;
4453: $this->synonymsScheduledForDeletion->clear();
4454: }
4455: $this->synonymsScheduledForDeletion[]= clone $synonym;
4456: $synonym->setCvterm(null);
4457: }
4458:
4459: return $this;
4460: }
4461:
4462: 4463: 4464:
4465: public function clear()
4466: {
4467: $this->cvterm_id = null;
4468: $this->cv_id = null;
4469: $this->name = null;
4470: $this->definition = null;
4471: $this->dbxref_id = null;
4472: $this->is_obsolete = null;
4473: $this->is_relationshiptype = null;
4474: $this->alreadyInSave = false;
4475: $this->alreadyInValidation = false;
4476: $this->alreadyInClearAllReferencesDeep = false;
4477: $this->clearAllReferences();
4478: $this->applyDefaultValues();
4479: $this->resetModified();
4480: $this->setNew(true);
4481: $this->setDeleted(false);
4482: }
4483:
4484: 4485: 4486: 4487: 4488: 4489: 4490: 4491: 4492:
4493: public function clearAllReferences($deep = false)
4494: {
4495: if ($deep && !$this->alreadyInClearAllReferencesDeep) {
4496: $this->alreadyInClearAllReferencesDeep = true;
4497: if ($this->collBiomaterialRelationships) {
4498: foreach ($this->collBiomaterialRelationships as $o) {
4499: $o->clearAllReferences($deep);
4500: }
4501: }
4502: if ($this->collBiomaterialprops) {
4503: foreach ($this->collBiomaterialprops as $o) {
4504: $o->clearAllReferences($deep);
4505: }
4506: }
4507: if ($this->collContacts) {
4508: foreach ($this->collContacts as $o) {
4509: $o->clearAllReferences($deep);
4510: }
4511: }
4512: if ($this->collFeatures) {
4513: foreach ($this->collFeatures as $o) {
4514: $o->clearAllReferences($deep);
4515: }
4516: }
4517: if ($this->collFeatureCvterms) {
4518: foreach ($this->collFeatureCvterms as $o) {
4519: $o->clearAllReferences($deep);
4520: }
4521: }
4522: if ($this->collFeatureCvtermprops) {
4523: foreach ($this->collFeatureCvtermprops as $o) {
4524: $o->clearAllReferences($deep);
4525: }
4526: }
4527: if ($this->collProtocols) {
4528: foreach ($this->collProtocols as $o) {
4529: $o->clearAllReferences($deep);
4530: }
4531: }
4532: if ($this->collPubs) {
4533: foreach ($this->collPubs as $o) {
4534: $o->clearAllReferences($deep);
4535: }
4536: }
4537: if ($this->collPubRelationships) {
4538: foreach ($this->collPubRelationships as $o) {
4539: $o->clearAllReferences($deep);
4540: }
4541: }
4542: if ($this->collPubprops) {
4543: foreach ($this->collPubprops as $o) {
4544: $o->clearAllReferences($deep);
4545: }
4546: }
4547: if ($this->collSynonyms) {
4548: foreach ($this->collSynonyms as $o) {
4549: $o->clearAllReferences($deep);
4550: }
4551: }
4552: if ($this->aCv instanceof Persistent) {
4553: $this->aCv->clearAllReferences($deep);
4554: }
4555:
4556: $this->alreadyInClearAllReferencesDeep = false;
4557: }
4558:
4559: if ($this->collBiomaterialRelationships instanceof PropelCollection) {
4560: $this->collBiomaterialRelationships->clearIterator();
4561: }
4562: $this->collBiomaterialRelationships = null;
4563: if ($this->collBiomaterialprops instanceof PropelCollection) {
4564: $this->collBiomaterialprops->clearIterator();
4565: }
4566: $this->collBiomaterialprops = null;
4567: if ($this->collContacts instanceof PropelCollection) {
4568: $this->collContacts->clearIterator();
4569: }
4570: $this->collContacts = null;
4571: if ($this->collFeatures instanceof PropelCollection) {
4572: $this->collFeatures->clearIterator();
4573: }
4574: $this->collFeatures = null;
4575: if ($this->collFeatureCvterms instanceof PropelCollection) {
4576: $this->collFeatureCvterms->clearIterator();
4577: }
4578: $this->collFeatureCvterms = null;
4579: if ($this->collFeatureCvtermprops instanceof PropelCollection) {
4580: $this->collFeatureCvtermprops->clearIterator();
4581: }
4582: $this->collFeatureCvtermprops = null;
4583: if ($this->collProtocols instanceof PropelCollection) {
4584: $this->collProtocols->clearIterator();
4585: }
4586: $this->collProtocols = null;
4587: if ($this->collPubs instanceof PropelCollection) {
4588: $this->collPubs->clearIterator();
4589: }
4590: $this->collPubs = null;
4591: if ($this->collPubRelationships instanceof PropelCollection) {
4592: $this->collPubRelationships->clearIterator();
4593: }
4594: $this->collPubRelationships = null;
4595: if ($this->collPubprops instanceof PropelCollection) {
4596: $this->collPubprops->clearIterator();
4597: }
4598: $this->collPubprops = null;
4599: if ($this->collSynonyms instanceof PropelCollection) {
4600: $this->collSynonyms->clearIterator();
4601: }
4602: $this->collSynonyms = null;
4603: $this->aCv = null;
4604: }
4605:
4606: 4607: 4608: 4609: 4610:
4611: public function __toString()
4612: {
4613: return (string) $this->exportTo(CvtermPeer::DEFAULT_STRING_FORMAT);
4614: }
4615:
4616: 4617: 4618: 4619: 4620:
4621: public function isAlreadyInSave()
4622: {
4623: return $this->alreadyInSave;
4624: }
4625:
4626: }
4627: