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