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