1: <?php
2:
3: namespace cli_db\propel\om;
4:
5: use \BasePeer;
6: use \Criteria;
7: use \PDO;
8: use \PDOStatement;
9: use \Propel;
10: use \PropelException;
11: use \PropelPDO;
12: use cli_db\propel\CvtermPeer;
13: use cli_db\propel\PubPeer;
14: use cli_db\propel\PubRelationship;
15: use cli_db\propel\PubRelationshipPeer;
16: use cli_db\propel\map\PubRelationshipTableMap;
17:
18: 19: 20: 21: 22: 23: 24:
25: abstract class BasePubRelationshipPeer
26: {
27:
28:
29: const DATABASE_NAME = 'cli_db';
30:
31:
32: const TABLE_NAME = 'pub_relationship';
33:
34:
35: const OM_CLASS = 'cli_db\\propel\\PubRelationship';
36:
37:
38: const TM_CLASS = 'PubRelationshipTableMap';
39:
40:
41: const NUM_COLUMNS = 4;
42:
43:
44: const NUM_LAZY_LOAD_COLUMNS = 0;
45:
46:
47: const NUM_HYDRATE_COLUMNS = 4;
48:
49:
50: const PUB_RELATIONSHIP_ID = 'pub_relationship.pub_relationship_id';
51:
52:
53: const SUBJECT_ID = 'pub_relationship.subject_id';
54:
55:
56: const OBJECT_ID = 'pub_relationship.object_id';
57:
58:
59: const TYPE_ID = 'pub_relationship.type_id';
60:
61:
62: const DEFAULT_STRING_FORMAT = 'YAML';
63:
64: 65: 66: 67: 68: 69:
70: public static $instances = array();
71:
72:
73: 74: 75: 76: 77: 78:
79: protected static $fieldNames = array (
80: BasePeer::TYPE_PHPNAME => array ('PubRelationshipId', 'SubjectId', 'ObjectId', 'TypeId', ),
81: BasePeer::TYPE_STUDLYPHPNAME => array ('pubRelationshipId', 'subjectId', 'objectId', 'typeId', ),
82: BasePeer::TYPE_COLNAME => array (PubRelationshipPeer::PUB_RELATIONSHIP_ID, PubRelationshipPeer::SUBJECT_ID, PubRelationshipPeer::OBJECT_ID, PubRelationshipPeer::TYPE_ID, ),
83: BasePeer::TYPE_RAW_COLNAME => array ('PUB_RELATIONSHIP_ID', 'SUBJECT_ID', 'OBJECT_ID', 'TYPE_ID', ),
84: BasePeer::TYPE_FIELDNAME => array ('pub_relationship_id', 'subject_id', 'object_id', 'type_id', ),
85: BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
86: );
87:
88: 89: 90: 91: 92: 93:
94: protected static $fieldKeys = array (
95: BasePeer::TYPE_PHPNAME => array ('PubRelationshipId' => 0, 'SubjectId' => 1, 'ObjectId' => 2, 'TypeId' => 3, ),
96: BasePeer::TYPE_STUDLYPHPNAME => array ('pubRelationshipId' => 0, 'subjectId' => 1, 'objectId' => 2, 'typeId' => 3, ),
97: BasePeer::TYPE_COLNAME => array (PubRelationshipPeer::PUB_RELATIONSHIP_ID => 0, PubRelationshipPeer::SUBJECT_ID => 1, PubRelationshipPeer::OBJECT_ID => 2, PubRelationshipPeer::TYPE_ID => 3, ),
98: BasePeer::TYPE_RAW_COLNAME => array ('PUB_RELATIONSHIP_ID' => 0, 'SUBJECT_ID' => 1, 'OBJECT_ID' => 2, 'TYPE_ID' => 3, ),
99: BasePeer::TYPE_FIELDNAME => array ('pub_relationship_id' => 0, 'subject_id' => 1, 'object_id' => 2, 'type_id' => 3, ),
100: BasePeer::TYPE_NUM => array (0, 1, 2, 3, )
101: );
102:
103: 104: 105: 106: 107: 108: 109: 110: 111: 112:
113: public static function translateFieldName($name, $fromType, $toType)
114: {
115: $toNames = PubRelationshipPeer::getFieldNames($toType);
116: $key = isset(PubRelationshipPeer::$fieldKeys[$fromType][$name]) ? PubRelationshipPeer::$fieldKeys[$fromType][$name] : null;
117: if ($key === null) {
118: throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(PubRelationshipPeer::$fieldKeys[$fromType], true));
119: }
120:
121: return $toNames[$key];
122: }
123:
124: 125: 126: 127: 128: 129: 130: 131: 132:
133: public static function getFieldNames($type = BasePeer::TYPE_PHPNAME)
134: {
135: if (!array_key_exists($type, PubRelationshipPeer::$fieldNames)) {
136: throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. ' . $type . ' was given.');
137: }
138:
139: return PubRelationshipPeer::$fieldNames[$type];
140: }
141:
142: 143: 144: 145: 146: 147: 148: 149: 150: 151: 152: 153:
154: public static function alias($alias, $column)
155: {
156: return str_replace(PubRelationshipPeer::TABLE_NAME.'.', $alias.'.', $column);
157: }
158:
159: 160: 161: 162: 163: 164: 165: 166: 167: 168: 169: 170:
171: public static function addSelectColumns(Criteria $criteria, $alias = null)
172: {
173: if (null === $alias) {
174: $criteria->addSelectColumn(PubRelationshipPeer::PUB_RELATIONSHIP_ID);
175: $criteria->addSelectColumn(PubRelationshipPeer::SUBJECT_ID);
176: $criteria->addSelectColumn(PubRelationshipPeer::OBJECT_ID);
177: $criteria->addSelectColumn(PubRelationshipPeer::TYPE_ID);
178: } else {
179: $criteria->addSelectColumn($alias . '.pub_relationship_id');
180: $criteria->addSelectColumn($alias . '.subject_id');
181: $criteria->addSelectColumn($alias . '.object_id');
182: $criteria->addSelectColumn($alias . '.type_id');
183: }
184: }
185:
186: 187: 188: 189: 190: 191: 192: 193:
194: public static function doCount(Criteria $criteria, $distinct = false, PropelPDO $con = null)
195: {
196:
197: $criteria = clone $criteria;
198:
199:
200:
201:
202: $criteria->setPrimaryTableName(PubRelationshipPeer::TABLE_NAME);
203:
204: if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
205: $criteria->setDistinct();
206: }
207:
208: if (!$criteria->hasSelectClause()) {
209: PubRelationshipPeer::addSelectColumns($criteria);
210: }
211:
212: $criteria->clearOrderByColumns();
213: $criteria->setDbName(PubRelationshipPeer::DATABASE_NAME);
214:
215: if ($con === null) {
216: $con = Propel::getConnection(PubRelationshipPeer::DATABASE_NAME, Propel::CONNECTION_READ);
217: }
218:
219: $stmt = BasePeer::doCount($criteria, $con);
220:
221: if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
222: $count = (int) $row[0];
223: } else {
224: $count = 0;
225: }
226: $stmt->closeCursor();
227:
228: return $count;
229: }
230: 231: 232: 233: 234: 235: 236: 237: 238:
239: public static function doSelectOne(Criteria $criteria, PropelPDO $con = null)
240: {
241: $critcopy = clone $criteria;
242: $critcopy->setLimit(1);
243: $objects = PubRelationshipPeer::doSelect($critcopy, $con);
244: if ($objects) {
245: return $objects[0];
246: }
247:
248: return null;
249: }
250: 251: 252: 253: 254: 255: 256: 257: 258:
259: public static function doSelect(Criteria $criteria, PropelPDO $con = null)
260: {
261: return PubRelationshipPeer::populateObjects(PubRelationshipPeer::doSelectStmt($criteria, $con));
262: }
263: 264: 265: 266: 267: 268: 269: 270: 271: 272: 273: 274: 275:
276: public static function doSelectStmt(Criteria $criteria, PropelPDO $con = null)
277: {
278: if ($con === null) {
279: $con = Propel::getConnection(PubRelationshipPeer::DATABASE_NAME, Propel::CONNECTION_READ);
280: }
281:
282: if (!$criteria->hasSelectClause()) {
283: $criteria = clone $criteria;
284: PubRelationshipPeer::addSelectColumns($criteria);
285: }
286:
287:
288: $criteria->setDbName(PubRelationshipPeer::DATABASE_NAME);
289:
290:
291: return BasePeer::doSelect($criteria, $con);
292: }
293: 294: 295: 296: 297: 298: 299: 300: 301: 302: 303: 304:
305: public static function addInstanceToPool($obj, $key = null)
306: {
307: if (Propel::isInstancePoolingEnabled()) {
308: if ($key === null) {
309: $key = (string) $obj->getPubRelationshipId();
310: }
311: PubRelationshipPeer::$instances[$key] = $obj;
312: }
313: }
314:
315: 316: 317: 318: 319: 320: 321: 322: 323: 324: 325: 326: 327:
328: public static function removeInstanceFromPool($value)
329: {
330: if (Propel::isInstancePoolingEnabled() && $value !== null) {
331: if (is_object($value) && $value instanceof PubRelationship) {
332: $key = (string) $value->getPubRelationshipId();
333: } elseif (is_scalar($value)) {
334:
335: $key = (string) $value;
336: } else {
337: $e = new PropelException("Invalid value passed to removeInstanceFromPool(). Expected primary key or PubRelationship object; got " . (is_object($value) ? get_class($value) . ' object.' : var_export($value,true)));
338: throw $e;
339: }
340:
341: unset(PubRelationshipPeer::$instances[$key]);
342: }
343: }
344:
345: 346: 347: 348: 349: 350: 351: 352: 353: 354:
355: public static function getInstanceFromPool($key)
356: {
357: if (Propel::isInstancePoolingEnabled()) {
358: if (isset(PubRelationshipPeer::$instances[$key])) {
359: return PubRelationshipPeer::$instances[$key];
360: }
361: }
362:
363: return null;
364: }
365:
366: 367: 368: 369: 370:
371: public static function clearInstancePool($and_clear_all_references = false)
372: {
373: if ($and_clear_all_references)
374: {
375: foreach (PubRelationshipPeer::$instances as $instance)
376: {
377: $instance->clearAllReferences(true);
378: }
379: }
380: PubRelationshipPeer::$instances = array();
381: }
382:
383: 384: 385: 386:
387: public static function clearRelatedInstancePool()
388: {
389: }
390:
391: 392: 393: 394: 395: 396: 397: 398: 399: 400:
401: public static function getPrimaryKeyHashFromRow($row, $startcol = 0)
402: {
403:
404: if ($row[$startcol] === null) {
405: return null;
406: }
407:
408: return (string) $row[$startcol];
409: }
410:
411: 412: 413: 414: 415: 416: 417: 418: 419:
420: public static function getPrimaryKeyFromRow($row, $startcol = 0)
421: {
422:
423: return (int) $row[$startcol];
424: }
425:
426: 427: 428: 429: 430: 431: 432:
433: public static function populateObjects(PDOStatement $stmt)
434: {
435: $results = array();
436:
437:
438: $cls = PubRelationshipPeer::getOMClass();
439:
440: while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
441: $key = PubRelationshipPeer::getPrimaryKeyHashFromRow($row, 0);
442: if (null !== ($obj = PubRelationshipPeer::getInstanceFromPool($key))) {
443:
444:
445:
446: $results[] = $obj;
447: } else {
448: $obj = new $cls();
449: $obj->hydrate($row);
450: $results[] = $obj;
451: PubRelationshipPeer::addInstanceToPool($obj, $key);
452: }
453: }
454: $stmt->closeCursor();
455:
456: return $results;
457: }
458: 459: 460: 461: 462: 463: 464: 465: 466:
467: public static function populateObject($row, $startcol = 0)
468: {
469: $key = PubRelationshipPeer::getPrimaryKeyHashFromRow($row, $startcol);
470: if (null !== ($obj = PubRelationshipPeer::getInstanceFromPool($key))) {
471:
472:
473:
474: $col = $startcol + PubRelationshipPeer::NUM_HYDRATE_COLUMNS;
475: } else {
476: $cls = PubRelationshipPeer::OM_CLASS;
477: $obj = new $cls();
478: $col = $obj->hydrate($row, $startcol);
479: PubRelationshipPeer::addInstanceToPool($obj, $key);
480: }
481:
482: return array($obj, $col);
483: }
484:
485:
486: 487: 488: 489: 490: 491: 492: 493: 494:
495: public static function doCountJoinPubRelatedByObjectId(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)
496: {
497:
498: $criteria = clone $criteria;
499:
500:
501:
502:
503: $criteria->setPrimaryTableName(PubRelationshipPeer::TABLE_NAME);
504:
505: if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
506: $criteria->setDistinct();
507: }
508:
509: if (!$criteria->hasSelectClause()) {
510: PubRelationshipPeer::addSelectColumns($criteria);
511: }
512:
513: $criteria->clearOrderByColumns();
514:
515:
516: $criteria->setDbName(PubRelationshipPeer::DATABASE_NAME);
517:
518: if ($con === null) {
519: $con = Propel::getConnection(PubRelationshipPeer::DATABASE_NAME, Propel::CONNECTION_READ);
520: }
521:
522: $criteria->addJoin(PubRelationshipPeer::OBJECT_ID, PubPeer::PUB_ID, $join_behavior);
523:
524: $stmt = BasePeer::doCount($criteria, $con);
525:
526: if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
527: $count = (int) $row[0];
528: } else {
529: $count = 0;
530: }
531: $stmt->closeCursor();
532:
533: return $count;
534: }
535:
536:
537: 538: 539: 540: 541: 542: 543: 544: 545:
546: public static function doCountJoinPubRelatedBySubjectId(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)
547: {
548:
549: $criteria = clone $criteria;
550:
551:
552:
553:
554: $criteria->setPrimaryTableName(PubRelationshipPeer::TABLE_NAME);
555:
556: if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
557: $criteria->setDistinct();
558: }
559:
560: if (!$criteria->hasSelectClause()) {
561: PubRelationshipPeer::addSelectColumns($criteria);
562: }
563:
564: $criteria->clearOrderByColumns();
565:
566:
567: $criteria->setDbName(PubRelationshipPeer::DATABASE_NAME);
568:
569: if ($con === null) {
570: $con = Propel::getConnection(PubRelationshipPeer::DATABASE_NAME, Propel::CONNECTION_READ);
571: }
572:
573: $criteria->addJoin(PubRelationshipPeer::SUBJECT_ID, PubPeer::PUB_ID, $join_behavior);
574:
575: $stmt = BasePeer::doCount($criteria, $con);
576:
577: if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
578: $count = (int) $row[0];
579: } else {
580: $count = 0;
581: }
582: $stmt->closeCursor();
583:
584: return $count;
585: }
586:
587:
588: 589: 590: 591: 592: 593: 594: 595: 596:
597: public static function doCountJoinCvterm(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)
598: {
599:
600: $criteria = clone $criteria;
601:
602:
603:
604:
605: $criteria->setPrimaryTableName(PubRelationshipPeer::TABLE_NAME);
606:
607: if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
608: $criteria->setDistinct();
609: }
610:
611: if (!$criteria->hasSelectClause()) {
612: PubRelationshipPeer::addSelectColumns($criteria);
613: }
614:
615: $criteria->clearOrderByColumns();
616:
617:
618: $criteria->setDbName(PubRelationshipPeer::DATABASE_NAME);
619:
620: if ($con === null) {
621: $con = Propel::getConnection(PubRelationshipPeer::DATABASE_NAME, Propel::CONNECTION_READ);
622: }
623:
624: $criteria->addJoin(PubRelationshipPeer::TYPE_ID, CvtermPeer::CVTERM_ID, $join_behavior);
625:
626: $stmt = BasePeer::doCount($criteria, $con);
627:
628: if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
629: $count = (int) $row[0];
630: } else {
631: $count = 0;
632: }
633: $stmt->closeCursor();
634:
635: return $count;
636: }
637:
638:
639: 640: 641: 642: 643: 644: 645: 646: 647:
648: public static function doSelectJoinPubRelatedByObjectId(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
649: {
650: $criteria = clone $criteria;
651:
652:
653: if ($criteria->getDbName() == Propel::getDefaultDB()) {
654: $criteria->setDbName(PubRelationshipPeer::DATABASE_NAME);
655: }
656:
657: PubRelationshipPeer::addSelectColumns($criteria);
658: $startcol = PubRelationshipPeer::NUM_HYDRATE_COLUMNS;
659: PubPeer::addSelectColumns($criteria);
660:
661: $criteria->addJoin(PubRelationshipPeer::OBJECT_ID, PubPeer::PUB_ID, $join_behavior);
662:
663: $stmt = BasePeer::doSelect($criteria, $con);
664: $results = array();
665:
666: while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
667: $key1 = PubRelationshipPeer::getPrimaryKeyHashFromRow($row, 0);
668: if (null !== ($obj1 = PubRelationshipPeer::getInstanceFromPool($key1))) {
669:
670:
671:
672: } else {
673:
674: $cls = PubRelationshipPeer::getOMClass();
675:
676: $obj1 = new $cls();
677: $obj1->hydrate($row);
678: PubRelationshipPeer::addInstanceToPool($obj1, $key1);
679: }
680:
681: $key2 = PubPeer::getPrimaryKeyHashFromRow($row, $startcol);
682: if ($key2 !== null) {
683: $obj2 = PubPeer::getInstanceFromPool($key2);
684: if (!$obj2) {
685:
686: $cls = PubPeer::getOMClass();
687:
688: $obj2 = new $cls();
689: $obj2->hydrate($row, $startcol);
690: PubPeer::addInstanceToPool($obj2, $key2);
691: }
692:
693:
694: $obj2->addPubRelationshipRelatedByObjectId($obj1);
695:
696: }
697:
698: $results[] = $obj1;
699: }
700: $stmt->closeCursor();
701:
702: return $results;
703: }
704:
705:
706: 707: 708: 709: 710: 711: 712: 713: 714:
715: public static function doSelectJoinPubRelatedBySubjectId(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
716: {
717: $criteria = clone $criteria;
718:
719:
720: if ($criteria->getDbName() == Propel::getDefaultDB()) {
721: $criteria->setDbName(PubRelationshipPeer::DATABASE_NAME);
722: }
723:
724: PubRelationshipPeer::addSelectColumns($criteria);
725: $startcol = PubRelationshipPeer::NUM_HYDRATE_COLUMNS;
726: PubPeer::addSelectColumns($criteria);
727:
728: $criteria->addJoin(PubRelationshipPeer::SUBJECT_ID, PubPeer::PUB_ID, $join_behavior);
729:
730: $stmt = BasePeer::doSelect($criteria, $con);
731: $results = array();
732:
733: while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
734: $key1 = PubRelationshipPeer::getPrimaryKeyHashFromRow($row, 0);
735: if (null !== ($obj1 = PubRelationshipPeer::getInstanceFromPool($key1))) {
736:
737:
738:
739: } else {
740:
741: $cls = PubRelationshipPeer::getOMClass();
742:
743: $obj1 = new $cls();
744: $obj1->hydrate($row);
745: PubRelationshipPeer::addInstanceToPool($obj1, $key1);
746: }
747:
748: $key2 = PubPeer::getPrimaryKeyHashFromRow($row, $startcol);
749: if ($key2 !== null) {
750: $obj2 = PubPeer::getInstanceFromPool($key2);
751: if (!$obj2) {
752:
753: $cls = PubPeer::getOMClass();
754:
755: $obj2 = new $cls();
756: $obj2->hydrate($row, $startcol);
757: PubPeer::addInstanceToPool($obj2, $key2);
758: }
759:
760:
761: $obj2->addPubRelationshipRelatedBySubjectId($obj1);
762:
763: }
764:
765: $results[] = $obj1;
766: }
767: $stmt->closeCursor();
768:
769: return $results;
770: }
771:
772:
773: 774: 775: 776: 777: 778: 779: 780: 781:
782: public static function doSelectJoinCvterm(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
783: {
784: $criteria = clone $criteria;
785:
786:
787: if ($criteria->getDbName() == Propel::getDefaultDB()) {
788: $criteria->setDbName(PubRelationshipPeer::DATABASE_NAME);
789: }
790:
791: PubRelationshipPeer::addSelectColumns($criteria);
792: $startcol = PubRelationshipPeer::NUM_HYDRATE_COLUMNS;
793: CvtermPeer::addSelectColumns($criteria);
794:
795: $criteria->addJoin(PubRelationshipPeer::TYPE_ID, CvtermPeer::CVTERM_ID, $join_behavior);
796:
797: $stmt = BasePeer::doSelect($criteria, $con);
798: $results = array();
799:
800: while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
801: $key1 = PubRelationshipPeer::getPrimaryKeyHashFromRow($row, 0);
802: if (null !== ($obj1 = PubRelationshipPeer::getInstanceFromPool($key1))) {
803:
804:
805:
806: } else {
807:
808: $cls = PubRelationshipPeer::getOMClass();
809:
810: $obj1 = new $cls();
811: $obj1->hydrate($row);
812: PubRelationshipPeer::addInstanceToPool($obj1, $key1);
813: }
814:
815: $key2 = CvtermPeer::getPrimaryKeyHashFromRow($row, $startcol);
816: if ($key2 !== null) {
817: $obj2 = CvtermPeer::getInstanceFromPool($key2);
818: if (!$obj2) {
819:
820: $cls = CvtermPeer::getOMClass();
821:
822: $obj2 = new $cls();
823: $obj2->hydrate($row, $startcol);
824: CvtermPeer::addInstanceToPool($obj2, $key2);
825: }
826:
827:
828: $obj2->addPubRelationship($obj1);
829:
830: }
831:
832: $results[] = $obj1;
833: }
834: $stmt->closeCursor();
835:
836: return $results;
837: }
838:
839:
840: 841: 842: 843: 844: 845: 846: 847: 848:
849: public static function doCountJoinAll(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)
850: {
851:
852: $criteria = clone $criteria;
853:
854:
855:
856:
857: $criteria->setPrimaryTableName(PubRelationshipPeer::TABLE_NAME);
858:
859: if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
860: $criteria->setDistinct();
861: }
862:
863: if (!$criteria->hasSelectClause()) {
864: PubRelationshipPeer::addSelectColumns($criteria);
865: }
866:
867: $criteria->clearOrderByColumns();
868:
869:
870: $criteria->setDbName(PubRelationshipPeer::DATABASE_NAME);
871:
872: if ($con === null) {
873: $con = Propel::getConnection(PubRelationshipPeer::DATABASE_NAME, Propel::CONNECTION_READ);
874: }
875:
876: $criteria->addJoin(PubRelationshipPeer::OBJECT_ID, PubPeer::PUB_ID, $join_behavior);
877:
878: $criteria->addJoin(PubRelationshipPeer::SUBJECT_ID, PubPeer::PUB_ID, $join_behavior);
879:
880: $criteria->addJoin(PubRelationshipPeer::TYPE_ID, CvtermPeer::CVTERM_ID, $join_behavior);
881:
882: $stmt = BasePeer::doCount($criteria, $con);
883:
884: if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
885: $count = (int) $row[0];
886: } else {
887: $count = 0;
888: }
889: $stmt->closeCursor();
890:
891: return $count;
892: }
893:
894: 895: 896: 897: 898: 899: 900: 901: 902: 903:
904: public static function doSelectJoinAll(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
905: {
906: $criteria = clone $criteria;
907:
908:
909: if ($criteria->getDbName() == Propel::getDefaultDB()) {
910: $criteria->setDbName(PubRelationshipPeer::DATABASE_NAME);
911: }
912:
913: PubRelationshipPeer::addSelectColumns($criteria);
914: $startcol2 = PubRelationshipPeer::NUM_HYDRATE_COLUMNS;
915:
916: PubPeer::addSelectColumns($criteria);
917: $startcol3 = $startcol2 + PubPeer::NUM_HYDRATE_COLUMNS;
918:
919: PubPeer::addSelectColumns($criteria);
920: $startcol4 = $startcol3 + PubPeer::NUM_HYDRATE_COLUMNS;
921:
922: CvtermPeer::addSelectColumns($criteria);
923: $startcol5 = $startcol4 + CvtermPeer::NUM_HYDRATE_COLUMNS;
924:
925: $criteria->addJoin(PubRelationshipPeer::OBJECT_ID, PubPeer::PUB_ID, $join_behavior);
926:
927: $criteria->addJoin(PubRelationshipPeer::SUBJECT_ID, PubPeer::PUB_ID, $join_behavior);
928:
929: $criteria->addJoin(PubRelationshipPeer::TYPE_ID, CvtermPeer::CVTERM_ID, $join_behavior);
930:
931: $stmt = BasePeer::doSelect($criteria, $con);
932: $results = array();
933:
934: while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
935: $key1 = PubRelationshipPeer::getPrimaryKeyHashFromRow($row, 0);
936: if (null !== ($obj1 = PubRelationshipPeer::getInstanceFromPool($key1))) {
937:
938:
939:
940: } else {
941: $cls = PubRelationshipPeer::getOMClass();
942:
943: $obj1 = new $cls();
944: $obj1->hydrate($row);
945: PubRelationshipPeer::addInstanceToPool($obj1, $key1);
946: }
947:
948:
949:
950: $key2 = PubPeer::getPrimaryKeyHashFromRow($row, $startcol2);
951: if ($key2 !== null) {
952: $obj2 = PubPeer::getInstanceFromPool($key2);
953: if (!$obj2) {
954:
955: $cls = PubPeer::getOMClass();
956:
957: $obj2 = new $cls();
958: $obj2->hydrate($row, $startcol2);
959: PubPeer::addInstanceToPool($obj2, $key2);
960: }
961:
962:
963: $obj2->addPubRelationshipRelatedByObjectId($obj1);
964: }
965:
966:
967:
968: $key3 = PubPeer::getPrimaryKeyHashFromRow($row, $startcol3);
969: if ($key3 !== null) {
970: $obj3 = PubPeer::getInstanceFromPool($key3);
971: if (!$obj3) {
972:
973: $cls = PubPeer::getOMClass();
974:
975: $obj3 = new $cls();
976: $obj3->hydrate($row, $startcol3);
977: PubPeer::addInstanceToPool($obj3, $key3);
978: }
979:
980:
981: $obj3->addPubRelationshipRelatedBySubjectId($obj1);
982: }
983:
984:
985:
986: $key4 = CvtermPeer::getPrimaryKeyHashFromRow($row, $startcol4);
987: if ($key4 !== null) {
988: $obj4 = CvtermPeer::getInstanceFromPool($key4);
989: if (!$obj4) {
990:
991: $cls = CvtermPeer::getOMClass();
992:
993: $obj4 = new $cls();
994: $obj4->hydrate($row, $startcol4);
995: CvtermPeer::addInstanceToPool($obj4, $key4);
996: }
997:
998:
999: $obj4->addPubRelationship($obj1);
1000: }
1001:
1002: $results[] = $obj1;
1003: }
1004: $stmt->closeCursor();
1005:
1006: return $results;
1007: }
1008:
1009:
1010: 1011: 1012: 1013: 1014: 1015: 1016: 1017: 1018:
1019: public static function doCountJoinAllExceptPubRelatedByObjectId(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)
1020: {
1021:
1022: $criteria = clone $criteria;
1023:
1024:
1025:
1026:
1027: $criteria->setPrimaryTableName(PubRelationshipPeer::TABLE_NAME);
1028:
1029: if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
1030: $criteria->setDistinct();
1031: }
1032:
1033: if (!$criteria->hasSelectClause()) {
1034: PubRelationshipPeer::addSelectColumns($criteria);
1035: }
1036:
1037: $criteria->clearOrderByColumns();
1038:
1039:
1040: $criteria->setDbName(PubRelationshipPeer::DATABASE_NAME);
1041:
1042: if ($con === null) {
1043: $con = Propel::getConnection(PubRelationshipPeer::DATABASE_NAME, Propel::CONNECTION_READ);
1044: }
1045:
1046: $criteria->addJoin(PubRelationshipPeer::TYPE_ID, CvtermPeer::CVTERM_ID, $join_behavior);
1047:
1048: $stmt = BasePeer::doCount($criteria, $con);
1049:
1050: if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
1051: $count = (int) $row[0];
1052: } else {
1053: $count = 0;
1054: }
1055: $stmt->closeCursor();
1056:
1057: return $count;
1058: }
1059:
1060:
1061: 1062: 1063: 1064: 1065: 1066: 1067: 1068: 1069:
1070: public static function doCountJoinAllExceptPubRelatedBySubjectId(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)
1071: {
1072:
1073: $criteria = clone $criteria;
1074:
1075:
1076:
1077:
1078: $criteria->setPrimaryTableName(PubRelationshipPeer::TABLE_NAME);
1079:
1080: if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
1081: $criteria->setDistinct();
1082: }
1083:
1084: if (!$criteria->hasSelectClause()) {
1085: PubRelationshipPeer::addSelectColumns($criteria);
1086: }
1087:
1088: $criteria->clearOrderByColumns();
1089:
1090:
1091: $criteria->setDbName(PubRelationshipPeer::DATABASE_NAME);
1092:
1093: if ($con === null) {
1094: $con = Propel::getConnection(PubRelationshipPeer::DATABASE_NAME, Propel::CONNECTION_READ);
1095: }
1096:
1097: $criteria->addJoin(PubRelationshipPeer::TYPE_ID, CvtermPeer::CVTERM_ID, $join_behavior);
1098:
1099: $stmt = BasePeer::doCount($criteria, $con);
1100:
1101: if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
1102: $count = (int) $row[0];
1103: } else {
1104: $count = 0;
1105: }
1106: $stmt->closeCursor();
1107:
1108: return $count;
1109: }
1110:
1111:
1112: 1113: 1114: 1115: 1116: 1117: 1118: 1119: 1120:
1121: public static function doCountJoinAllExceptCvterm(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)
1122: {
1123:
1124: $criteria = clone $criteria;
1125:
1126:
1127:
1128:
1129: $criteria->setPrimaryTableName(PubRelationshipPeer::TABLE_NAME);
1130:
1131: if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
1132: $criteria->setDistinct();
1133: }
1134:
1135: if (!$criteria->hasSelectClause()) {
1136: PubRelationshipPeer::addSelectColumns($criteria);
1137: }
1138:
1139: $criteria->clearOrderByColumns();
1140:
1141:
1142: $criteria->setDbName(PubRelationshipPeer::DATABASE_NAME);
1143:
1144: if ($con === null) {
1145: $con = Propel::getConnection(PubRelationshipPeer::DATABASE_NAME, Propel::CONNECTION_READ);
1146: }
1147:
1148: $criteria->addJoin(PubRelationshipPeer::OBJECT_ID, PubPeer::PUB_ID, $join_behavior);
1149:
1150: $criteria->addJoin(PubRelationshipPeer::SUBJECT_ID, PubPeer::PUB_ID, $join_behavior);
1151:
1152: $stmt = BasePeer::doCount($criteria, $con);
1153:
1154: if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
1155: $count = (int) $row[0];
1156: } else {
1157: $count = 0;
1158: }
1159: $stmt->closeCursor();
1160:
1161: return $count;
1162: }
1163:
1164:
1165: 1166: 1167: 1168: 1169: 1170: 1171: 1172: 1173: 1174:
1175: public static function doSelectJoinAllExceptPubRelatedByObjectId(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
1176: {
1177: $criteria = clone $criteria;
1178:
1179:
1180:
1181:
1182: if ($criteria->getDbName() == Propel::getDefaultDB()) {
1183: $criteria->setDbName(PubRelationshipPeer::DATABASE_NAME);
1184: }
1185:
1186: PubRelationshipPeer::addSelectColumns($criteria);
1187: $startcol2 = PubRelationshipPeer::NUM_HYDRATE_COLUMNS;
1188:
1189: CvtermPeer::addSelectColumns($criteria);
1190: $startcol3 = $startcol2 + CvtermPeer::NUM_HYDRATE_COLUMNS;
1191:
1192: $criteria->addJoin(PubRelationshipPeer::TYPE_ID, CvtermPeer::CVTERM_ID, $join_behavior);
1193:
1194:
1195: $stmt = BasePeer::doSelect($criteria, $con);
1196: $results = array();
1197:
1198: while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
1199: $key1 = PubRelationshipPeer::getPrimaryKeyHashFromRow($row, 0);
1200: if (null !== ($obj1 = PubRelationshipPeer::getInstanceFromPool($key1))) {
1201:
1202:
1203:
1204: } else {
1205: $cls = PubRelationshipPeer::getOMClass();
1206:
1207: $obj1 = new $cls();
1208: $obj1->hydrate($row);
1209: PubRelationshipPeer::addInstanceToPool($obj1, $key1);
1210: }
1211:
1212:
1213:
1214: $key2 = CvtermPeer::getPrimaryKeyHashFromRow($row, $startcol2);
1215: if ($key2 !== null) {
1216: $obj2 = CvtermPeer::getInstanceFromPool($key2);
1217: if (!$obj2) {
1218:
1219: $cls = CvtermPeer::getOMClass();
1220:
1221: $obj2 = new $cls();
1222: $obj2->hydrate($row, $startcol2);
1223: CvtermPeer::addInstanceToPool($obj2, $key2);
1224: }
1225:
1226:
1227: $obj2->addPubRelationship($obj1);
1228:
1229: }
1230:
1231: $results[] = $obj1;
1232: }
1233: $stmt->closeCursor();
1234:
1235: return $results;
1236: }
1237:
1238:
1239: 1240: 1241: 1242: 1243: 1244: 1245: 1246: 1247: 1248:
1249: public static function doSelectJoinAllExceptPubRelatedBySubjectId(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
1250: {
1251: $criteria = clone $criteria;
1252:
1253:
1254:
1255:
1256: if ($criteria->getDbName() == Propel::getDefaultDB()) {
1257: $criteria->setDbName(PubRelationshipPeer::DATABASE_NAME);
1258: }
1259:
1260: PubRelationshipPeer::addSelectColumns($criteria);
1261: $startcol2 = PubRelationshipPeer::NUM_HYDRATE_COLUMNS;
1262:
1263: CvtermPeer::addSelectColumns($criteria);
1264: $startcol3 = $startcol2 + CvtermPeer::NUM_HYDRATE_COLUMNS;
1265:
1266: $criteria->addJoin(PubRelationshipPeer::TYPE_ID, CvtermPeer::CVTERM_ID, $join_behavior);
1267:
1268:
1269: $stmt = BasePeer::doSelect($criteria, $con);
1270: $results = array();
1271:
1272: while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
1273: $key1 = PubRelationshipPeer::getPrimaryKeyHashFromRow($row, 0);
1274: if (null !== ($obj1 = PubRelationshipPeer::getInstanceFromPool($key1))) {
1275:
1276:
1277:
1278: } else {
1279: $cls = PubRelationshipPeer::getOMClass();
1280:
1281: $obj1 = new $cls();
1282: $obj1->hydrate($row);
1283: PubRelationshipPeer::addInstanceToPool($obj1, $key1);
1284: }
1285:
1286:
1287:
1288: $key2 = CvtermPeer::getPrimaryKeyHashFromRow($row, $startcol2);
1289: if ($key2 !== null) {
1290: $obj2 = CvtermPeer::getInstanceFromPool($key2);
1291: if (!$obj2) {
1292:
1293: $cls = CvtermPeer::getOMClass();
1294:
1295: $obj2 = new $cls();
1296: $obj2->hydrate($row, $startcol2);
1297: CvtermPeer::addInstanceToPool($obj2, $key2);
1298: }
1299:
1300:
1301: $obj2->addPubRelationship($obj1);
1302:
1303: }
1304:
1305: $results[] = $obj1;
1306: }
1307: $stmt->closeCursor();
1308:
1309: return $results;
1310: }
1311:
1312:
1313: 1314: 1315: 1316: 1317: 1318: 1319: 1320: 1321: 1322:
1323: public static function doSelectJoinAllExceptCvterm(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
1324: {
1325: $criteria = clone $criteria;
1326:
1327:
1328:
1329:
1330: if ($criteria->getDbName() == Propel::getDefaultDB()) {
1331: $criteria->setDbName(PubRelationshipPeer::DATABASE_NAME);
1332: }
1333:
1334: PubRelationshipPeer::addSelectColumns($criteria);
1335: $startcol2 = PubRelationshipPeer::NUM_HYDRATE_COLUMNS;
1336:
1337: PubPeer::addSelectColumns($criteria);
1338: $startcol3 = $startcol2 + PubPeer::NUM_HYDRATE_COLUMNS;
1339:
1340: PubPeer::addSelectColumns($criteria);
1341: $startcol4 = $startcol3 + PubPeer::NUM_HYDRATE_COLUMNS;
1342:
1343: $criteria->addJoin(PubRelationshipPeer::OBJECT_ID, PubPeer::PUB_ID, $join_behavior);
1344:
1345: $criteria->addJoin(PubRelationshipPeer::SUBJECT_ID, PubPeer::PUB_ID, $join_behavior);
1346:
1347:
1348: $stmt = BasePeer::doSelect($criteria, $con);
1349: $results = array();
1350:
1351: while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
1352: $key1 = PubRelationshipPeer::getPrimaryKeyHashFromRow($row, 0);
1353: if (null !== ($obj1 = PubRelationshipPeer::getInstanceFromPool($key1))) {
1354:
1355:
1356:
1357: } else {
1358: $cls = PubRelationshipPeer::getOMClass();
1359:
1360: $obj1 = new $cls();
1361: $obj1->hydrate($row);
1362: PubRelationshipPeer::addInstanceToPool($obj1, $key1);
1363: }
1364:
1365:
1366:
1367: $key2 = PubPeer::getPrimaryKeyHashFromRow($row, $startcol2);
1368: if ($key2 !== null) {
1369: $obj2 = PubPeer::getInstanceFromPool($key2);
1370: if (!$obj2) {
1371:
1372: $cls = PubPeer::getOMClass();
1373:
1374: $obj2 = new $cls();
1375: $obj2->hydrate($row, $startcol2);
1376: PubPeer::addInstanceToPool($obj2, $key2);
1377: }
1378:
1379:
1380: $obj2->addPubRelationshipRelatedByObjectId($obj1);
1381:
1382: }
1383:
1384:
1385:
1386: $key3 = PubPeer::getPrimaryKeyHashFromRow($row, $startcol3);
1387: if ($key3 !== null) {
1388: $obj3 = PubPeer::getInstanceFromPool($key3);
1389: if (!$obj3) {
1390:
1391: $cls = PubPeer::getOMClass();
1392:
1393: $obj3 = new $cls();
1394: $obj3->hydrate($row, $startcol3);
1395: PubPeer::addInstanceToPool($obj3, $key3);
1396: }
1397:
1398:
1399: $obj3->addPubRelationshipRelatedBySubjectId($obj1);
1400:
1401: }
1402:
1403: $results[] = $obj1;
1404: }
1405: $stmt->closeCursor();
1406:
1407: return $results;
1408: }
1409:
1410: 1411: 1412: 1413: 1414: 1415: 1416:
1417: public static function getTableMap()
1418: {
1419: return Propel::getDatabaseMap(PubRelationshipPeer::DATABASE_NAME)->getTable(PubRelationshipPeer::TABLE_NAME);
1420: }
1421:
1422: 1423: 1424:
1425: public static function buildTableMap()
1426: {
1427: $dbMap = Propel::getDatabaseMap(BasePubRelationshipPeer::DATABASE_NAME);
1428: if (!$dbMap->hasTable(BasePubRelationshipPeer::TABLE_NAME)) {
1429: $dbMap->addTableObject(new PubRelationshipTableMap());
1430: }
1431: }
1432:
1433: 1434: 1435: 1436: 1437: 1438:
1439: public static function getOMClass($row = 0, $colnum = 0)
1440: {
1441: return PubRelationshipPeer::OM_CLASS;
1442: }
1443:
1444: 1445: 1446: 1447: 1448: 1449: 1450: 1451: 1452:
1453: public static function doInsert($values, PropelPDO $con = null)
1454: {
1455: if ($con === null) {
1456: $con = Propel::getConnection(PubRelationshipPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
1457: }
1458:
1459: if ($values instanceof Criteria) {
1460: $criteria = clone $values;
1461: } else {
1462: $criteria = $values->buildCriteria();
1463: }
1464:
1465: if ($criteria->containsKey(PubRelationshipPeer::PUB_RELATIONSHIP_ID) && $criteria->keyContainsValue(PubRelationshipPeer::PUB_RELATIONSHIP_ID) ) {
1466: throw new PropelException('Cannot insert a value for auto-increment primary key ('.PubRelationshipPeer::PUB_RELATIONSHIP_ID.')');
1467: }
1468:
1469:
1470:
1471: $criteria->setDbName(PubRelationshipPeer::DATABASE_NAME);
1472:
1473: try {
1474:
1475:
1476: $con->beginTransaction();
1477: $pk = BasePeer::doInsert($criteria, $con);
1478: $con->commit();
1479: } catch (PropelException $e) {
1480: $con->rollBack();
1481: throw $e;
1482: }
1483:
1484: return $pk;
1485: }
1486:
1487: 1488: 1489: 1490: 1491: 1492: 1493: 1494: 1495:
1496: public static function doUpdate($values, PropelPDO $con = null)
1497: {
1498: if ($con === null) {
1499: $con = Propel::getConnection(PubRelationshipPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
1500: }
1501:
1502: $selectCriteria = new Criteria(PubRelationshipPeer::DATABASE_NAME);
1503:
1504: if ($values instanceof Criteria) {
1505: $criteria = clone $values;
1506:
1507: $comparison = $criteria->getComparison(PubRelationshipPeer::PUB_RELATIONSHIP_ID);
1508: $value = $criteria->remove(PubRelationshipPeer::PUB_RELATIONSHIP_ID);
1509: if ($value) {
1510: $selectCriteria->add(PubRelationshipPeer::PUB_RELATIONSHIP_ID, $value, $comparison);
1511: } else {
1512: $selectCriteria->setPrimaryTableName(PubRelationshipPeer::TABLE_NAME);
1513: }
1514:
1515: } else {
1516: $criteria = $values->buildCriteria();
1517: $selectCriteria = $values->buildPkeyCriteria();
1518: }
1519:
1520:
1521: $criteria->setDbName(PubRelationshipPeer::DATABASE_NAME);
1522:
1523: return BasePeer::doUpdate($selectCriteria, $criteria, $con);
1524: }
1525:
1526: 1527: 1528: 1529: 1530: 1531: 1532:
1533: public static function doDeleteAll(PropelPDO $con = null)
1534: {
1535: if ($con === null) {
1536: $con = Propel::getConnection(PubRelationshipPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
1537: }
1538: $affectedRows = 0;
1539: try {
1540:
1541:
1542: $con->beginTransaction();
1543: $affectedRows += BasePeer::doDeleteAll(PubRelationshipPeer::TABLE_NAME, $con, PubRelationshipPeer::DATABASE_NAME);
1544:
1545:
1546:
1547: PubRelationshipPeer::clearInstancePool();
1548: PubRelationshipPeer::clearRelatedInstancePool();
1549: $con->commit();
1550:
1551: return $affectedRows;
1552: } catch (PropelException $e) {
1553: $con->rollBack();
1554: throw $e;
1555: }
1556: }
1557:
1558: 1559: 1560: 1561: 1562: 1563: 1564: 1565: 1566: 1567: 1568:
1569: public static function doDelete($values, PropelPDO $con = null)
1570: {
1571: if ($con === null) {
1572: $con = Propel::getConnection(PubRelationshipPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
1573: }
1574:
1575: if ($values instanceof Criteria) {
1576:
1577:
1578:
1579: PubRelationshipPeer::clearInstancePool();
1580:
1581: $criteria = clone $values;
1582: } elseif ($values instanceof PubRelationship) {
1583:
1584: PubRelationshipPeer::removeInstanceFromPool($values);
1585:
1586: $criteria = $values->buildPkeyCriteria();
1587: } else {
1588: $criteria = new Criteria(PubRelationshipPeer::DATABASE_NAME);
1589: $criteria->add(PubRelationshipPeer::PUB_RELATIONSHIP_ID, (array) $values, Criteria::IN);
1590:
1591: foreach ((array) $values as $singleval) {
1592: PubRelationshipPeer::removeInstanceFromPool($singleval);
1593: }
1594: }
1595:
1596:
1597: $criteria->setDbName(PubRelationshipPeer::DATABASE_NAME);
1598:
1599: $affectedRows = 0;
1600:
1601: try {
1602:
1603:
1604: $con->beginTransaction();
1605:
1606: $affectedRows += BasePeer::doDelete($criteria, $con);
1607: PubRelationshipPeer::clearRelatedInstancePool();
1608: $con->commit();
1609:
1610: return $affectedRows;
1611: } catch (PropelException $e) {
1612: $con->rollBack();
1613: throw $e;
1614: }
1615: }
1616:
1617: 1618: 1619: 1620: 1621: 1622: 1623: 1624: 1625: 1626: 1627: 1628:
1629: public static function doValidate($obj, $cols = null)
1630: {
1631: $columns = array();
1632:
1633: if ($cols) {
1634: $dbMap = Propel::getDatabaseMap(PubRelationshipPeer::DATABASE_NAME);
1635: $tableMap = $dbMap->getTable(PubRelationshipPeer::TABLE_NAME);
1636:
1637: if (! is_array($cols)) {
1638: $cols = array($cols);
1639: }
1640:
1641: foreach ($cols as $colName) {
1642: if ($tableMap->hasColumn($colName)) {
1643: $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
1644: $columns[$colName] = $obj->$get();
1645: }
1646: }
1647: } else {
1648:
1649: }
1650:
1651: return BasePeer::doValidate(PubRelationshipPeer::DATABASE_NAME, PubRelationshipPeer::TABLE_NAME, $columns);
1652: }
1653:
1654: 1655: 1656: 1657: 1658: 1659: 1660:
1661: public static function retrieveByPK($pk, PropelPDO $con = null)
1662: {
1663:
1664: if (null !== ($obj = PubRelationshipPeer::getInstanceFromPool((string) $pk))) {
1665: return $obj;
1666: }
1667:
1668: if ($con === null) {
1669: $con = Propel::getConnection(PubRelationshipPeer::DATABASE_NAME, Propel::CONNECTION_READ);
1670: }
1671:
1672: $criteria = new Criteria(PubRelationshipPeer::DATABASE_NAME);
1673: $criteria->add(PubRelationshipPeer::PUB_RELATIONSHIP_ID, $pk);
1674:
1675: $v = PubRelationshipPeer::doSelect($criteria, $con);
1676:
1677: return !empty($v) > 0 ? $v[0] : null;
1678: }
1679:
1680: 1681: 1682: 1683: 1684: 1685: 1686: 1687: 1688:
1689: public static function retrieveByPKs($pks, PropelPDO $con = null)
1690: {
1691: if ($con === null) {
1692: $con = Propel::getConnection(PubRelationshipPeer::DATABASE_NAME, Propel::CONNECTION_READ);
1693: }
1694:
1695: $objs = null;
1696: if (empty($pks)) {
1697: $objs = array();
1698: } else {
1699: $criteria = new Criteria(PubRelationshipPeer::DATABASE_NAME);
1700: $criteria->add(PubRelationshipPeer::PUB_RELATIONSHIP_ID, $pks, Criteria::IN);
1701: $objs = PubRelationshipPeer::doSelect($criteria, $con);
1702: }
1703:
1704: return $objs;
1705: }
1706:
1707: }
1708:
1709:
1710:
1711: BasePubRelationshipPeer::buildTableMap();
1712:
1713: