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