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()
393: {
394: FeatureProdPeer::$instances = array();
395: }
396:
397: 398: 399: 400:
401: public static function clearRelatedInstancePool()
402: {
403: }
404:
405: 406: 407: 408: 409: 410: 411: 412: 413: 414:
415: public static function getPrimaryKeyHashFromRow($row, $startcol = 0)
416: {
417:
418: if ($row[$startcol] === null) {
419: return null;
420: }
421:
422: return (string) $row[$startcol];
423: }
424:
425: 426: 427: 428: 429: 430: 431: 432: 433:
434: public static function getPrimaryKeyFromRow($row, $startcol = 0)
435: {
436:
437: return (int) $row[$startcol];
438: }
439:
440: 441: 442: 443: 444: 445: 446:
447: public static function populateObjects(PDOStatement $stmt)
448: {
449: $results = array();
450:
451:
452: $cls = FeatureProdPeer::getOMClass();
453:
454: while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
455: $key = FeatureProdPeer::getPrimaryKeyHashFromRow($row, 0);
456: if (null !== ($obj = FeatureProdPeer::getInstanceFromPool($key))) {
457:
458:
459:
460: $results[] = $obj;
461: } else {
462: $obj = new $cls();
463: $obj->hydrate($row);
464: $results[] = $obj;
465: FeatureProdPeer::addInstanceToPool($obj, $key);
466: }
467: }
468: $stmt->closeCursor();
469:
470: return $results;
471: }
472: 473: 474: 475: 476: 477: 478: 479: 480:
481: public static function populateObject($row, $startcol = 0)
482: {
483: $key = FeatureProdPeer::getPrimaryKeyHashFromRow($row, $startcol);
484: if (null !== ($obj = FeatureProdPeer::getInstanceFromPool($key))) {
485:
486:
487:
488: $col = $startcol + FeatureProdPeer::NUM_HYDRATE_COLUMNS;
489: } else {
490: $cls = FeatureProdPeer::OM_CLASS;
491: $obj = new $cls();
492: $col = $obj->hydrate($row, $startcol);
493: FeatureProdPeer::addInstanceToPool($obj, $key);
494: }
495:
496: return array($obj, $col);
497: }
498:
499:
500: 501: 502: 503: 504: 505: 506: 507: 508:
509: public static function doCountJoinProduct(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)
510: {
511:
512: $criteria = clone $criteria;
513:
514:
515:
516:
517: $criteria->setPrimaryTableName(FeatureProdPeer::TABLE_NAME);
518:
519: if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
520: $criteria->setDistinct();
521: }
522:
523: if (!$criteria->hasSelectClause()) {
524: FeatureProdPeer::addSelectColumns($criteria);
525: }
526:
527: $criteria->clearOrderByColumns();
528:
529:
530: $criteria->setDbName(FeatureProdPeer::DATABASE_NAME);
531:
532: if ($con === null) {
533: $con = Propel::getConnection(FeatureProdPeer::DATABASE_NAME, Propel::CONNECTION_READ);
534: }
535:
536: $criteria->addJoin(FeatureProdPeer::PRODUCT_ID, ProductPeer::ID, $join_behavior);
537:
538: $stmt = BasePeer::doCount($criteria, $con);
539:
540: if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
541: $count = (int) $row[0];
542: } else {
543: $count = 0;
544: }
545: $stmt->closeCursor();
546:
547: return $count;
548: }
549:
550:
551: 552: 553: 554: 555: 556: 557: 558: 559:
560: public static function doCountJoinFeature(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)
561: {
562:
563: $criteria = clone $criteria;
564:
565:
566:
567:
568: $criteria->setPrimaryTableName(FeatureProdPeer::TABLE_NAME);
569:
570: if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
571: $criteria->setDistinct();
572: }
573:
574: if (!$criteria->hasSelectClause()) {
575: FeatureProdPeer::addSelectColumns($criteria);
576: }
577:
578: $criteria->clearOrderByColumns();
579:
580:
581: $criteria->setDbName(FeatureProdPeer::DATABASE_NAME);
582:
583: if ($con === null) {
584: $con = Propel::getConnection(FeatureProdPeer::DATABASE_NAME, Propel::CONNECTION_READ);
585: }
586:
587: $criteria->addJoin(FeatureProdPeer::FEATURE_ID, FeaturePeer::ID, $join_behavior);
588:
589: $stmt = BasePeer::doCount($criteria, $con);
590:
591: if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
592: $count = (int) $row[0];
593: } else {
594: $count = 0;
595: }
596: $stmt->closeCursor();
597:
598: return $count;
599: }
600:
601:
602: 603: 604: 605: 606: 607: 608: 609: 610:
611: public static function doCountJoinFeatureAv(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)
612: {
613:
614: $criteria = clone $criteria;
615:
616:
617:
618:
619: $criteria->setPrimaryTableName(FeatureProdPeer::TABLE_NAME);
620:
621: if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
622: $criteria->setDistinct();
623: }
624:
625: if (!$criteria->hasSelectClause()) {
626: FeatureProdPeer::addSelectColumns($criteria);
627: }
628:
629: $criteria->clearOrderByColumns();
630:
631:
632: $criteria->setDbName(FeatureProdPeer::DATABASE_NAME);
633:
634: if ($con === null) {
635: $con = Propel::getConnection(FeatureProdPeer::DATABASE_NAME, Propel::CONNECTION_READ);
636: }
637:
638: $criteria->addJoin(FeatureProdPeer::FEATURE_AV_ID, FeatureAvPeer::ID, $join_behavior);
639:
640: $stmt = BasePeer::doCount($criteria, $con);
641:
642: if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
643: $count = (int) $row[0];
644: } else {
645: $count = 0;
646: }
647: $stmt->closeCursor();
648:
649: return $count;
650: }
651:
652:
653: 654: 655: 656: 657: 658: 659: 660: 661:
662: public static function doSelectJoinProduct(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
663: {
664: $criteria = clone $criteria;
665:
666:
667: if ($criteria->getDbName() == Propel::getDefaultDB()) {
668: $criteria->setDbName(FeatureProdPeer::DATABASE_NAME);
669: }
670:
671: FeatureProdPeer::addSelectColumns($criteria);
672: $startcol = FeatureProdPeer::NUM_HYDRATE_COLUMNS;
673: ProductPeer::addSelectColumns($criteria);
674:
675: $criteria->addJoin(FeatureProdPeer::PRODUCT_ID, ProductPeer::ID, $join_behavior);
676:
677: $stmt = BasePeer::doSelect($criteria, $con);
678: $results = array();
679:
680: while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
681: $key1 = FeatureProdPeer::getPrimaryKeyHashFromRow($row, 0);
682: if (null !== ($obj1 = FeatureProdPeer::getInstanceFromPool($key1))) {
683:
684:
685:
686: } else {
687:
688: $cls = FeatureProdPeer::getOMClass();
689:
690: $obj1 = new $cls();
691: $obj1->hydrate($row);
692: FeatureProdPeer::addInstanceToPool($obj1, $key1);
693: }
694:
695: $key2 = ProductPeer::getPrimaryKeyHashFromRow($row, $startcol);
696: if ($key2 !== null) {
697: $obj2 = ProductPeer::getInstanceFromPool($key2);
698: if (!$obj2) {
699:
700: $cls = ProductPeer::getOMClass();
701:
702: $obj2 = new $cls();
703: $obj2->hydrate($row, $startcol);
704: ProductPeer::addInstanceToPool($obj2, $key2);
705: }
706:
707:
708: $obj2->addFeatureProd($obj1);
709:
710: }
711:
712: $results[] = $obj1;
713: }
714: $stmt->closeCursor();
715:
716: return $results;
717: }
718:
719:
720: 721: 722: 723: 724: 725: 726: 727: 728:
729: public static function doSelectJoinFeature(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
730: {
731: $criteria = clone $criteria;
732:
733:
734: if ($criteria->getDbName() == Propel::getDefaultDB()) {
735: $criteria->setDbName(FeatureProdPeer::DATABASE_NAME);
736: }
737:
738: FeatureProdPeer::addSelectColumns($criteria);
739: $startcol = FeatureProdPeer::NUM_HYDRATE_COLUMNS;
740: FeaturePeer::addSelectColumns($criteria);
741:
742: $criteria->addJoin(FeatureProdPeer::FEATURE_ID, FeaturePeer::ID, $join_behavior);
743:
744: $stmt = BasePeer::doSelect($criteria, $con);
745: $results = array();
746:
747: while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
748: $key1 = FeatureProdPeer::getPrimaryKeyHashFromRow($row, 0);
749: if (null !== ($obj1 = FeatureProdPeer::getInstanceFromPool($key1))) {
750:
751:
752:
753: } else {
754:
755: $cls = FeatureProdPeer::getOMClass();
756:
757: $obj1 = new $cls();
758: $obj1->hydrate($row);
759: FeatureProdPeer::addInstanceToPool($obj1, $key1);
760: }
761:
762: $key2 = FeaturePeer::getPrimaryKeyHashFromRow($row, $startcol);
763: if ($key2 !== null) {
764: $obj2 = FeaturePeer::getInstanceFromPool($key2);
765: if (!$obj2) {
766:
767: $cls = FeaturePeer::getOMClass();
768:
769: $obj2 = new $cls();
770: $obj2->hydrate($row, $startcol);
771: FeaturePeer::addInstanceToPool($obj2, $key2);
772: }
773:
774:
775: $obj2->addFeatureProd($obj1);
776:
777: }
778:
779: $results[] = $obj1;
780: }
781: $stmt->closeCursor();
782:
783: return $results;
784: }
785:
786:
787: 788: 789: 790: 791: 792: 793: 794: 795:
796: public static function doSelectJoinFeatureAv(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
797: {
798: $criteria = clone $criteria;
799:
800:
801: if ($criteria->getDbName() == Propel::getDefaultDB()) {
802: $criteria->setDbName(FeatureProdPeer::DATABASE_NAME);
803: }
804:
805: FeatureProdPeer::addSelectColumns($criteria);
806: $startcol = FeatureProdPeer::NUM_HYDRATE_COLUMNS;
807: FeatureAvPeer::addSelectColumns($criteria);
808:
809: $criteria->addJoin(FeatureProdPeer::FEATURE_AV_ID, FeatureAvPeer::ID, $join_behavior);
810:
811: $stmt = BasePeer::doSelect($criteria, $con);
812: $results = array();
813:
814: while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
815: $key1 = FeatureProdPeer::getPrimaryKeyHashFromRow($row, 0);
816: if (null !== ($obj1 = FeatureProdPeer::getInstanceFromPool($key1))) {
817:
818:
819:
820: } else {
821:
822: $cls = FeatureProdPeer::getOMClass();
823:
824: $obj1 = new $cls();
825: $obj1->hydrate($row);
826: FeatureProdPeer::addInstanceToPool($obj1, $key1);
827: }
828:
829: $key2 = FeatureAvPeer::getPrimaryKeyHashFromRow($row, $startcol);
830: if ($key2 !== null) {
831: $obj2 = FeatureAvPeer::getInstanceFromPool($key2);
832: if (!$obj2) {
833:
834: $cls = FeatureAvPeer::getOMClass();
835:
836: $obj2 = new $cls();
837: $obj2->hydrate($row, $startcol);
838: FeatureAvPeer::addInstanceToPool($obj2, $key2);
839: }
840:
841:
842: $obj2->addFeatureProd($obj1);
843:
844: }
845:
846: $results[] = $obj1;
847: }
848: $stmt->closeCursor();
849:
850: return $results;
851: }
852:
853:
854: 855: 856: 857: 858: 859: 860: 861: 862:
863: public static function doCountJoinAll(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)
864: {
865:
866: $criteria = clone $criteria;
867:
868:
869:
870:
871: $criteria->setPrimaryTableName(FeatureProdPeer::TABLE_NAME);
872:
873: if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
874: $criteria->setDistinct();
875: }
876:
877: if (!$criteria->hasSelectClause()) {
878: FeatureProdPeer::addSelectColumns($criteria);
879: }
880:
881: $criteria->clearOrderByColumns();
882:
883:
884: $criteria->setDbName(FeatureProdPeer::DATABASE_NAME);
885:
886: if ($con === null) {
887: $con = Propel::getConnection(FeatureProdPeer::DATABASE_NAME, Propel::CONNECTION_READ);
888: }
889:
890: $criteria->addJoin(FeatureProdPeer::PRODUCT_ID, ProductPeer::ID, $join_behavior);
891:
892: $criteria->addJoin(FeatureProdPeer::FEATURE_ID, FeaturePeer::ID, $join_behavior);
893:
894: $criteria->addJoin(FeatureProdPeer::FEATURE_AV_ID, FeatureAvPeer::ID, $join_behavior);
895:
896: $stmt = BasePeer::doCount($criteria, $con);
897:
898: if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
899: $count = (int) $row[0];
900: } else {
901: $count = 0;
902: }
903: $stmt->closeCursor();
904:
905: return $count;
906: }
907:
908: 909: 910: 911: 912: 913: 914: 915: 916: 917:
918: public static function doSelectJoinAll(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
919: {
920: $criteria = clone $criteria;
921:
922:
923: if ($criteria->getDbName() == Propel::getDefaultDB()) {
924: $criteria->setDbName(FeatureProdPeer::DATABASE_NAME);
925: }
926:
927: FeatureProdPeer::addSelectColumns($criteria);
928: $startcol2 = FeatureProdPeer::NUM_HYDRATE_COLUMNS;
929:
930: ProductPeer::addSelectColumns($criteria);
931: $startcol3 = $startcol2 + ProductPeer::NUM_HYDRATE_COLUMNS;
932:
933: FeaturePeer::addSelectColumns($criteria);
934: $startcol4 = $startcol3 + FeaturePeer::NUM_HYDRATE_COLUMNS;
935:
936: FeatureAvPeer::addSelectColumns($criteria);
937: $startcol5 = $startcol4 + FeatureAvPeer::NUM_HYDRATE_COLUMNS;
938:
939: $criteria->addJoin(FeatureProdPeer::PRODUCT_ID, ProductPeer::ID, $join_behavior);
940:
941: $criteria->addJoin(FeatureProdPeer::FEATURE_ID, FeaturePeer::ID, $join_behavior);
942:
943: $criteria->addJoin(FeatureProdPeer::FEATURE_AV_ID, FeatureAvPeer::ID, $join_behavior);
944:
945: $stmt = BasePeer::doSelect($criteria, $con);
946: $results = array();
947:
948: while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
949: $key1 = FeatureProdPeer::getPrimaryKeyHashFromRow($row, 0);
950: if (null !== ($obj1 = FeatureProdPeer::getInstanceFromPool($key1))) {
951:
952:
953:
954: } else {
955: $cls = FeatureProdPeer::getOMClass();
956:
957: $obj1 = new $cls();
958: $obj1->hydrate($row);
959: FeatureProdPeer::addInstanceToPool($obj1, $key1);
960: }
961:
962:
963:
964: $key2 = ProductPeer::getPrimaryKeyHashFromRow($row, $startcol2);
965: if ($key2 !== null) {
966: $obj2 = ProductPeer::getInstanceFromPool($key2);
967: if (!$obj2) {
968:
969: $cls = ProductPeer::getOMClass();
970:
971: $obj2 = new $cls();
972: $obj2->hydrate($row, $startcol2);
973: ProductPeer::addInstanceToPool($obj2, $key2);
974: }
975:
976:
977: $obj2->addFeatureProd($obj1);
978: }
979:
980:
981:
982: $key3 = FeaturePeer::getPrimaryKeyHashFromRow($row, $startcol3);
983: if ($key3 !== null) {
984: $obj3 = FeaturePeer::getInstanceFromPool($key3);
985: if (!$obj3) {
986:
987: $cls = FeaturePeer::getOMClass();
988:
989: $obj3 = new $cls();
990: $obj3->hydrate($row, $startcol3);
991: FeaturePeer::addInstanceToPool($obj3, $key3);
992: }
993:
994:
995: $obj3->addFeatureProd($obj1);
996: }
997:
998:
999:
1000: $key4 = FeatureAvPeer::getPrimaryKeyHashFromRow($row, $startcol4);
1001: if ($key4 !== null) {
1002: $obj4 = FeatureAvPeer::getInstanceFromPool($key4);
1003: if (!$obj4) {
1004:
1005: $cls = FeatureAvPeer::getOMClass();
1006:
1007: $obj4 = new $cls();
1008: $obj4->hydrate($row, $startcol4);
1009: FeatureAvPeer::addInstanceToPool($obj4, $key4);
1010: }
1011:
1012:
1013: $obj4->addFeatureProd($obj1);
1014: }
1015:
1016: $results[] = $obj1;
1017: }
1018: $stmt->closeCursor();
1019:
1020: return $results;
1021: }
1022:
1023:
1024: 1025: 1026: 1027: 1028: 1029: 1030: 1031: 1032:
1033: public static function doCountJoinAllExceptProduct(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)
1034: {
1035:
1036: $criteria = clone $criteria;
1037:
1038:
1039:
1040:
1041: $criteria->setPrimaryTableName(FeatureProdPeer::TABLE_NAME);
1042:
1043: if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
1044: $criteria->setDistinct();
1045: }
1046:
1047: if (!$criteria->hasSelectClause()) {
1048: FeatureProdPeer::addSelectColumns($criteria);
1049: }
1050:
1051: $criteria->clearOrderByColumns();
1052:
1053:
1054: $criteria->setDbName(FeatureProdPeer::DATABASE_NAME);
1055:
1056: if ($con === null) {
1057: $con = Propel::getConnection(FeatureProdPeer::DATABASE_NAME, Propel::CONNECTION_READ);
1058: }
1059:
1060: $criteria->addJoin(FeatureProdPeer::FEATURE_ID, FeaturePeer::ID, $join_behavior);
1061:
1062: $criteria->addJoin(FeatureProdPeer::FEATURE_AV_ID, FeatureAvPeer::ID, $join_behavior);
1063:
1064: $stmt = BasePeer::doCount($criteria, $con);
1065:
1066: if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
1067: $count = (int) $row[0];
1068: } else {
1069: $count = 0;
1070: }
1071: $stmt->closeCursor();
1072:
1073: return $count;
1074: }
1075:
1076:
1077: 1078: 1079: 1080: 1081: 1082: 1083: 1084: 1085:
1086: public static function doCountJoinAllExceptFeature(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)
1087: {
1088:
1089: $criteria = clone $criteria;
1090:
1091:
1092:
1093:
1094: $criteria->setPrimaryTableName(FeatureProdPeer::TABLE_NAME);
1095:
1096: if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
1097: $criteria->setDistinct();
1098: }
1099:
1100: if (!$criteria->hasSelectClause()) {
1101: FeatureProdPeer::addSelectColumns($criteria);
1102: }
1103:
1104: $criteria->clearOrderByColumns();
1105:
1106:
1107: $criteria->setDbName(FeatureProdPeer::DATABASE_NAME);
1108:
1109: if ($con === null) {
1110: $con = Propel::getConnection(FeatureProdPeer::DATABASE_NAME, Propel::CONNECTION_READ);
1111: }
1112:
1113: $criteria->addJoin(FeatureProdPeer::PRODUCT_ID, ProductPeer::ID, $join_behavior);
1114:
1115: $criteria->addJoin(FeatureProdPeer::FEATURE_AV_ID, FeatureAvPeer::ID, $join_behavior);
1116:
1117: $stmt = BasePeer::doCount($criteria, $con);
1118:
1119: if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
1120: $count = (int) $row[0];
1121: } else {
1122: $count = 0;
1123: }
1124: $stmt->closeCursor();
1125:
1126: return $count;
1127: }
1128:
1129:
1130: 1131: 1132: 1133: 1134: 1135: 1136: 1137: 1138:
1139: public static function doCountJoinAllExceptFeatureAv(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)
1140: {
1141:
1142: $criteria = clone $criteria;
1143:
1144:
1145:
1146:
1147: $criteria->setPrimaryTableName(FeatureProdPeer::TABLE_NAME);
1148:
1149: if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
1150: $criteria->setDistinct();
1151: }
1152:
1153: if (!$criteria->hasSelectClause()) {
1154: FeatureProdPeer::addSelectColumns($criteria);
1155: }
1156:
1157: $criteria->clearOrderByColumns();
1158:
1159:
1160: $criteria->setDbName(FeatureProdPeer::DATABASE_NAME);
1161:
1162: if ($con === null) {
1163: $con = Propel::getConnection(FeatureProdPeer::DATABASE_NAME, Propel::CONNECTION_READ);
1164: }
1165:
1166: $criteria->addJoin(FeatureProdPeer::PRODUCT_ID, ProductPeer::ID, $join_behavior);
1167:
1168: $criteria->addJoin(FeatureProdPeer::FEATURE_ID, FeaturePeer::ID, $join_behavior);
1169:
1170: $stmt = BasePeer::doCount($criteria, $con);
1171:
1172: if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
1173: $count = (int) $row[0];
1174: } else {
1175: $count = 0;
1176: }
1177: $stmt->closeCursor();
1178:
1179: return $count;
1180: }
1181:
1182:
1183: 1184: 1185: 1186: 1187: 1188: 1189: 1190: 1191: 1192:
1193: public static function doSelectJoinAllExceptProduct(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
1194: {
1195: $criteria = clone $criteria;
1196:
1197:
1198:
1199:
1200: if ($criteria->getDbName() == Propel::getDefaultDB()) {
1201: $criteria->setDbName(FeatureProdPeer::DATABASE_NAME);
1202: }
1203:
1204: FeatureProdPeer::addSelectColumns($criteria);
1205: $startcol2 = FeatureProdPeer::NUM_HYDRATE_COLUMNS;
1206:
1207: FeaturePeer::addSelectColumns($criteria);
1208: $startcol3 = $startcol2 + FeaturePeer::NUM_HYDRATE_COLUMNS;
1209:
1210: FeatureAvPeer::addSelectColumns($criteria);
1211: $startcol4 = $startcol3 + FeatureAvPeer::NUM_HYDRATE_COLUMNS;
1212:
1213: $criteria->addJoin(FeatureProdPeer::FEATURE_ID, FeaturePeer::ID, $join_behavior);
1214:
1215: $criteria->addJoin(FeatureProdPeer::FEATURE_AV_ID, FeatureAvPeer::ID, $join_behavior);
1216:
1217:
1218: $stmt = BasePeer::doSelect($criteria, $con);
1219: $results = array();
1220:
1221: while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
1222: $key1 = FeatureProdPeer::getPrimaryKeyHashFromRow($row, 0);
1223: if (null !== ($obj1 = FeatureProdPeer::getInstanceFromPool($key1))) {
1224:
1225:
1226:
1227: } else {
1228: $cls = FeatureProdPeer::getOMClass();
1229:
1230: $obj1 = new $cls();
1231: $obj1->hydrate($row);
1232: FeatureProdPeer::addInstanceToPool($obj1, $key1);
1233: }
1234:
1235:
1236:
1237: $key2 = FeaturePeer::getPrimaryKeyHashFromRow($row, $startcol2);
1238: if ($key2 !== null) {
1239: $obj2 = FeaturePeer::getInstanceFromPool($key2);
1240: if (!$obj2) {
1241:
1242: $cls = FeaturePeer::getOMClass();
1243:
1244: $obj2 = new $cls();
1245: $obj2->hydrate($row, $startcol2);
1246: FeaturePeer::addInstanceToPool($obj2, $key2);
1247: }
1248:
1249:
1250: $obj2->addFeatureProd($obj1);
1251:
1252: }
1253:
1254:
1255:
1256: $key3 = FeatureAvPeer::getPrimaryKeyHashFromRow($row, $startcol3);
1257: if ($key3 !== null) {
1258: $obj3 = FeatureAvPeer::getInstanceFromPool($key3);
1259: if (!$obj3) {
1260:
1261: $cls = FeatureAvPeer::getOMClass();
1262:
1263: $obj3 = new $cls();
1264: $obj3->hydrate($row, $startcol3);
1265: FeatureAvPeer::addInstanceToPool($obj3, $key3);
1266: }
1267:
1268:
1269: $obj3->addFeatureProd($obj1);
1270:
1271: }
1272:
1273: $results[] = $obj1;
1274: }
1275: $stmt->closeCursor();
1276:
1277: return $results;
1278: }
1279:
1280:
1281: 1282: 1283: 1284: 1285: 1286: 1287: 1288: 1289: 1290:
1291: public static function doSelectJoinAllExceptFeature(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
1292: {
1293: $criteria = clone $criteria;
1294:
1295:
1296:
1297:
1298: if ($criteria->getDbName() == Propel::getDefaultDB()) {
1299: $criteria->setDbName(FeatureProdPeer::DATABASE_NAME);
1300: }
1301:
1302: FeatureProdPeer::addSelectColumns($criteria);
1303: $startcol2 = FeatureProdPeer::NUM_HYDRATE_COLUMNS;
1304:
1305: ProductPeer::addSelectColumns($criteria);
1306: $startcol3 = $startcol2 + ProductPeer::NUM_HYDRATE_COLUMNS;
1307:
1308: FeatureAvPeer::addSelectColumns($criteria);
1309: $startcol4 = $startcol3 + FeatureAvPeer::NUM_HYDRATE_COLUMNS;
1310:
1311: $criteria->addJoin(FeatureProdPeer::PRODUCT_ID, ProductPeer::ID, $join_behavior);
1312:
1313: $criteria->addJoin(FeatureProdPeer::FEATURE_AV_ID, FeatureAvPeer::ID, $join_behavior);
1314:
1315:
1316: $stmt = BasePeer::doSelect($criteria, $con);
1317: $results = array();
1318:
1319: while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
1320: $key1 = FeatureProdPeer::getPrimaryKeyHashFromRow($row, 0);
1321: if (null !== ($obj1 = FeatureProdPeer::getInstanceFromPool($key1))) {
1322:
1323:
1324:
1325: } else {
1326: $cls = FeatureProdPeer::getOMClass();
1327:
1328: $obj1 = new $cls();
1329: $obj1->hydrate($row);
1330: FeatureProdPeer::addInstanceToPool($obj1, $key1);
1331: }
1332:
1333:
1334:
1335: $key2 = ProductPeer::getPrimaryKeyHashFromRow($row, $startcol2);
1336: if ($key2 !== null) {
1337: $obj2 = ProductPeer::getInstanceFromPool($key2);
1338: if (!$obj2) {
1339:
1340: $cls = ProductPeer::getOMClass();
1341:
1342: $obj2 = new $cls();
1343: $obj2->hydrate($row, $startcol2);
1344: ProductPeer::addInstanceToPool($obj2, $key2);
1345: }
1346:
1347:
1348: $obj2->addFeatureProd($obj1);
1349:
1350: }
1351:
1352:
1353:
1354: $key3 = FeatureAvPeer::getPrimaryKeyHashFromRow($row, $startcol3);
1355: if ($key3 !== null) {
1356: $obj3 = FeatureAvPeer::getInstanceFromPool($key3);
1357: if (!$obj3) {
1358:
1359: $cls = FeatureAvPeer::getOMClass();
1360:
1361: $obj3 = new $cls();
1362: $obj3->hydrate($row, $startcol3);
1363: FeatureAvPeer::addInstanceToPool($obj3, $key3);
1364: }
1365:
1366:
1367: $obj3->addFeatureProd($obj1);
1368:
1369: }
1370:
1371: $results[] = $obj1;
1372: }
1373: $stmt->closeCursor();
1374:
1375: return $results;
1376: }
1377:
1378:
1379: 1380: 1381: 1382: 1383: 1384: 1385: 1386: 1387: 1388:
1389: public static function doSelectJoinAllExceptFeatureAv(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
1390: {
1391: $criteria = clone $criteria;
1392:
1393:
1394:
1395:
1396: if ($criteria->getDbName() == Propel::getDefaultDB()) {
1397: $criteria->setDbName(FeatureProdPeer::DATABASE_NAME);
1398: }
1399:
1400: FeatureProdPeer::addSelectColumns($criteria);
1401: $startcol2 = FeatureProdPeer::NUM_HYDRATE_COLUMNS;
1402:
1403: ProductPeer::addSelectColumns($criteria);
1404: $startcol3 = $startcol2 + ProductPeer::NUM_HYDRATE_COLUMNS;
1405:
1406: FeaturePeer::addSelectColumns($criteria);
1407: $startcol4 = $startcol3 + FeaturePeer::NUM_HYDRATE_COLUMNS;
1408:
1409: $criteria->addJoin(FeatureProdPeer::PRODUCT_ID, ProductPeer::ID, $join_behavior);
1410:
1411: $criteria->addJoin(FeatureProdPeer::FEATURE_ID, FeaturePeer::ID, $join_behavior);
1412:
1413:
1414: $stmt = BasePeer::doSelect($criteria, $con);
1415: $results = array();
1416:
1417: while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
1418: $key1 = FeatureProdPeer::getPrimaryKeyHashFromRow($row, 0);
1419: if (null !== ($obj1 = FeatureProdPeer::getInstanceFromPool($key1))) {
1420:
1421:
1422:
1423: } else {
1424: $cls = FeatureProdPeer::getOMClass();
1425:
1426: $obj1 = new $cls();
1427: $obj1->hydrate($row);
1428: FeatureProdPeer::addInstanceToPool($obj1, $key1);
1429: }
1430:
1431:
1432:
1433: $key2 = ProductPeer::getPrimaryKeyHashFromRow($row, $startcol2);
1434: if ($key2 !== null) {
1435: $obj2 = ProductPeer::getInstanceFromPool($key2);
1436: if (!$obj2) {
1437:
1438: $cls = ProductPeer::getOMClass();
1439:
1440: $obj2 = new $cls();
1441: $obj2->hydrate($row, $startcol2);
1442: ProductPeer::addInstanceToPool($obj2, $key2);
1443: }
1444:
1445:
1446: $obj2->addFeatureProd($obj1);
1447:
1448: }
1449:
1450:
1451:
1452: $key3 = FeaturePeer::getPrimaryKeyHashFromRow($row, $startcol3);
1453: if ($key3 !== null) {
1454: $obj3 = FeaturePeer::getInstanceFromPool($key3);
1455: if (!$obj3) {
1456:
1457: $cls = FeaturePeer::getOMClass();
1458:
1459: $obj3 = new $cls();
1460: $obj3->hydrate($row, $startcol3);
1461: FeaturePeer::addInstanceToPool($obj3, $key3);
1462: }
1463:
1464:
1465: $obj3->addFeatureProd($obj1);
1466:
1467: }
1468:
1469: $results[] = $obj1;
1470: }
1471: $stmt->closeCursor();
1472:
1473: return $results;
1474: }
1475:
1476: 1477: 1478: 1479: 1480: 1481: 1482:
1483: public static function getTableMap()
1484: {
1485: return Propel::getDatabaseMap(FeatureProdPeer::DATABASE_NAME)->getTable(FeatureProdPeer::TABLE_NAME);
1486: }
1487:
1488: 1489: 1490:
1491: public static function buildTableMap()
1492: {
1493: $dbMap = Propel::getDatabaseMap(BaseFeatureProdPeer::DATABASE_NAME);
1494: if (!$dbMap->hasTable(BaseFeatureProdPeer::TABLE_NAME)) {
1495: $dbMap->addTableObject(new FeatureProdTableMap());
1496: }
1497: }
1498:
1499: 1500: 1501: 1502: 1503: 1504:
1505: public static function getOMClass()
1506: {
1507: return FeatureProdPeer::OM_CLASS;
1508: }
1509:
1510: 1511: 1512: 1513: 1514: 1515: 1516: 1517: 1518:
1519: public static function doInsert($values, PropelPDO $con = null)
1520: {
1521: if ($con === null) {
1522: $con = Propel::getConnection(FeatureProdPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
1523: }
1524:
1525: if ($values instanceof Criteria) {
1526: $criteria = clone $values;
1527: } else {
1528: $criteria = $values->buildCriteria();
1529: }
1530:
1531: if ($criteria->containsKey(FeatureProdPeer::ID) && $criteria->keyContainsValue(FeatureProdPeer::ID) ) {
1532: throw new PropelException('Cannot insert a value for auto-increment primary key ('.FeatureProdPeer::ID.')');
1533: }
1534:
1535:
1536:
1537: $criteria->setDbName(FeatureProdPeer::DATABASE_NAME);
1538:
1539: try {
1540:
1541:
1542: $con->beginTransaction();
1543: $pk = BasePeer::doInsert($criteria, $con);
1544: $con->commit();
1545: } catch (PropelException $e) {
1546: $con->rollBack();
1547: throw $e;
1548: }
1549:
1550: return $pk;
1551: }
1552:
1553: 1554: 1555: 1556: 1557: 1558: 1559: 1560: 1561:
1562: public static function doUpdate($values, PropelPDO $con = null)
1563: {
1564: if ($con === null) {
1565: $con = Propel::getConnection(FeatureProdPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
1566: }
1567:
1568: $selectCriteria = new Criteria(FeatureProdPeer::DATABASE_NAME);
1569:
1570: if ($values instanceof Criteria) {
1571: $criteria = clone $values;
1572:
1573: $comparison = $criteria->getComparison(FeatureProdPeer::ID);
1574: $value = $criteria->remove(FeatureProdPeer::ID);
1575: if ($value) {
1576: $selectCriteria->add(FeatureProdPeer::ID, $value, $comparison);
1577: } else {
1578: $selectCriteria->setPrimaryTableName(FeatureProdPeer::TABLE_NAME);
1579: }
1580:
1581: } else {
1582: $criteria = $values->buildCriteria();
1583: $selectCriteria = $values->buildPkeyCriteria();
1584: }
1585:
1586:
1587: $criteria->setDbName(FeatureProdPeer::DATABASE_NAME);
1588:
1589: return BasePeer::doUpdate($selectCriteria, $criteria, $con);
1590: }
1591:
1592: 1593: 1594: 1595: 1596: 1597: 1598:
1599: public static function doDeleteAll(PropelPDO $con = null)
1600: {
1601: if ($con === null) {
1602: $con = Propel::getConnection(FeatureProdPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
1603: }
1604: $affectedRows = 0;
1605: try {
1606:
1607:
1608: $con->beginTransaction();
1609: $affectedRows += BasePeer::doDeleteAll(FeatureProdPeer::TABLE_NAME, $con, FeatureProdPeer::DATABASE_NAME);
1610:
1611:
1612:
1613: FeatureProdPeer::clearInstancePool();
1614: FeatureProdPeer::clearRelatedInstancePool();
1615: $con->commit();
1616:
1617: return $affectedRows;
1618: } catch (PropelException $e) {
1619: $con->rollBack();
1620: throw $e;
1621: }
1622: }
1623:
1624: 1625: 1626: 1627: 1628: 1629: 1630: 1631: 1632: 1633: 1634:
1635: public static function doDelete($values, PropelPDO $con = null)
1636: {
1637: if ($con === null) {
1638: $con = Propel::getConnection(FeatureProdPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
1639: }
1640:
1641: if ($values instanceof Criteria) {
1642:
1643:
1644:
1645: FeatureProdPeer::clearInstancePool();
1646:
1647: $criteria = clone $values;
1648: } elseif ($values instanceof FeatureProd) {
1649:
1650: FeatureProdPeer::removeInstanceFromPool($values);
1651:
1652: $criteria = $values->buildPkeyCriteria();
1653: } else {
1654: $criteria = new Criteria(FeatureProdPeer::DATABASE_NAME);
1655: $criteria->add(FeatureProdPeer::ID, (array) $values, Criteria::IN);
1656:
1657: foreach ((array) $values as $singleval) {
1658: FeatureProdPeer::removeInstanceFromPool($singleval);
1659: }
1660: }
1661:
1662:
1663: $criteria->setDbName(FeatureProdPeer::DATABASE_NAME);
1664:
1665: $affectedRows = 0;
1666:
1667: try {
1668:
1669:
1670: $con->beginTransaction();
1671:
1672: $affectedRows += BasePeer::doDelete($criteria, $con);
1673: FeatureProdPeer::clearRelatedInstancePool();
1674: $con->commit();
1675:
1676: return $affectedRows;
1677: } catch (PropelException $e) {
1678: $con->rollBack();
1679: throw $e;
1680: }
1681: }
1682:
1683: 1684: 1685: 1686: 1687: 1688: 1689: 1690: 1691: 1692: 1693: 1694:
1695: public static function doValidate($obj, $cols = null)
1696: {
1697: $columns = array();
1698:
1699: if ($cols) {
1700: $dbMap = Propel::getDatabaseMap(FeatureProdPeer::DATABASE_NAME);
1701: $tableMap = $dbMap->getTable(FeatureProdPeer::TABLE_NAME);
1702:
1703: if (! is_array($cols)) {
1704: $cols = array($cols);
1705: }
1706:
1707: foreach ($cols as $colName) {
1708: if ($tableMap->hasColumn($colName)) {
1709: $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
1710: $columns[$colName] = $obj->$get();
1711: }
1712: }
1713: } else {
1714:
1715: }
1716:
1717: return BasePeer::doValidate(FeatureProdPeer::DATABASE_NAME, FeatureProdPeer::TABLE_NAME, $columns);
1718: }
1719:
1720: 1721: 1722: 1723: 1724: 1725: 1726:
1727: public static function retrieveByPK($pk, PropelPDO $con = null)
1728: {
1729:
1730: if (null !== ($obj = FeatureProdPeer::getInstanceFromPool((string) $pk))) {
1731: return $obj;
1732: }
1733:
1734: if ($con === null) {
1735: $con = Propel::getConnection(FeatureProdPeer::DATABASE_NAME, Propel::CONNECTION_READ);
1736: }
1737:
1738: $criteria = new Criteria(FeatureProdPeer::DATABASE_NAME);
1739: $criteria->add(FeatureProdPeer::ID, $pk);
1740:
1741: $v = FeatureProdPeer::doSelect($criteria, $con);
1742:
1743: return !empty($v) > 0 ? $v[0] : null;
1744: }
1745:
1746: 1747: 1748: 1749: 1750: 1751: 1752: 1753: 1754:
1755: public static function retrieveByPKs($pks, PropelPDO $con = null)
1756: {
1757: if ($con === null) {
1758: $con = Propel::getConnection(FeatureProdPeer::DATABASE_NAME, Propel::CONNECTION_READ);
1759: }
1760:
1761: $objs = null;
1762: if (empty($pks)) {
1763: $objs = array();
1764: } else {
1765: $criteria = new Criteria(FeatureProdPeer::DATABASE_NAME);
1766: $criteria->add(FeatureProdPeer::ID, $pks, Criteria::IN);
1767: $objs = FeatureProdPeer::doSelect($criteria, $con);
1768: }
1769:
1770: return $objs;
1771: }
1772:
1773: }
1774:
1775:
1776:
1777: BaseFeatureProdPeer::buildTableMap();
1778:
1779: