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