Overview

Namespaces

  • PHP
  • Thelia
    • Action
    • Controller
    • Core
      • Bundle
      • Event
      • EventListener
      • Template
    • Exception
    • Log
      • Destination
    • Model
      • map
      • om
    • Routing
      • Matcher
    • Tools

Classes

  • BaseAccessory
  • BaseAccessoryPeer
  • BaseAccessoryQuery
  • BaseAddress
  • BaseAddressPeer
  • BaseAddressQuery
  • BaseAdmin
  • BaseAdminGroup
  • BaseAdminGroupPeer
  • BaseAdminGroupQuery
  • BaseAdminLog
  • BaseAdminLogPeer
  • BaseAdminLogQuery
  • BaseAdminPeer
  • BaseAdminQuery
  • BaseArea
  • BaseAreaPeer
  • BaseAreaQuery
  • BaseAttribute
  • BaseAttributeAv
  • BaseAttributeAvDesc
  • BaseAttributeAvDescPeer
  • BaseAttributeAvDescQuery
  • BaseAttributeAvI18n
  • BaseAttributeAvI18nPeer
  • BaseAttributeAvI18nQuery
  • BaseAttributeAvPeer
  • BaseAttributeAvQuery
  • BaseAttributeCategory
  • BaseAttributeCategoryPeer
  • BaseAttributeCategoryQuery
  • BaseAttributeCombination
  • BaseAttributeCombinationPeer
  • BaseAttributeCombinationQuery
  • BaseAttributeDesc
  • BaseAttributeDescPeer
  • BaseAttributeDescQuery
  • BaseAttributeI18n
  • BaseAttributeI18nPeer
  • BaseAttributeI18nQuery
  • BaseAttributePeer
  • BaseAttributeQuery
  • BaseCategory
  • BaseCategoryDesc
  • BaseCategoryDescPeer
  • BaseCategoryDescQuery
  • BaseCategoryI18n
  • BaseCategoryI18nPeer
  • BaseCategoryI18nQuery
  • BaseCategoryPeer
  • BaseCategoryQuery
  • BaseCategoryVersion
  • BaseCategoryVersionPeer
  • BaseCategoryVersionQuery
  • BaseCombination
  • BaseCombinationPeer
  • BaseCombinationQuery
  • BaseConfig
  • BaseConfigDesc
  • BaseConfigDescPeer
  • BaseConfigDescQuery
  • BaseConfigI18n
  • BaseConfigI18nPeer
  • BaseConfigI18nQuery
  • BaseConfigPeer
  • BaseConfigQuery
  • BaseContent
  • BaseContentAssoc
  • BaseContentAssocPeer
  • BaseContentAssocQuery
  • BaseContentDesc
  • BaseContentDescPeer
  • BaseContentDescQuery
  • BaseContentFolder
  • BaseContentFolderPeer
  • BaseContentFolderQuery
  • BaseContentI18n
  • BaseContentI18nPeer
  • BaseContentI18nQuery
  • BaseContentPeer
  • BaseContentQuery
  • BaseContentVersion
  • BaseContentVersionPeer
  • BaseContentVersionQuery
  • BaseCountry
  • BaseCountryDesc
  • BaseCountryDescPeer
  • BaseCountryDescQuery
  • BaseCountryI18n
  • BaseCountryI18nPeer
  • BaseCountryI18nQuery
  • BaseCountryPeer
  • BaseCountryQuery
  • BaseCoupon
  • BaseCouponOrder
  • BaseCouponOrderPeer
  • BaseCouponOrderQuery
  • BaseCouponPeer
  • BaseCouponQuery
  • BaseCouponRule
  • BaseCouponRulePeer
  • BaseCouponRuleQuery
  • BaseCurrency
  • BaseCurrencyPeer
  • BaseCurrencyQuery
  • BaseCustomer
  • BaseCustomerPeer
  • BaseCustomerQuery
  • BaseCustomerTitle
  • BaseCustomerTitleDesc
  • BaseCustomerTitleDescPeer
  • BaseCustomerTitleDescQuery
  • BaseCustomerTitleI18n
  • BaseCustomerTitleI18nPeer
  • BaseCustomerTitleI18nQuery
  • BaseCustomerTitlePeer
  • BaseCustomerTitleQuery
  • BaseDelivzone
  • BaseDelivzonePeer
  • BaseDelivzoneQuery
  • BaseDocument
  • BaseDocumentDesc
  • BaseDocumentDescPeer
  • BaseDocumentDescQuery
  • BaseDocumentI18n
  • BaseDocumentI18nPeer
  • BaseDocumentI18nQuery
  • BaseDocumentPeer
  • BaseDocumentQuery
  • BaseFeature
  • BaseFeatureAv
  • BaseFeatureAvDesc
  • BaseFeatureAvDescPeer
  • BaseFeatureAvDescQuery
  • BaseFeatureAvI18n
  • BaseFeatureAvI18nPeer
  • BaseFeatureAvI18nQuery
  • BaseFeatureAvPeer
  • BaseFeatureAvQuery
  • BaseFeatureCategory
  • BaseFeatureCategoryPeer
  • BaseFeatureCategoryQuery
  • BaseFeatureDesc
  • BaseFeatureDescPeer
  • BaseFeatureDescQuery
  • BaseFeatureI18n
  • BaseFeatureI18nPeer
  • BaseFeatureI18nQuery
  • BaseFeaturePeer
  • BaseFeatureProd
  • BaseFeatureProdPeer
  • BaseFeatureProdQuery
  • BaseFeatureQuery
  • BaseFolder
  • BaseFolderDesc
  • BaseFolderDescPeer
  • BaseFolderDescQuery
  • BaseFolderI18n
  • BaseFolderI18nPeer
  • BaseFolderI18nQuery
  • BaseFolderPeer
  • BaseFolderQuery
  • BaseFolderVersion
  • BaseFolderVersionPeer
  • BaseFolderVersionQuery
  • BaseGroup
  • BaseGroupDesc
  • BaseGroupDescPeer
  • BaseGroupDescQuery
  • BaseGroupI18n
  • BaseGroupI18nPeer
  • BaseGroupI18nQuery
  • BaseGroupModule
  • BaseGroupModulePeer
  • BaseGroupModuleQuery
  • BaseGroupPeer
  • BaseGroupQuery
  • BaseGroupResource
  • BaseGroupResourcePeer
  • BaseGroupResourceQuery
  • BaseImage
  • BaseImageDesc
  • BaseImageDescPeer
  • BaseImageDescQuery
  • BaseImageI18n
  • BaseImageI18nPeer
  • BaseImageI18nQuery
  • BaseImagePeer
  • BaseImageQuery
  • BaseLang
  • BaseLangPeer
  • BaseLangQuery
  • BaseMessage
  • BaseMessageDesc
  • BaseMessageDescPeer
  • BaseMessageDescQuery
  • BaseMessageI18n
  • BaseMessageI18nPeer
  • BaseMessageI18nQuery
  • BaseMessagePeer
  • BaseMessageQuery
  • BaseMessageVersion
  • BaseMessageVersionPeer
  • BaseMessageVersionQuery
  • BaseModuleDesc
  • BaseModuleDescPeer
  • BaseModuleDescQuery
  • BaseModuleI18n
  • BaseModuleI18nPeer
  • BaseModuleI18nQuery
  • BaseModulePeer
  • BaseOrder
  • BaseOrderAddress
  • BaseOrderAddressPeer
  • BaseOrderAddressQuery
  • BaseOrderFeature
  • BaseOrderFeaturePeer
  • BaseOrderFeatureQuery
  • BaseOrderPeer
  • BaseOrderProduct
  • BaseOrderProductPeer
  • BaseOrderProductQuery
  • BaseOrderQuery
  • BaseOrderStatus
  • BaseOrderStatusDesc
  • BaseOrderStatusDescPeer
  • BaseOrderStatusDescQuery
  • BaseOrderStatusI18n
  • BaseOrderStatusI18nPeer
  • BaseOrderStatusI18nQuery
  • BaseOrderStatusPeer
  • BaseOrderStatusQuery
  • BaseProduct
  • BaseProductCategory
  • BaseProductCategoryPeer
  • BaseProductCategoryQuery
  • BaseProductDesc
  • BaseProductDescPeer
  • BaseProductDescQuery
  • BaseProductI18n
  • BaseProductI18nPeer
  • BaseProductI18nQuery
  • BaseProductPeer
  • BaseProductQuery
  • BaseProductVersion
  • BaseProductVersionPeer
  • BaseProductVersionQuery
  • BaseResource
  • BaseResourceDesc
  • BaseResourceDescPeer
  • BaseResourceDescQuery
  • BaseResourceI18n
  • BaseResourceI18nPeer
  • BaseResourceI18nQuery
  • BaseResourcePeer
  • BaseResourceQuery
  • BaseRewriting
  • BaseRewritingPeer
  • BaseRewritingQuery
  • BaseStock
  • BaseStockPeer
  • BaseStockQuery
  • BaseTax
  • BaseTaxDesc
  • BaseTaxDescPeer
  • BaseTaxDescQuery
  • BaseTaxI18n
  • BaseTaxI18nPeer
  • BaseTaxI18nQuery
  • BaseTaxPeer
  • BaseTaxQuery
  • BaseTaxRule
  • BaseTaxRuleCountry
  • BaseTaxRuleCountryPeer
  • BaseTaxRuleCountryQuery
  • BaseTaxRuleDesc
  • BaseTaxRuleDescPeer
  • BaseTaxRuleDescQuery
  • BaseTaxRuleI18n
  • BaseTaxRuleI18nPeer
  • BaseTaxRuleI18nQuery
  • BaseTaxRulePeer
  • BaseTaxRuleQuery
  • Overview
  • Namespace
  • Class
  • Tree
   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\AttributeAvPeer;
  13: use Thelia\Model\AttributeCombination;
  14: use Thelia\Model\AttributeCombinationPeer;
  15: use Thelia\Model\AttributePeer;
  16: use Thelia\Model\CombinationPeer;
  17: use Thelia\Model\map\AttributeCombinationTableMap;
  18: 
  19: /**
  20:  * Base static class for performing query and update operations on the 'attribute_combination' table.
  21:  *
  22:  *
  23:  *
  24:  * @package propel.generator.Thelia.Model.om
  25:  */
  26: abstract class BaseAttributeCombinationPeer
  27: {
  28: 
  29:     /** the default database name for this class */
  30:     const DATABASE_NAME = 'thelia';
  31: 
  32:     /** the table name for this class */
  33:     const TABLE_NAME = 'attribute_combination';
  34: 
  35:     /** the related Propel class for this table */
  36:     const OM_CLASS = 'Thelia\\Model\\AttributeCombination';
  37: 
  38:     /** the related TableMap class for this table */
  39:     const TM_CLASS = 'AttributeCombinationTableMap';
  40: 
  41:     /** The total number of columns. */
  42:     const NUM_COLUMNS = 6;
  43: 
  44:     /** The number of lazy-loaded columns. */
  45:     const NUM_LAZY_LOAD_COLUMNS = 0;
  46: 
  47:     /** The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS) */
  48:     const NUM_HYDRATE_COLUMNS = 6;
  49: 
  50:     /** the column name for the ID field */
  51:     const ID = 'attribute_combination.ID';
  52: 
  53:     /** the column name for the ATTRIBUTE_ID field */
  54:     const ATTRIBUTE_ID = 'attribute_combination.ATTRIBUTE_ID';
  55: 
  56:     /** the column name for the COMBINATION_ID field */
  57:     const COMBINATION_ID = 'attribute_combination.COMBINATION_ID';
  58: 
  59:     /** the column name for the ATTRIBUTE_AV_ID field */
  60:     const ATTRIBUTE_AV_ID = 'attribute_combination.ATTRIBUTE_AV_ID';
  61: 
  62:     /** the column name for the CREATED_AT field */
  63:     const CREATED_AT = 'attribute_combination.CREATED_AT';
  64: 
  65:     /** the column name for the UPDATED_AT field */
  66:     const UPDATED_AT = 'attribute_combination.UPDATED_AT';
  67: 
  68:     /** The default string format for model objects of the related table **/
  69:     const DEFAULT_STRING_FORMAT = 'YAML';
  70: 
  71:     /**
  72:      * An identiy map to hold any loaded instances of AttributeCombination objects.
  73:      * This must be public so that other peer classes can access this when hydrating from JOIN
  74:      * queries.
  75:      * @var        array AttributeCombination[]
  76:      */
  77:     public static $instances = array();
  78: 
  79: 
  80:     /**
  81:      * holds an array of fieldnames
  82:      *
  83:      * first dimension keys are the type constants
  84:      * e.g. AttributeCombinationPeer::$fieldNames[AttributeCombinationPeer::TYPE_PHPNAME][0] = 'Id'
  85:      */
  86:     protected static $fieldNames = array (
  87:         BasePeer::TYPE_PHPNAME => array ('Id', 'AttributeId', 'CombinationId', 'AttributeAvId', 'CreatedAt', 'UpdatedAt', ),
  88:         BasePeer::TYPE_STUDLYPHPNAME => array ('id', 'attributeId', 'combinationId', 'attributeAvId', 'createdAt', 'updatedAt', ),
  89:         BasePeer::TYPE_COLNAME => array (AttributeCombinationPeer::ID, AttributeCombinationPeer::ATTRIBUTE_ID, AttributeCombinationPeer::COMBINATION_ID, AttributeCombinationPeer::ATTRIBUTE_AV_ID, AttributeCombinationPeer::CREATED_AT, AttributeCombinationPeer::UPDATED_AT, ),
  90:         BasePeer::TYPE_RAW_COLNAME => array ('ID', 'ATTRIBUTE_ID', 'COMBINATION_ID', 'ATTRIBUTE_AV_ID', 'CREATED_AT', 'UPDATED_AT', ),
  91:         BasePeer::TYPE_FIELDNAME => array ('id', 'attribute_id', 'combination_id', 'attribute_av_id', 'created_at', 'updated_at', ),
  92:         BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, )
  93:     );
  94: 
  95:     /**
  96:      * holds an array of keys for quick access to the fieldnames array
  97:      *
  98:      * first dimension keys are the type constants
  99:      * e.g. AttributeCombinationPeer::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
 100:      */
 101:     protected static $fieldKeys = array (
 102:         BasePeer::TYPE_PHPNAME => array ('Id' => 0, 'AttributeId' => 1, 'CombinationId' => 2, 'AttributeAvId' => 3, 'CreatedAt' => 4, 'UpdatedAt' => 5, ),
 103:         BasePeer::TYPE_STUDLYPHPNAME => array ('id' => 0, 'attributeId' => 1, 'combinationId' => 2, 'attributeAvId' => 3, 'createdAt' => 4, 'updatedAt' => 5, ),
 104:         BasePeer::TYPE_COLNAME => array (AttributeCombinationPeer::ID => 0, AttributeCombinationPeer::ATTRIBUTE_ID => 1, AttributeCombinationPeer::COMBINATION_ID => 2, AttributeCombinationPeer::ATTRIBUTE_AV_ID => 3, AttributeCombinationPeer::CREATED_AT => 4, AttributeCombinationPeer::UPDATED_AT => 5, ),
 105:         BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'ATTRIBUTE_ID' => 1, 'COMBINATION_ID' => 2, 'ATTRIBUTE_AV_ID' => 3, 'CREATED_AT' => 4, 'UPDATED_AT' => 5, ),
 106:         BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'attribute_id' => 1, 'combination_id' => 2, 'attribute_av_id' => 3, 'created_at' => 4, 'updated_at' => 5, ),
 107:         BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, )
 108:     );
 109: 
 110:     /**
 111:      * Translates a fieldname to another type
 112:      *
 113:      * @param      string $name field name
 114:      * @param      string $fromType One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
 115:      *                         BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
 116:      * @param      string $toType   One of the class type constants
 117:      * @return string          translated name of the field.
 118:      * @throws PropelException - if the specified name could not be found in the fieldname mappings.
 119:      */
 120:     public static function translateFieldName($name, $fromType, $toType)
 121:     {
 122:         $toNames = AttributeCombinationPeer::getFieldNames($toType);
 123:         $key = isset(AttributeCombinationPeer::$fieldKeys[$fromType][$name]) ? AttributeCombinationPeer::$fieldKeys[$fromType][$name] : null;
 124:         if ($key === null) {
 125:             throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(AttributeCombinationPeer::$fieldKeys[$fromType], true));
 126:         }
 127: 
 128:         return $toNames[$key];
 129:     }
 130: 
 131:     /**
 132:      * Returns an array of field names.
 133:      *
 134:      * @param      string $type The type of fieldnames to return:
 135:      *                      One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
 136:      *                      BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
 137:      * @return array           A list of field names
 138:      * @throws PropelException - if the type is not valid.
 139:      */
 140:     public static function getFieldNames($type = BasePeer::TYPE_PHPNAME)
 141:     {
 142:         if (!array_key_exists($type, AttributeCombinationPeer::$fieldNames)) {
 143:             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.');
 144:         }
 145: 
 146:         return AttributeCombinationPeer::$fieldNames[$type];
 147:     }
 148: 
 149:     /**
 150:      * Convenience method which changes table.column to alias.column.
 151:      *
 152:      * Using this method you can maintain SQL abstraction while using column aliases.
 153:      * <code>
 154:      *      $c->addAlias("alias1", TablePeer::TABLE_NAME);
 155:      *      $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
 156:      * </code>
 157:      * @param      string $alias The alias for the current table.
 158:      * @param      string $column The column name for current table. (i.e. AttributeCombinationPeer::COLUMN_NAME).
 159:      * @return string
 160:      */
 161:     public static function alias($alias, $column)
 162:     {
 163:         return str_replace(AttributeCombinationPeer::TABLE_NAME.'.', $alias.'.', $column);
 164:     }
 165: 
 166:     /**
 167:      * Add all the columns needed to create a new object.
 168:      *
 169:      * Note: any columns that were marked with lazyLoad="true" in the
 170:      * XML schema will not be added to the select list and only loaded
 171:      * on demand.
 172:      *
 173:      * @param      Criteria $criteria object containing the columns to add.
 174:      * @param      string   $alias    optional table alias
 175:      * @throws PropelException Any exceptions caught during processing will be
 176:      *       rethrown wrapped into a PropelException.
 177:      */
 178:     public static function addSelectColumns(Criteria $criteria, $alias = null)
 179:     {
 180:         if (null === $alias) {
 181:             $criteria->addSelectColumn(AttributeCombinationPeer::ID);
 182:             $criteria->addSelectColumn(AttributeCombinationPeer::ATTRIBUTE_ID);
 183:             $criteria->addSelectColumn(AttributeCombinationPeer::COMBINATION_ID);
 184:             $criteria->addSelectColumn(AttributeCombinationPeer::ATTRIBUTE_AV_ID);
 185:             $criteria->addSelectColumn(AttributeCombinationPeer::CREATED_AT);
 186:             $criteria->addSelectColumn(AttributeCombinationPeer::UPDATED_AT);
 187:         } else {
 188:             $criteria->addSelectColumn($alias . '.ID');
 189:             $criteria->addSelectColumn($alias . '.ATTRIBUTE_ID');
 190:             $criteria->addSelectColumn($alias . '.COMBINATION_ID');
 191:             $criteria->addSelectColumn($alias . '.ATTRIBUTE_AV_ID');
 192:             $criteria->addSelectColumn($alias . '.CREATED_AT');
 193:             $criteria->addSelectColumn($alias . '.UPDATED_AT');
 194:         }
 195:     }
 196: 
 197:     /**
 198:      * Returns the number of rows matching criteria.
 199:      *
 200:      * @param      Criteria $criteria
 201:      * @param      boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
 202:      * @param      PropelPDO $con
 203:      * @return int Number of matching rows.
 204:      */
 205:     public static function doCount(Criteria $criteria, $distinct = false, PropelPDO $con = null)
 206:     {
 207:         // we may modify criteria, so copy it first
 208:         $criteria = clone $criteria;
 209: 
 210:         // We need to set the primary table name, since in the case that there are no WHERE columns
 211:         // it will be impossible for the BasePeer::createSelectSql() method to determine which
 212:         // tables go into the FROM clause.
 213:         $criteria->setPrimaryTableName(AttributeCombinationPeer::TABLE_NAME);
 214: 
 215:         if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
 216:             $criteria->setDistinct();
 217:         }
 218: 
 219:         if (!$criteria->hasSelectClause()) {
 220:             AttributeCombinationPeer::addSelectColumns($criteria);
 221:         }
 222: 
 223:         $criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count
 224:         $criteria->setDbName(AttributeCombinationPeer::DATABASE_NAME); // Set the correct dbName
 225: 
 226:         if ($con === null) {
 227:             $con = Propel::getConnection(AttributeCombinationPeer::DATABASE_NAME, Propel::CONNECTION_READ);
 228:         }
 229:         // BasePeer returns a PDOStatement
 230:         $stmt = BasePeer::doCount($criteria, $con);
 231: 
 232:         if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
 233:             $count = (int) $row[0];
 234:         } else {
 235:             $count = 0; // no rows returned; we infer that means 0 matches.
 236:         }
 237:         $stmt->closeCursor();
 238: 
 239:         return $count;
 240:     }
 241:     /**
 242:      * Selects one object from the DB.
 243:      *
 244:      * @param      Criteria $criteria object used to create the SELECT statement.
 245:      * @param      PropelPDO $con
 246:      * @return                 AttributeCombination
 247:      * @throws PropelException Any exceptions caught during processing will be
 248:      *       rethrown wrapped into a PropelException.
 249:      */
 250:     public static function doSelectOne(Criteria $criteria, PropelPDO $con = null)
 251:     {
 252:         $critcopy = clone $criteria;
 253:         $critcopy->setLimit(1);
 254:         $objects = AttributeCombinationPeer::doSelect($critcopy, $con);
 255:         if ($objects) {
 256:             return $objects[0];
 257:         }
 258: 
 259:         return null;
 260:     }
 261:     /**
 262:      * Selects several row from the DB.
 263:      *
 264:      * @param      Criteria $criteria The Criteria object used to build the SELECT statement.
 265:      * @param      PropelPDO $con
 266:      * @return array           Array of selected Objects
 267:      * @throws PropelException Any exceptions caught during processing will be
 268:      *       rethrown wrapped into a PropelException.
 269:      */
 270:     public static function doSelect(Criteria $criteria, PropelPDO $con = null)
 271:     {
 272:         return AttributeCombinationPeer::populateObjects(AttributeCombinationPeer::doSelectStmt($criteria, $con));
 273:     }
 274:     /**
 275:      * Prepares the Criteria object and uses the parent doSelect() method to execute a PDOStatement.
 276:      *
 277:      * Use this method directly if you want to work with an executed statement durirectly (for example
 278:      * to perform your own object hydration).
 279:      *
 280:      * @param      Criteria $criteria The Criteria object used to build the SELECT statement.
 281:      * @param      PropelPDO $con The connection to use
 282:      * @throws PropelException Any exceptions caught during processing will be
 283:      *       rethrown wrapped into a PropelException.
 284:      * @return PDOStatement The executed PDOStatement object.
 285:      * @see        BasePeer::doSelect()
 286:      */
 287:     public static function doSelectStmt(Criteria $criteria, PropelPDO $con = null)
 288:     {
 289:         if ($con === null) {
 290:             $con = Propel::getConnection(AttributeCombinationPeer::DATABASE_NAME, Propel::CONNECTION_READ);
 291:         }
 292: 
 293:         if (!$criteria->hasSelectClause()) {
 294:             $criteria = clone $criteria;
 295:             AttributeCombinationPeer::addSelectColumns($criteria);
 296:         }
 297: 
 298:         // Set the correct dbName
 299:         $criteria->setDbName(AttributeCombinationPeer::DATABASE_NAME);
 300: 
 301:         // BasePeer returns a PDOStatement
 302:         return BasePeer::doSelect($criteria, $con);
 303:     }
 304:     /**
 305:      * Adds an object to the instance pool.
 306:      *
 307:      * Propel keeps cached copies of objects in an instance pool when they are retrieved
 308:      * from the database.  In some cases -- especially when you override doSelect*()
 309:      * methods in your stub classes -- you may need to explicitly add objects
 310:      * to the cache in order to ensure that the same objects are always returned by doSelect*()
 311:      * and retrieveByPK*() calls.
 312:      *
 313:      * @param      AttributeCombination $obj A AttributeCombination object.
 314:      * @param      string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
 315:      */
 316:     public static function addInstanceToPool($obj, $key = null)
 317:     {
 318:         if (Propel::isInstancePoolingEnabled()) {
 319:             if ($key === null) {
 320:                 $key = serialize(array((string) $obj->getId(), (string) $obj->getAttributeId(), (string) $obj->getCombinationId(), (string) $obj->getAttributeAvId()));
 321:             } // if key === null
 322:             AttributeCombinationPeer::$instances[$key] = $obj;
 323:         }
 324:     }
 325: 
 326:     /**
 327:      * Removes an object from the instance pool.
 328:      *
 329:      * Propel keeps cached copies of objects in an instance pool when they are retrieved
 330:      * from the database.  In some cases -- especially when you override doDelete
 331:      * methods in your stub classes -- you may need to explicitly remove objects
 332:      * from the cache in order to prevent returning objects that no longer exist.
 333:      *
 334:      * @param      mixed $value A AttributeCombination object or a primary key value.
 335:      *
 336:      * @return void
 337:      * @throws PropelException - if the value is invalid.
 338:      */
 339:     public static function removeInstanceFromPool($value)
 340:     {
 341:         if (Propel::isInstancePoolingEnabled() && $value !== null) {
 342:             if (is_object($value) && $value instanceof AttributeCombination) {
 343:                 $key = serialize(array((string) $value->getId(), (string) $value->getAttributeId(), (string) $value->getCombinationId(), (string) $value->getAttributeAvId()));
 344:             } elseif (is_array($value) && count($value) === 4) {
 345:                 // assume we've been passed a primary key
 346:                 $key = serialize(array((string) $value[0], (string) $value[1], (string) $value[2], (string) $value[3]));
 347:             } else {
 348:                 $e = new PropelException("Invalid value passed to removeInstanceFromPool().  Expected primary key or AttributeCombination object; got " . (is_object($value) ? get_class($value) . ' object.' : var_export($value,true)));
 349:                 throw $e;
 350:             }
 351: 
 352:             unset(AttributeCombinationPeer::$instances[$key]);
 353:         }
 354:     } // removeInstanceFromPool()
 355: 
 356:     /**
 357:      * Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
 358:      *
 359:      * For tables with a single-column primary key, that simple pkey value will be returned.  For tables with
 360:      * a multi-column primary key, a serialize()d version of the primary key will be returned.
 361:      *
 362:      * @param      string $key The key (@see getPrimaryKeyHash()) for this instance.
 363:      * @return   AttributeCombination Found object or null if 1) no instance exists for specified key or 2) instance pooling has been disabled.
 364:      * @see        getPrimaryKeyHash()
 365:      */
 366:     public static function getInstanceFromPool($key)
 367:     {
 368:         if (Propel::isInstancePoolingEnabled()) {
 369:             if (isset(AttributeCombinationPeer::$instances[$key])) {
 370:                 return AttributeCombinationPeer::$instances[$key];
 371:             }
 372:         }
 373: 
 374:         return null; // just to be explicit
 375:     }
 376: 
 377:     /**
 378:      * Clear the instance pool.
 379:      *
 380:      * @return void
 381:      */
 382:     public static function clearInstancePool()
 383:     {
 384:         AttributeCombinationPeer::$instances = array();
 385:     }
 386: 
 387:     /**
 388:      * Method to invalidate the instance pool of all tables related to attribute_combination
 389:      * by a foreign key with ON DELETE CASCADE
 390:      */
 391:     public static function clearRelatedInstancePool()
 392:     {
 393:     }
 394: 
 395:     /**
 396:      * Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
 397:      *
 398:      * For tables with a single-column primary key, that simple pkey value will be returned.  For tables with
 399:      * a multi-column primary key, a serialize()d version of the primary key will be returned.
 400:      *
 401:      * @param      array $row PropelPDO resultset row.
 402:      * @param      int $startcol The 0-based offset for reading from the resultset row.
 403:      * @return string A string version of PK or null if the components of primary key in result array are all null.
 404:      */
 405:     public static function getPrimaryKeyHashFromRow($row, $startcol = 0)
 406:     {
 407:         // If the PK cannot be derived from the row, return null.
 408:         if ($row[$startcol] === null && $row[$startcol + 1] === null && $row[$startcol + 2] === null && $row[$startcol + 3] === null) {
 409:             return null;
 410:         }
 411: 
 412:         return serialize(array((string) $row[$startcol], (string) $row[$startcol + 1], (string) $row[$startcol + 2], (string) $row[$startcol + 3]));
 413:     }
 414: 
 415:     /**
 416:      * Retrieves the primary key from the DB resultset row
 417:      * For tables with a single-column primary key, that simple pkey value will be returned.  For tables with
 418:      * a multi-column primary key, an array of the primary key columns will be returned.
 419:      *
 420:      * @param      array $row PropelPDO resultset row.
 421:      * @param      int $startcol The 0-based offset for reading from the resultset row.
 422:      * @return mixed The primary key of the row
 423:      */
 424:     public static function getPrimaryKeyFromRow($row, $startcol = 0)
 425:     {
 426: 
 427:         return array((int) $row[$startcol], (int) $row[$startcol + 1], (int) $row[$startcol + 2], (int) $row[$startcol + 3]);
 428:     }
 429: 
 430:     /**
 431:      * The returned array will contain objects of the default type or
 432:      * objects that inherit from the default.
 433:      *
 434:      * @throws PropelException Any exceptions caught during processing will be
 435:      *       rethrown wrapped into a PropelException.
 436:      */
 437:     public static function populateObjects(PDOStatement $stmt)
 438:     {
 439:         $results = array();
 440: 
 441:         // set the class once to avoid overhead in the loop
 442:         $cls = AttributeCombinationPeer::getOMClass();
 443:         // populate the object(s)
 444:         while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
 445:             $key = AttributeCombinationPeer::getPrimaryKeyHashFromRow($row, 0);
 446:             if (null !== ($obj = AttributeCombinationPeer::getInstanceFromPool($key))) {
 447:                 // We no longer rehydrate the object, since this can cause data loss.
 448:                 // See http://www.propelorm.org/ticket/509
 449:                 // $obj->hydrate($row, 0, true); // rehydrate
 450:                 $results[] = $obj;
 451:             } else {
 452:                 $obj = new $cls();
 453:                 $obj->hydrate($row);
 454:                 $results[] = $obj;
 455:                 AttributeCombinationPeer::addInstanceToPool($obj, $key);
 456:             } // if key exists
 457:         }
 458:         $stmt->closeCursor();
 459: 
 460:         return $results;
 461:     }
 462:     /**
 463:      * Populates an object of the default type or an object that inherit from the default.
 464:      *
 465:      * @param      array $row PropelPDO resultset row.
 466:      * @param      int $startcol The 0-based offset for reading from the resultset row.
 467:      * @throws PropelException Any exceptions caught during processing will be
 468:      *       rethrown wrapped into a PropelException.
 469:      * @return array (AttributeCombination object, last column rank)
 470:      */
 471:     public static function populateObject($row, $startcol = 0)
 472:     {
 473:         $key = AttributeCombinationPeer::getPrimaryKeyHashFromRow($row, $startcol);
 474:         if (null !== ($obj = AttributeCombinationPeer::getInstanceFromPool($key))) {
 475:             // We no longer rehydrate the object, since this can cause data loss.
 476:             // See http://www.propelorm.org/ticket/509
 477:             // $obj->hydrate($row, $startcol, true); // rehydrate
 478:             $col = $startcol + AttributeCombinationPeer::NUM_HYDRATE_COLUMNS;
 479:         } else {
 480:             $cls = AttributeCombinationPeer::OM_CLASS;
 481:             $obj = new $cls();
 482:             $col = $obj->hydrate($row, $startcol);
 483:             AttributeCombinationPeer::addInstanceToPool($obj, $key);
 484:         }
 485: 
 486:         return array($obj, $col);
 487:     }
 488: 
 489: 
 490:     /**
 491:      * Returns the number of rows matching criteria, joining the related Attribute table
 492:      *
 493:      * @param      Criteria $criteria
 494:      * @param      boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
 495:      * @param      PropelPDO $con
 496:      * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
 497:      * @return int Number of matching rows.
 498:      */
 499:     public static function doCountJoinAttribute(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)
 500:     {
 501:         // we're going to modify criteria, so copy it first
 502:         $criteria = clone $criteria;
 503: 
 504:         // We need to set the primary table name, since in the case that there are no WHERE columns
 505:         // it will be impossible for the BasePeer::createSelectSql() method to determine which
 506:         // tables go into the FROM clause.
 507:         $criteria->setPrimaryTableName(AttributeCombinationPeer::TABLE_NAME);
 508: 
 509:         if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
 510:             $criteria->setDistinct();
 511:         }
 512: 
 513:         if (!$criteria->hasSelectClause()) {
 514:             AttributeCombinationPeer::addSelectColumns($criteria);
 515:         }
 516: 
 517:         $criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count
 518: 
 519:         // Set the correct dbName
 520:         $criteria->setDbName(AttributeCombinationPeer::DATABASE_NAME);
 521: 
 522:         if ($con === null) {
 523:             $con = Propel::getConnection(AttributeCombinationPeer::DATABASE_NAME, Propel::CONNECTION_READ);
 524:         }
 525: 
 526:         $criteria->addJoin(AttributeCombinationPeer::ATTRIBUTE_ID, AttributePeer::ID, $join_behavior);
 527: 
 528:         $stmt = BasePeer::doCount($criteria, $con);
 529: 
 530:         if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
 531:             $count = (int) $row[0];
 532:         } else {
 533:             $count = 0; // no rows returned; we infer that means 0 matches.
 534:         }
 535:         $stmt->closeCursor();
 536: 
 537:         return $count;
 538:     }
 539: 
 540: 
 541:     /**
 542:      * Returns the number of rows matching criteria, joining the related AttributeAv table
 543:      *
 544:      * @param      Criteria $criteria
 545:      * @param      boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
 546:      * @param      PropelPDO $con
 547:      * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
 548:      * @return int Number of matching rows.
 549:      */
 550:     public static function doCountJoinAttributeAv(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)
 551:     {
 552:         // we're going to modify criteria, so copy it first
 553:         $criteria = clone $criteria;
 554: 
 555:         // We need to set the primary table name, since in the case that there are no WHERE columns
 556:         // it will be impossible for the BasePeer::createSelectSql() method to determine which
 557:         // tables go into the FROM clause.
 558:         $criteria->setPrimaryTableName(AttributeCombinationPeer::TABLE_NAME);
 559: 
 560:         if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
 561:             $criteria->setDistinct();
 562:         }
 563: 
 564:         if (!$criteria->hasSelectClause()) {
 565:             AttributeCombinationPeer::addSelectColumns($criteria);
 566:         }
 567: 
 568:         $criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count
 569: 
 570:         // Set the correct dbName
 571:         $criteria->setDbName(AttributeCombinationPeer::DATABASE_NAME);
 572: 
 573:         if ($con === null) {
 574:             $con = Propel::getConnection(AttributeCombinationPeer::DATABASE_NAME, Propel::CONNECTION_READ);
 575:         }
 576: 
 577:         $criteria->addJoin(AttributeCombinationPeer::ATTRIBUTE_AV_ID, AttributeAvPeer::ID, $join_behavior);
 578: 
 579:         $stmt = BasePeer::doCount($criteria, $con);
 580: 
 581:         if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
 582:             $count = (int) $row[0];
 583:         } else {
 584:             $count = 0; // no rows returned; we infer that means 0 matches.
 585:         }
 586:         $stmt->closeCursor();
 587: 
 588:         return $count;
 589:     }
 590: 
 591: 
 592:     /**
 593:      * Returns the number of rows matching criteria, joining the related Combination table
 594:      *
 595:      * @param      Criteria $criteria
 596:      * @param      boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
 597:      * @param      PropelPDO $con
 598:      * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
 599:      * @return int Number of matching rows.
 600:      */
 601:     public static function doCountJoinCombination(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)
 602:     {
 603:         // we're going to modify criteria, so copy it first
 604:         $criteria = clone $criteria;
 605: 
 606:         // We need to set the primary table name, since in the case that there are no WHERE columns
 607:         // it will be impossible for the BasePeer::createSelectSql() method to determine which
 608:         // tables go into the FROM clause.
 609:         $criteria->setPrimaryTableName(AttributeCombinationPeer::TABLE_NAME);
 610: 
 611:         if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
 612:             $criteria->setDistinct();
 613:         }
 614: 
 615:         if (!$criteria->hasSelectClause()) {
 616:             AttributeCombinationPeer::addSelectColumns($criteria);
 617:         }
 618: 
 619:         $criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count
 620: 
 621:         // Set the correct dbName
 622:         $criteria->setDbName(AttributeCombinationPeer::DATABASE_NAME);
 623: 
 624:         if ($con === null) {
 625:             $con = Propel::getConnection(AttributeCombinationPeer::DATABASE_NAME, Propel::CONNECTION_READ);
 626:         }
 627: 
 628:         $criteria->addJoin(AttributeCombinationPeer::COMBINATION_ID, CombinationPeer::ID, $join_behavior);
 629: 
 630:         $stmt = BasePeer::doCount($criteria, $con);
 631: 
 632:         if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
 633:             $count = (int) $row[0];
 634:         } else {
 635:             $count = 0; // no rows returned; we infer that means 0 matches.
 636:         }
 637:         $stmt->closeCursor();
 638: 
 639:         return $count;
 640:     }
 641: 
 642: 
 643:     /**
 644:      * Selects a collection of AttributeCombination objects pre-filled with their Attribute objects.
 645:      * @param      Criteria  $criteria
 646:      * @param      PropelPDO $con
 647:      * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
 648:      * @return array           Array of AttributeCombination objects.
 649:      * @throws PropelException Any exceptions caught during processing will be
 650:      *       rethrown wrapped into a PropelException.
 651:      */
 652:     public static function doSelectJoinAttribute(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
 653:     {
 654:         $criteria = clone $criteria;
 655: 
 656:         // Set the correct dbName if it has not been overridden
 657:         if ($criteria->getDbName() == Propel::getDefaultDB()) {
 658:             $criteria->setDbName(AttributeCombinationPeer::DATABASE_NAME);
 659:         }
 660: 
 661:         AttributeCombinationPeer::addSelectColumns($criteria);
 662:         $startcol = AttributeCombinationPeer::NUM_HYDRATE_COLUMNS;
 663:         AttributePeer::addSelectColumns($criteria);
 664: 
 665:         $criteria->addJoin(AttributeCombinationPeer::ATTRIBUTE_ID, AttributePeer::ID, $join_behavior);
 666: 
 667:         $stmt = BasePeer::doSelect($criteria, $con);
 668:         $results = array();
 669: 
 670:         while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
 671:             $key1 = AttributeCombinationPeer::getPrimaryKeyHashFromRow($row, 0);
 672:             if (null !== ($obj1 = AttributeCombinationPeer::getInstanceFromPool($key1))) {
 673:                 // We no longer rehydrate the object, since this can cause data loss.
 674:                 // See http://www.propelorm.org/ticket/509
 675:                 // $obj1->hydrate($row, 0, true); // rehydrate
 676:             } else {
 677: 
 678:                 $cls = AttributeCombinationPeer::getOMClass();
 679: 
 680:                 $obj1 = new $cls();
 681:                 $obj1->hydrate($row);
 682:                 AttributeCombinationPeer::addInstanceToPool($obj1, $key1);
 683:             } // if $obj1 already loaded
 684: 
 685:             $key2 = AttributePeer::getPrimaryKeyHashFromRow($row, $startcol);
 686:             if ($key2 !== null) {
 687:                 $obj2 = AttributePeer::getInstanceFromPool($key2);
 688:                 if (!$obj2) {
 689: 
 690:                     $cls = AttributePeer::getOMClass();
 691: 
 692:                     $obj2 = new $cls();
 693:                     $obj2->hydrate($row, $startcol);
 694:                     AttributePeer::addInstanceToPool($obj2, $key2);
 695:                 } // if obj2 already loaded
 696: 
 697:                 // Add the $obj1 (AttributeCombination) to $obj2 (Attribute)
 698:                 $obj2->addAttributeCombination($obj1);
 699: 
 700:             } // if joined row was not null
 701: 
 702:             $results[] = $obj1;
 703:         }
 704:         $stmt->closeCursor();
 705: 
 706:         return $results;
 707:     }
 708: 
 709: 
 710:     /**
 711:      * Selects a collection of AttributeCombination objects pre-filled with their AttributeAv objects.
 712:      * @param      Criteria  $criteria
 713:      * @param      PropelPDO $con
 714:      * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
 715:      * @return array           Array of AttributeCombination objects.
 716:      * @throws PropelException Any exceptions caught during processing will be
 717:      *       rethrown wrapped into a PropelException.
 718:      */
 719:     public static function doSelectJoinAttributeAv(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
 720:     {
 721:         $criteria = clone $criteria;
 722: 
 723:         // Set the correct dbName if it has not been overridden
 724:         if ($criteria->getDbName() == Propel::getDefaultDB()) {
 725:             $criteria->setDbName(AttributeCombinationPeer::DATABASE_NAME);
 726:         }
 727: 
 728:         AttributeCombinationPeer::addSelectColumns($criteria);
 729:         $startcol = AttributeCombinationPeer::NUM_HYDRATE_COLUMNS;
 730:         AttributeAvPeer::addSelectColumns($criteria);
 731: 
 732:         $criteria->addJoin(AttributeCombinationPeer::ATTRIBUTE_AV_ID, AttributeAvPeer::ID, $join_behavior);
 733: 
 734:         $stmt = BasePeer::doSelect($criteria, $con);
 735:         $results = array();
 736: 
 737:         while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
 738:             $key1 = AttributeCombinationPeer::getPrimaryKeyHashFromRow($row, 0);
 739:             if (null !== ($obj1 = AttributeCombinationPeer::getInstanceFromPool($key1))) {
 740:                 // We no longer rehydrate the object, since this can cause data loss.
 741:                 // See http://www.propelorm.org/ticket/509
 742:                 // $obj1->hydrate($row, 0, true); // rehydrate
 743:             } else {
 744: 
 745:                 $cls = AttributeCombinationPeer::getOMClass();
 746: 
 747:                 $obj1 = new $cls();
 748:                 $obj1->hydrate($row);
 749:                 AttributeCombinationPeer::addInstanceToPool($obj1, $key1);
 750:             } // if $obj1 already loaded
 751: 
 752:             $key2 = AttributeAvPeer::getPrimaryKeyHashFromRow($row, $startcol);
 753:             if ($key2 !== null) {
 754:                 $obj2 = AttributeAvPeer::getInstanceFromPool($key2);
 755:                 if (!$obj2) {
 756: 
 757:                     $cls = AttributeAvPeer::getOMClass();
 758: 
 759:                     $obj2 = new $cls();
 760:                     $obj2->hydrate($row, $startcol);
 761:                     AttributeAvPeer::addInstanceToPool($obj2, $key2);
 762:                 } // if obj2 already loaded
 763: 
 764:                 // Add the $obj1 (AttributeCombination) to $obj2 (AttributeAv)
 765:                 $obj2->addAttributeCombination($obj1);
 766: 
 767:             } // if joined row was not null
 768: 
 769:             $results[] = $obj1;
 770:         }
 771:         $stmt->closeCursor();
 772: 
 773:         return $results;
 774:     }
 775: 
 776: 
 777:     /**
 778:      * Selects a collection of AttributeCombination objects pre-filled with their Combination objects.
 779:      * @param      Criteria  $criteria
 780:      * @param      PropelPDO $con
 781:      * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
 782:      * @return array           Array of AttributeCombination objects.
 783:      * @throws PropelException Any exceptions caught during processing will be
 784:      *       rethrown wrapped into a PropelException.
 785:      */
 786:     public static function doSelectJoinCombination(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
 787:     {
 788:         $criteria = clone $criteria;
 789: 
 790:         // Set the correct dbName if it has not been overridden
 791:         if ($criteria->getDbName() == Propel::getDefaultDB()) {
 792:             $criteria->setDbName(AttributeCombinationPeer::DATABASE_NAME);
 793:         }
 794: 
 795:         AttributeCombinationPeer::addSelectColumns($criteria);
 796:         $startcol = AttributeCombinationPeer::NUM_HYDRATE_COLUMNS;
 797:         CombinationPeer::addSelectColumns($criteria);
 798: 
 799:         $criteria->addJoin(AttributeCombinationPeer::COMBINATION_ID, CombinationPeer::ID, $join_behavior);
 800: 
 801:         $stmt = BasePeer::doSelect($criteria, $con);
 802:         $results = array();
 803: 
 804:         while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
 805:             $key1 = AttributeCombinationPeer::getPrimaryKeyHashFromRow($row, 0);
 806:             if (null !== ($obj1 = AttributeCombinationPeer::getInstanceFromPool($key1))) {
 807:                 // We no longer rehydrate the object, since this can cause data loss.
 808:                 // See http://www.propelorm.org/ticket/509
 809:                 // $obj1->hydrate($row, 0, true); // rehydrate
 810:             } else {
 811: 
 812:                 $cls = AttributeCombinationPeer::getOMClass();
 813: 
 814:                 $obj1 = new $cls();
 815:                 $obj1->hydrate($row);
 816:                 AttributeCombinationPeer::addInstanceToPool($obj1, $key1);
 817:             } // if $obj1 already loaded
 818: 
 819:             $key2 = CombinationPeer::getPrimaryKeyHashFromRow($row, $startcol);
 820:             if ($key2 !== null) {
 821:                 $obj2 = CombinationPeer::getInstanceFromPool($key2);
 822:                 if (!$obj2) {
 823: 
 824:                     $cls = CombinationPeer::getOMClass();
 825: 
 826:                     $obj2 = new $cls();
 827:                     $obj2->hydrate($row, $startcol);
 828:                     CombinationPeer::addInstanceToPool($obj2, $key2);
 829:                 } // if obj2 already loaded
 830: 
 831:                 // Add the $obj1 (AttributeCombination) to $obj2 (Combination)
 832:                 $obj2->addAttributeCombination($obj1);
 833: 
 834:             } // if joined row was not null
 835: 
 836:             $results[] = $obj1;
 837:         }
 838:         $stmt->closeCursor();
 839: 
 840:         return $results;
 841:     }
 842: 
 843: 
 844:     /**
 845:      * Returns the number of rows matching criteria, joining all related tables
 846:      *
 847:      * @param      Criteria $criteria
 848:      * @param      boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
 849:      * @param      PropelPDO $con
 850:      * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
 851:      * @return int Number of matching rows.
 852:      */
 853:     public static function doCountJoinAll(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)
 854:     {
 855:         // we're going to modify criteria, so copy it first
 856:         $criteria = clone $criteria;
 857: 
 858:         // We need to set the primary table name, since in the case that there are no WHERE columns
 859:         // it will be impossible for the BasePeer::createSelectSql() method to determine which
 860:         // tables go into the FROM clause.
 861:         $criteria->setPrimaryTableName(AttributeCombinationPeer::TABLE_NAME);
 862: 
 863:         if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
 864:             $criteria->setDistinct();
 865:         }
 866: 
 867:         if (!$criteria->hasSelectClause()) {
 868:             AttributeCombinationPeer::addSelectColumns($criteria);
 869:         }
 870: 
 871:         $criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count
 872: 
 873:         // Set the correct dbName
 874:         $criteria->setDbName(AttributeCombinationPeer::DATABASE_NAME);
 875: 
 876:         if ($con === null) {
 877:             $con = Propel::getConnection(AttributeCombinationPeer::DATABASE_NAME, Propel::CONNECTION_READ);
 878:         }
 879: 
 880:         $criteria->addJoin(AttributeCombinationPeer::ATTRIBUTE_ID, AttributePeer::ID, $join_behavior);
 881: 
 882:         $criteria->addJoin(AttributeCombinationPeer::ATTRIBUTE_AV_ID, AttributeAvPeer::ID, $join_behavior);
 883: 
 884:         $criteria->addJoin(AttributeCombinationPeer::COMBINATION_ID, CombinationPeer::ID, $join_behavior);
 885: 
 886:         $stmt = BasePeer::doCount($criteria, $con);
 887: 
 888:         if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
 889:             $count = (int) $row[0];
 890:         } else {
 891:             $count = 0; // no rows returned; we infer that means 0 matches.
 892:         }
 893:         $stmt->closeCursor();
 894: 
 895:         return $count;
 896:     }
 897: 
 898:     /**
 899:      * Selects a collection of AttributeCombination objects pre-filled with all related objects.
 900:      *
 901:      * @param      Criteria  $criteria
 902:      * @param      PropelPDO $con
 903:      * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
 904:      * @return array           Array of AttributeCombination objects.
 905:      * @throws PropelException Any exceptions caught during processing will be
 906:      *       rethrown wrapped into a PropelException.
 907:      */
 908:     public static function doSelectJoinAll(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
 909:     {
 910:         $criteria = clone $criteria;
 911: 
 912:         // Set the correct dbName if it has not been overridden
 913:         if ($criteria->getDbName() == Propel::getDefaultDB()) {
 914:             $criteria->setDbName(AttributeCombinationPeer::DATABASE_NAME);
 915:         }
 916: 
 917:         AttributeCombinationPeer::addSelectColumns($criteria);
 918:         $startcol2 = AttributeCombinationPeer::NUM_HYDRATE_COLUMNS;
 919: 
 920:         AttributePeer::addSelectColumns($criteria);
 921:         $startcol3 = $startcol2 + AttributePeer::NUM_HYDRATE_COLUMNS;
 922: 
 923:         AttributeAvPeer::addSelectColumns($criteria);
 924:         $startcol4 = $startcol3 + AttributeAvPeer::NUM_HYDRATE_COLUMNS;
 925: 
 926:         CombinationPeer::addSelectColumns($criteria);
 927:         $startcol5 = $startcol4 + CombinationPeer::NUM_HYDRATE_COLUMNS;
 928: 
 929:         $criteria->addJoin(AttributeCombinationPeer::ATTRIBUTE_ID, AttributePeer::ID, $join_behavior);
 930: 
 931:         $criteria->addJoin(AttributeCombinationPeer::ATTRIBUTE_AV_ID, AttributeAvPeer::ID, $join_behavior);
 932: 
 933:         $criteria->addJoin(AttributeCombinationPeer::COMBINATION_ID, CombinationPeer::ID, $join_behavior);
 934: 
 935:         $stmt = BasePeer::doSelect($criteria, $con);
 936:         $results = array();
 937: 
 938:         while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
 939:             $key1 = AttributeCombinationPeer::getPrimaryKeyHashFromRow($row, 0);
 940:             if (null !== ($obj1 = AttributeCombinationPeer::getInstanceFromPool($key1))) {
 941:                 // We no longer rehydrate the object, since this can cause data loss.
 942:                 // See http://www.propelorm.org/ticket/509
 943:                 // $obj1->hydrate($row, 0, true); // rehydrate
 944:             } else {
 945:                 $cls = AttributeCombinationPeer::getOMClass();
 946: 
 947:                 $obj1 = new $cls();
 948:                 $obj1->hydrate($row);
 949:                 AttributeCombinationPeer::addInstanceToPool($obj1, $key1);
 950:             } // if obj1 already loaded
 951: 
 952:             // Add objects for joined Attribute rows
 953: 
 954:             $key2 = AttributePeer::getPrimaryKeyHashFromRow($row, $startcol2);
 955:             if ($key2 !== null) {
 956:                 $obj2 = AttributePeer::getInstanceFromPool($key2);
 957:                 if (!$obj2) {
 958: 
 959:                     $cls = AttributePeer::getOMClass();
 960: 
 961:                     $obj2 = new $cls();
 962:                     $obj2->hydrate($row, $startcol2);
 963:                     AttributePeer::addInstanceToPool($obj2, $key2);
 964:                 } // if obj2 loaded
 965: 
 966:                 // Add the $obj1 (AttributeCombination) to the collection in $obj2 (Attribute)
 967:                 $obj2->addAttributeCombination($obj1);
 968:             } // if joined row not null
 969: 
 970:             // Add objects for joined AttributeAv rows
 971: 
 972:             $key3 = AttributeAvPeer::getPrimaryKeyHashFromRow($row, $startcol3);
 973:             if ($key3 !== null) {
 974:                 $obj3 = AttributeAvPeer::getInstanceFromPool($key3);
 975:                 if (!$obj3) {
 976: 
 977:                     $cls = AttributeAvPeer::getOMClass();
 978: 
 979:                     $obj3 = new $cls();
 980:                     $obj3->hydrate($row, $startcol3);
 981:                     AttributeAvPeer::addInstanceToPool($obj3, $key3);
 982:                 } // if obj3 loaded
 983: 
 984:                 // Add the $obj1 (AttributeCombination) to the collection in $obj3 (AttributeAv)
 985:                 $obj3->addAttributeCombination($obj1);
 986:             } // if joined row not null
 987: 
 988:             // Add objects for joined Combination rows
 989: 
 990:             $key4 = CombinationPeer::getPrimaryKeyHashFromRow($row, $startcol4);
 991:             if ($key4 !== null) {
 992:                 $obj4 = CombinationPeer::getInstanceFromPool($key4);
 993:                 if (!$obj4) {
 994: 
 995:                     $cls = CombinationPeer::getOMClass();
 996: 
 997:                     $obj4 = new $cls();
 998:                     $obj4->hydrate($row, $startcol4);
 999:                     CombinationPeer::addInstanceToPool($obj4, $key4);
1000:                 } // if obj4 loaded
1001: 
1002:                 // Add the $obj1 (AttributeCombination) to the collection in $obj4 (Combination)
1003:                 $obj4->addAttributeCombination($obj1);
1004:             } // if joined row not null
1005: 
1006:             $results[] = $obj1;
1007:         }
1008:         $stmt->closeCursor();
1009: 
1010:         return $results;
1011:     }
1012: 
1013: 
1014:     /**
1015:      * Returns the number of rows matching criteria, joining the related Attribute table
1016:      *
1017:      * @param      Criteria $criteria
1018:      * @param      boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
1019:      * @param      PropelPDO $con
1020:      * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
1021:      * @return int Number of matching rows.
1022:      */
1023:     public static function doCountJoinAllExceptAttribute(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)
1024:     {
1025:         // we're going to modify criteria, so copy it first
1026:         $criteria = clone $criteria;
1027: 
1028:         // We need to set the primary table name, since in the case that there are no WHERE columns
1029:         // it will be impossible for the BasePeer::createSelectSql() method to determine which
1030:         // tables go into the FROM clause.
1031:         $criteria->setPrimaryTableName(AttributeCombinationPeer::TABLE_NAME);
1032: 
1033:         if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
1034:             $criteria->setDistinct();
1035:         }
1036: 
1037:         if (!$criteria->hasSelectClause()) {
1038:             AttributeCombinationPeer::addSelectColumns($criteria);
1039:         }
1040: 
1041:         $criteria->clearOrderByColumns(); // ORDER BY should not affect count
1042: 
1043:         // Set the correct dbName
1044:         $criteria->setDbName(AttributeCombinationPeer::DATABASE_NAME);
1045: 
1046:         if ($con === null) {
1047:             $con = Propel::getConnection(AttributeCombinationPeer::DATABASE_NAME, Propel::CONNECTION_READ);
1048:         }
1049: 
1050:         $criteria->addJoin(AttributeCombinationPeer::ATTRIBUTE_AV_ID, AttributeAvPeer::ID, $join_behavior);
1051: 
1052:         $criteria->addJoin(AttributeCombinationPeer::COMBINATION_ID, CombinationPeer::ID, $join_behavior);
1053: 
1054:         $stmt = BasePeer::doCount($criteria, $con);
1055: 
1056:         if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
1057:             $count = (int) $row[0];
1058:         } else {
1059:             $count = 0; // no rows returned; we infer that means 0 matches.
1060:         }
1061:         $stmt->closeCursor();
1062: 
1063:         return $count;
1064:     }
1065: 
1066: 
1067:     /**
1068:      * Returns the number of rows matching criteria, joining the related AttributeAv table
1069:      *
1070:      * @param      Criteria $criteria
1071:      * @param      boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
1072:      * @param      PropelPDO $con
1073:      * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
1074:      * @return int Number of matching rows.
1075:      */
1076:     public static function doCountJoinAllExceptAttributeAv(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)
1077:     {
1078:         // we're going to modify criteria, so copy it first
1079:         $criteria = clone $criteria;
1080: 
1081:         // We need to set the primary table name, since in the case that there are no WHERE columns
1082:         // it will be impossible for the BasePeer::createSelectSql() method to determine which
1083:         // tables go into the FROM clause.
1084:         $criteria->setPrimaryTableName(AttributeCombinationPeer::TABLE_NAME);
1085: 
1086:         if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
1087:             $criteria->setDistinct();
1088:         }
1089: 
1090:         if (!$criteria->hasSelectClause()) {
1091:             AttributeCombinationPeer::addSelectColumns($criteria);
1092:         }
1093: 
1094:         $criteria->clearOrderByColumns(); // ORDER BY should not affect count
1095: 
1096:         // Set the correct dbName
1097:         $criteria->setDbName(AttributeCombinationPeer::DATABASE_NAME);
1098: 
1099:         if ($con === null) {
1100:             $con = Propel::getConnection(AttributeCombinationPeer::DATABASE_NAME, Propel::CONNECTION_READ);
1101:         }
1102: 
1103:         $criteria->addJoin(AttributeCombinationPeer::ATTRIBUTE_ID, AttributePeer::ID, $join_behavior);
1104: 
1105:         $criteria->addJoin(AttributeCombinationPeer::COMBINATION_ID, CombinationPeer::ID, $join_behavior);
1106: 
1107:         $stmt = BasePeer::doCount($criteria, $con);
1108: 
1109:         if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
1110:             $count = (int) $row[0];
1111:         } else {
1112:             $count = 0; // no rows returned; we infer that means 0 matches.
1113:         }
1114:         $stmt->closeCursor();
1115: 
1116:         return $count;
1117:     }
1118: 
1119: 
1120:     /**
1121:      * Returns the number of rows matching criteria, joining the related Combination table
1122:      *
1123:      * @param      Criteria $criteria
1124:      * @param      boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
1125:      * @param      PropelPDO $con
1126:      * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
1127:      * @return int Number of matching rows.
1128:      */
1129:     public static function doCountJoinAllExceptCombination(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)
1130:     {
1131:         // we're going to modify criteria, so copy it first
1132:         $criteria = clone $criteria;
1133: 
1134:         // We need to set the primary table name, since in the case that there are no WHERE columns
1135:         // it will be impossible for the BasePeer::createSelectSql() method to determine which
1136:         // tables go into the FROM clause.
1137:         $criteria->setPrimaryTableName(AttributeCombinationPeer::TABLE_NAME);
1138: 
1139:         if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
1140:             $criteria->setDistinct();
1141:         }
1142: 
1143:         if (!$criteria->hasSelectClause()) {
1144:             AttributeCombinationPeer::addSelectColumns($criteria);
1145:         }
1146: 
1147:         $criteria->clearOrderByColumns(); // ORDER BY should not affect count
1148: 
1149:         // Set the correct dbName
1150:         $criteria->setDbName(AttributeCombinationPeer::DATABASE_NAME);
1151: 
1152:         if ($con === null) {
1153:             $con = Propel::getConnection(AttributeCombinationPeer::DATABASE_NAME, Propel::CONNECTION_READ);
1154:         }
1155: 
1156:         $criteria->addJoin(AttributeCombinationPeer::ATTRIBUTE_ID, AttributePeer::ID, $join_behavior);
1157: 
1158:         $criteria->addJoin(AttributeCombinationPeer::ATTRIBUTE_AV_ID, AttributeAvPeer::ID, $join_behavior);
1159: 
1160:         $stmt = BasePeer::doCount($criteria, $con);
1161: 
1162:         if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
1163:             $count = (int) $row[0];
1164:         } else {
1165:             $count = 0; // no rows returned; we infer that means 0 matches.
1166:         }
1167:         $stmt->closeCursor();
1168: 
1169:         return $count;
1170:     }
1171: 
1172: 
1173:     /**
1174:      * Selects a collection of AttributeCombination objects pre-filled with all related objects except Attribute.
1175:      *
1176:      * @param      Criteria  $criteria
1177:      * @param      PropelPDO $con
1178:      * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
1179:      * @return array           Array of AttributeCombination objects.
1180:      * @throws PropelException Any exceptions caught during processing will be
1181:      *       rethrown wrapped into a PropelException.
1182:      */
1183:     public static function doSelectJoinAllExceptAttribute(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
1184:     {
1185:         $criteria = clone $criteria;
1186: 
1187:         // Set the correct dbName if it has not been overridden
1188:         // $criteria->getDbName() will return the same object if not set to another value
1189:         // so == check is okay and faster
1190:         if ($criteria->getDbName() == Propel::getDefaultDB()) {
1191:             $criteria->setDbName(AttributeCombinationPeer::DATABASE_NAME);
1192:         }
1193: 
1194:         AttributeCombinationPeer::addSelectColumns($criteria);
1195:         $startcol2 = AttributeCombinationPeer::NUM_HYDRATE_COLUMNS;
1196: 
1197:         AttributeAvPeer::addSelectColumns($criteria);
1198:         $startcol3 = $startcol2 + AttributeAvPeer::NUM_HYDRATE_COLUMNS;
1199: 
1200:         CombinationPeer::addSelectColumns($criteria);
1201:         $startcol4 = $startcol3 + CombinationPeer::NUM_HYDRATE_COLUMNS;
1202: 
1203:         $criteria->addJoin(AttributeCombinationPeer::ATTRIBUTE_AV_ID, AttributeAvPeer::ID, $join_behavior);
1204: 
1205:         $criteria->addJoin(AttributeCombinationPeer::COMBINATION_ID, CombinationPeer::ID, $join_behavior);
1206: 
1207: 
1208:         $stmt = BasePeer::doSelect($criteria, $con);
1209:         $results = array();
1210: 
1211:         while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
1212:             $key1 = AttributeCombinationPeer::getPrimaryKeyHashFromRow($row, 0);
1213:             if (null !== ($obj1 = AttributeCombinationPeer::getInstanceFromPool($key1))) {
1214:                 // We no longer rehydrate the object, since this can cause data loss.
1215:                 // See http://www.propelorm.org/ticket/509
1216:                 // $obj1->hydrate($row, 0, true); // rehydrate
1217:             } else {
1218:                 $cls = AttributeCombinationPeer::getOMClass();
1219: 
1220:                 $obj1 = new $cls();
1221:                 $obj1->hydrate($row);
1222:                 AttributeCombinationPeer::addInstanceToPool($obj1, $key1);
1223:             } // if obj1 already loaded
1224: 
1225:                 // Add objects for joined AttributeAv rows
1226: 
1227:                 $key2 = AttributeAvPeer::getPrimaryKeyHashFromRow($row, $startcol2);
1228:                 if ($key2 !== null) {
1229:                     $obj2 = AttributeAvPeer::getInstanceFromPool($key2);
1230:                     if (!$obj2) {
1231: 
1232:                         $cls = AttributeAvPeer::getOMClass();
1233: 
1234:                     $obj2 = new $cls();
1235:                     $obj2->hydrate($row, $startcol2);
1236:                     AttributeAvPeer::addInstanceToPool($obj2, $key2);
1237:                 } // if $obj2 already loaded
1238: 
1239:                 // Add the $obj1 (AttributeCombination) to the collection in $obj2 (AttributeAv)
1240:                 $obj2->addAttributeCombination($obj1);
1241: 
1242:             } // if joined row is not null
1243: 
1244:                 // Add objects for joined Combination rows
1245: 
1246:                 $key3 = CombinationPeer::getPrimaryKeyHashFromRow($row, $startcol3);
1247:                 if ($key3 !== null) {
1248:                     $obj3 = CombinationPeer::getInstanceFromPool($key3);
1249:                     if (!$obj3) {
1250: 
1251:                         $cls = CombinationPeer::getOMClass();
1252: 
1253:                     $obj3 = new $cls();
1254:                     $obj3->hydrate($row, $startcol3);
1255:                     CombinationPeer::addInstanceToPool($obj3, $key3);
1256:                 } // if $obj3 already loaded
1257: 
1258:                 // Add the $obj1 (AttributeCombination) to the collection in $obj3 (Combination)
1259:                 $obj3->addAttributeCombination($obj1);
1260: 
1261:             } // if joined row is not null
1262: 
1263:             $results[] = $obj1;
1264:         }
1265:         $stmt->closeCursor();
1266: 
1267:         return $results;
1268:     }
1269: 
1270: 
1271:     /**
1272:      * Selects a collection of AttributeCombination objects pre-filled with all related objects except AttributeAv.
1273:      *
1274:      * @param      Criteria  $criteria
1275:      * @param      PropelPDO $con
1276:      * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
1277:      * @return array           Array of AttributeCombination objects.
1278:      * @throws PropelException Any exceptions caught during processing will be
1279:      *       rethrown wrapped into a PropelException.
1280:      */
1281:     public static function doSelectJoinAllExceptAttributeAv(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
1282:     {
1283:         $criteria = clone $criteria;
1284: 
1285:         // Set the correct dbName if it has not been overridden
1286:         // $criteria->getDbName() will return the same object if not set to another value
1287:         // so == check is okay and faster
1288:         if ($criteria->getDbName() == Propel::getDefaultDB()) {
1289:             $criteria->setDbName(AttributeCombinationPeer::DATABASE_NAME);
1290:         }
1291: 
1292:         AttributeCombinationPeer::addSelectColumns($criteria);
1293:         $startcol2 = AttributeCombinationPeer::NUM_HYDRATE_COLUMNS;
1294: 
1295:         AttributePeer::addSelectColumns($criteria);
1296:         $startcol3 = $startcol2 + AttributePeer::NUM_HYDRATE_COLUMNS;
1297: 
1298:         CombinationPeer::addSelectColumns($criteria);
1299:         $startcol4 = $startcol3 + CombinationPeer::NUM_HYDRATE_COLUMNS;
1300: 
1301:         $criteria->addJoin(AttributeCombinationPeer::ATTRIBUTE_ID, AttributePeer::ID, $join_behavior);
1302: 
1303:         $criteria->addJoin(AttributeCombinationPeer::COMBINATION_ID, CombinationPeer::ID, $join_behavior);
1304: 
1305: 
1306:         $stmt = BasePeer::doSelect($criteria, $con);
1307:         $results = array();
1308: 
1309:         while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
1310:             $key1 = AttributeCombinationPeer::getPrimaryKeyHashFromRow($row, 0);
1311:             if (null !== ($obj1 = AttributeCombinationPeer::getInstanceFromPool($key1))) {
1312:                 // We no longer rehydrate the object, since this can cause data loss.
1313:                 // See http://www.propelorm.org/ticket/509
1314:                 // $obj1->hydrate($row, 0, true); // rehydrate
1315:             } else {
1316:                 $cls = AttributeCombinationPeer::getOMClass();
1317: 
1318:                 $obj1 = new $cls();
1319:                 $obj1->hydrate($row);
1320:                 AttributeCombinationPeer::addInstanceToPool($obj1, $key1);
1321:             } // if obj1 already loaded
1322: 
1323:                 // Add objects for joined Attribute rows
1324: 
1325:                 $key2 = AttributePeer::getPrimaryKeyHashFromRow($row, $startcol2);
1326:                 if ($key2 !== null) {
1327:                     $obj2 = AttributePeer::getInstanceFromPool($key2);
1328:                     if (!$obj2) {
1329: 
1330:                         $cls = AttributePeer::getOMClass();
1331: 
1332:                     $obj2 = new $cls();
1333:                     $obj2->hydrate($row, $startcol2);
1334:                     AttributePeer::addInstanceToPool($obj2, $key2);
1335:                 } // if $obj2 already loaded
1336: 
1337:                 // Add the $obj1 (AttributeCombination) to the collection in $obj2 (Attribute)
1338:                 $obj2->addAttributeCombination($obj1);
1339: 
1340:             } // if joined row is not null
1341: 
1342:                 // Add objects for joined Combination rows
1343: 
1344:                 $key3 = CombinationPeer::getPrimaryKeyHashFromRow($row, $startcol3);
1345:                 if ($key3 !== null) {
1346:                     $obj3 = CombinationPeer::getInstanceFromPool($key3);
1347:                     if (!$obj3) {
1348: 
1349:                         $cls = CombinationPeer::getOMClass();
1350: 
1351:                     $obj3 = new $cls();
1352:                     $obj3->hydrate($row, $startcol3);
1353:                     CombinationPeer::addInstanceToPool($obj3, $key3);
1354:                 } // if $obj3 already loaded
1355: 
1356:                 // Add the $obj1 (AttributeCombination) to the collection in $obj3 (Combination)
1357:                 $obj3->addAttributeCombination($obj1);
1358: 
1359:             } // if joined row is not null
1360: 
1361:             $results[] = $obj1;
1362:         }
1363:         $stmt->closeCursor();
1364: 
1365:         return $results;
1366:     }
1367: 
1368: 
1369:     /**
1370:      * Selects a collection of AttributeCombination objects pre-filled with all related objects except Combination.
1371:      *
1372:      * @param      Criteria  $criteria
1373:      * @param      PropelPDO $con
1374:      * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
1375:      * @return array           Array of AttributeCombination objects.
1376:      * @throws PropelException Any exceptions caught during processing will be
1377:      *       rethrown wrapped into a PropelException.
1378:      */
1379:     public static function doSelectJoinAllExceptCombination(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
1380:     {
1381:         $criteria = clone $criteria;
1382: 
1383:         // Set the correct dbName if it has not been overridden
1384:         // $criteria->getDbName() will return the same object if not set to another value
1385:         // so == check is okay and faster
1386:         if ($criteria->getDbName() == Propel::getDefaultDB()) {
1387:             $criteria->setDbName(AttributeCombinationPeer::DATABASE_NAME);
1388:         }
1389: 
1390:         AttributeCombinationPeer::addSelectColumns($criteria);
1391:         $startcol2 = AttributeCombinationPeer::NUM_HYDRATE_COLUMNS;
1392: 
1393:         AttributePeer::addSelectColumns($criteria);
1394:         $startcol3 = $startcol2 + AttributePeer::NUM_HYDRATE_COLUMNS;
1395: 
1396:         AttributeAvPeer::addSelectColumns($criteria);
1397:         $startcol4 = $startcol3 + AttributeAvPeer::NUM_HYDRATE_COLUMNS;
1398: 
1399:         $criteria->addJoin(AttributeCombinationPeer::ATTRIBUTE_ID, AttributePeer::ID, $join_behavior);
1400: 
1401:         $criteria->addJoin(AttributeCombinationPeer::ATTRIBUTE_AV_ID, AttributeAvPeer::ID, $join_behavior);
1402: 
1403: 
1404:         $stmt = BasePeer::doSelect($criteria, $con);
1405:         $results = array();
1406: 
1407:         while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
1408:             $key1 = AttributeCombinationPeer::getPrimaryKeyHashFromRow($row, 0);
1409:             if (null !== ($obj1 = AttributeCombinationPeer::getInstanceFromPool($key1))) {
1410:                 // We no longer rehydrate the object, since this can cause data loss.
1411:                 // See http://www.propelorm.org/ticket/509
1412:                 // $obj1->hydrate($row, 0, true); // rehydrate
1413:             } else {
1414:                 $cls = AttributeCombinationPeer::getOMClass();
1415: 
1416:                 $obj1 = new $cls();
1417:                 $obj1->hydrate($row);
1418:                 AttributeCombinationPeer::addInstanceToPool($obj1, $key1);
1419:             } // if obj1 already loaded
1420: 
1421:                 // Add objects for joined Attribute rows
1422: 
1423:                 $key2 = AttributePeer::getPrimaryKeyHashFromRow($row, $startcol2);
1424:                 if ($key2 !== null) {
1425:                     $obj2 = AttributePeer::getInstanceFromPool($key2);
1426:                     if (!$obj2) {
1427: 
1428:                         $cls = AttributePeer::getOMClass();
1429: 
1430:                     $obj2 = new $cls();
1431:                     $obj2->hydrate($row, $startcol2);
1432:                     AttributePeer::addInstanceToPool($obj2, $key2);
1433:                 } // if $obj2 already loaded
1434: 
1435:                 // Add the $obj1 (AttributeCombination) to the collection in $obj2 (Attribute)
1436:                 $obj2->addAttributeCombination($obj1);
1437: 
1438:             } // if joined row is not null
1439: 
1440:                 // Add objects for joined AttributeAv rows
1441: 
1442:                 $key3 = AttributeAvPeer::getPrimaryKeyHashFromRow($row, $startcol3);
1443:                 if ($key3 !== null) {
1444:                     $obj3 = AttributeAvPeer::getInstanceFromPool($key3);
1445:                     if (!$obj3) {
1446: 
1447:                         $cls = AttributeAvPeer::getOMClass();
1448: 
1449:                     $obj3 = new $cls();
1450:                     $obj3->hydrate($row, $startcol3);
1451:                     AttributeAvPeer::addInstanceToPool($obj3, $key3);
1452:                 } // if $obj3 already loaded
1453: 
1454:                 // Add the $obj1 (AttributeCombination) to the collection in $obj3 (AttributeAv)
1455:                 $obj3->addAttributeCombination($obj1);
1456: 
1457:             } // if joined row is not null
1458: 
1459:             $results[] = $obj1;
1460:         }
1461:         $stmt->closeCursor();
1462: 
1463:         return $results;
1464:     }
1465: 
1466:     /**
1467:      * Returns the TableMap related to this peer.
1468:      * This method is not needed for general use but a specific application could have a need.
1469:      * @return TableMap
1470:      * @throws PropelException Any exceptions caught during processing will be
1471:      *       rethrown wrapped into a PropelException.
1472:      */
1473:     public static function getTableMap()
1474:     {
1475:         return Propel::getDatabaseMap(AttributeCombinationPeer::DATABASE_NAME)->getTable(AttributeCombinationPeer::TABLE_NAME);
1476:     }
1477: 
1478:     /**
1479:      * Add a TableMap instance to the database for this peer class.
1480:      */
1481:     public static function buildTableMap()
1482:     {
1483:       $dbMap = Propel::getDatabaseMap(BaseAttributeCombinationPeer::DATABASE_NAME);
1484:       if (!$dbMap->hasTable(BaseAttributeCombinationPeer::TABLE_NAME)) {
1485:         $dbMap->addTableObject(new AttributeCombinationTableMap());
1486:       }
1487:     }
1488: 
1489:     /**
1490:      * The class that the Peer will make instances of.
1491:      *
1492:      *
1493:      * @return string ClassName
1494:      */
1495:     public static function getOMClass()
1496:     {
1497:         return AttributeCombinationPeer::OM_CLASS;
1498:     }
1499: 
1500:     /**
1501:      * Performs an INSERT on the database, given a AttributeCombination or Criteria object.
1502:      *
1503:      * @param      mixed $values Criteria or AttributeCombination object containing data that is used to create the INSERT statement.
1504:      * @param      PropelPDO $con the PropelPDO connection to use
1505:      * @return mixed           The new primary key.
1506:      * @throws PropelException Any exceptions caught during processing will be
1507:      *       rethrown wrapped into a PropelException.
1508:      */
1509:     public static function doInsert($values, PropelPDO $con = null)
1510:     {
1511:         if ($con === null) {
1512:             $con = Propel::getConnection(AttributeCombinationPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
1513:         }
1514: 
1515:         if ($values instanceof Criteria) {
1516:             $criteria = clone $values; // rename for clarity
1517:         } else {
1518:             $criteria = $values->buildCriteria(); // build Criteria from AttributeCombination object
1519:         }
1520: 
1521:         if ($criteria->containsKey(AttributeCombinationPeer::ID) && $criteria->keyContainsValue(AttributeCombinationPeer::ID) ) {
1522:             throw new PropelException('Cannot insert a value for auto-increment primary key ('.AttributeCombinationPeer::ID.')');
1523:         }
1524: 
1525: 
1526:         // Set the correct dbName
1527:         $criteria->setDbName(AttributeCombinationPeer::DATABASE_NAME);
1528: 
1529:         try {
1530:             // use transaction because $criteria could contain info
1531:             // for more than one table (I guess, conceivably)
1532:             $con->beginTransaction();
1533:             $pk = BasePeer::doInsert($criteria, $con);
1534:             $con->commit();
1535:         } catch (PropelException $e) {
1536:             $con->rollBack();
1537:             throw $e;
1538:         }
1539: 
1540:         return $pk;
1541:     }
1542: 
1543:     /**
1544:      * Performs an UPDATE on the database, given a AttributeCombination or Criteria object.
1545:      *
1546:      * @param      mixed $values Criteria or AttributeCombination object containing data that is used to create the UPDATE statement.
1547:      * @param      PropelPDO $con The connection to use (specify PropelPDO connection object to exert more control over transactions).
1548:      * @return int             The number of affected rows (if supported by underlying database driver).
1549:      * @throws PropelException Any exceptions caught during processing will be
1550:      *       rethrown wrapped into a PropelException.
1551:      */
1552:     public static function doUpdate($values, PropelPDO $con = null)
1553:     {
1554:         if ($con === null) {
1555:             $con = Propel::getConnection(AttributeCombinationPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
1556:         }
1557: 
1558:         $selectCriteria = new Criteria(AttributeCombinationPeer::DATABASE_NAME);
1559: 
1560:         if ($values instanceof Criteria) {
1561:             $criteria = clone $values; // rename for clarity
1562: 
1563:             $comparison = $criteria->getComparison(AttributeCombinationPeer::ID);
1564:             $value = $criteria->remove(AttributeCombinationPeer::ID);
1565:             if ($value) {
1566:                 $selectCriteria->add(AttributeCombinationPeer::ID, $value, $comparison);
1567:             } else {
1568:                 $selectCriteria->setPrimaryTableName(AttributeCombinationPeer::TABLE_NAME);
1569:             }
1570: 
1571:             $comparison = $criteria->getComparison(AttributeCombinationPeer::ATTRIBUTE_ID);
1572:             $value = $criteria->remove(AttributeCombinationPeer::ATTRIBUTE_ID);
1573:             if ($value) {
1574:                 $selectCriteria->add(AttributeCombinationPeer::ATTRIBUTE_ID, $value, $comparison);
1575:             } else {
1576:                 $selectCriteria->setPrimaryTableName(AttributeCombinationPeer::TABLE_NAME);
1577:             }
1578: 
1579:             $comparison = $criteria->getComparison(AttributeCombinationPeer::COMBINATION_ID);
1580:             $value = $criteria->remove(AttributeCombinationPeer::COMBINATION_ID);
1581:             if ($value) {
1582:                 $selectCriteria->add(AttributeCombinationPeer::COMBINATION_ID, $value, $comparison);
1583:             } else {
1584:                 $selectCriteria->setPrimaryTableName(AttributeCombinationPeer::TABLE_NAME);
1585:             }
1586: 
1587:             $comparison = $criteria->getComparison(AttributeCombinationPeer::ATTRIBUTE_AV_ID);
1588:             $value = $criteria->remove(AttributeCombinationPeer::ATTRIBUTE_AV_ID);
1589:             if ($value) {
1590:                 $selectCriteria->add(AttributeCombinationPeer::ATTRIBUTE_AV_ID, $value, $comparison);
1591:             } else {
1592:                 $selectCriteria->setPrimaryTableName(AttributeCombinationPeer::TABLE_NAME);
1593:             }
1594: 
1595:         } else { // $values is AttributeCombination object
1596:             $criteria = $values->buildCriteria(); // gets full criteria
1597:             $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
1598:         }
1599: 
1600:         // set the correct dbName
1601:         $criteria->setDbName(AttributeCombinationPeer::DATABASE_NAME);
1602: 
1603:         return BasePeer::doUpdate($selectCriteria, $criteria, $con);
1604:     }
1605: 
1606:     /**
1607:      * Deletes all rows from the attribute_combination table.
1608:      *
1609:      * @param      PropelPDO $con the connection to use
1610:      * @return int             The number of affected rows (if supported by underlying database driver).
1611:      * @throws PropelException
1612:      */
1613:     public static function doDeleteAll(PropelPDO $con = null)
1614:     {
1615:         if ($con === null) {
1616:             $con = Propel::getConnection(AttributeCombinationPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
1617:         }
1618:         $affectedRows = 0; // initialize var to track total num of affected rows
1619:         try {
1620:             // use transaction because $criteria could contain info
1621:             // for more than one table or we could emulating ON DELETE CASCADE, etc.
1622:             $con->beginTransaction();
1623:             $affectedRows += BasePeer::doDeleteAll(AttributeCombinationPeer::TABLE_NAME, $con, AttributeCombinationPeer::DATABASE_NAME);
1624:             // Because this db requires some delete cascade/set null emulation, we have to
1625:             // clear the cached instance *after* the emulation has happened (since
1626:             // instances get re-added by the select statement contained therein).
1627:             AttributeCombinationPeer::clearInstancePool();
1628:             AttributeCombinationPeer::clearRelatedInstancePool();
1629:             $con->commit();
1630: 
1631:             return $affectedRows;
1632:         } catch (PropelException $e) {
1633:             $con->rollBack();
1634:             throw $e;
1635:         }
1636:     }
1637: 
1638:     /**
1639:      * Performs a DELETE on the database, given a AttributeCombination or Criteria object OR a primary key value.
1640:      *
1641:      * @param      mixed $values Criteria or AttributeCombination object or primary key or array of primary keys
1642:      *              which is used to create the DELETE statement
1643:      * @param      PropelPDO $con the connection to use
1644:      * @return int The number of affected rows (if supported by underlying database driver).  This includes CASCADE-related rows
1645:      *              if supported by native driver or if emulated using Propel.
1646:      * @throws PropelException Any exceptions caught during processing will be
1647:      *       rethrown wrapped into a PropelException.
1648:      */
1649:      public static function doDelete($values, PropelPDO $con = null)
1650:      {
1651:         if ($con === null) {
1652:             $con = Propel::getConnection(AttributeCombinationPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
1653:         }
1654: 
1655:         if ($values instanceof Criteria) {
1656:             // invalidate the cache for all objects of this type, since we have no
1657:             // way of knowing (without running a query) what objects should be invalidated
1658:             // from the cache based on this Criteria.
1659:             AttributeCombinationPeer::clearInstancePool();
1660:             // rename for clarity
1661:             $criteria = clone $values;
1662:         } elseif ($values instanceof AttributeCombination) { // it's a model object
1663:             // invalidate the cache for this single object
1664:             AttributeCombinationPeer::removeInstanceFromPool($values);
1665:             // create criteria based on pk values
1666:             $criteria = $values->buildPkeyCriteria();
1667:         } else { // it's a primary key, or an array of pks
1668:             $criteria = new Criteria(AttributeCombinationPeer::DATABASE_NAME);
1669:             // primary key is composite; we therefore, expect
1670:             // the primary key passed to be an array of pkey values
1671:             if (count($values) == count($values, COUNT_RECURSIVE)) {
1672:                 // array is not multi-dimensional
1673:                 $values = array($values);
1674:             }
1675:             foreach ($values as $value) {
1676:                 $criterion = $criteria->getNewCriterion(AttributeCombinationPeer::ID, $value[0]);
1677:                 $criterion->addAnd($criteria->getNewCriterion(AttributeCombinationPeer::ATTRIBUTE_ID, $value[1]));
1678:                 $criterion->addAnd($criteria->getNewCriterion(AttributeCombinationPeer::COMBINATION_ID, $value[2]));
1679:                 $criterion->addAnd($criteria->getNewCriterion(AttributeCombinationPeer::ATTRIBUTE_AV_ID, $value[3]));
1680:                 $criteria->addOr($criterion);
1681:                 // we can invalidate the cache for this single PK
1682:                 AttributeCombinationPeer::removeInstanceFromPool($value);
1683:             }
1684:         }
1685: 
1686:         // Set the correct dbName
1687:         $criteria->setDbName(AttributeCombinationPeer::DATABASE_NAME);
1688: 
1689:         $affectedRows = 0; // initialize var to track total num of affected rows
1690: 
1691:         try {
1692:             // use transaction because $criteria could contain info
1693:             // for more than one table or we could emulating ON DELETE CASCADE, etc.
1694:             $con->beginTransaction();
1695: 
1696:             $affectedRows += BasePeer::doDelete($criteria, $con);
1697:             AttributeCombinationPeer::clearRelatedInstancePool();
1698:             $con->commit();
1699: 
1700:             return $affectedRows;
1701:         } catch (PropelException $e) {
1702:             $con->rollBack();
1703:             throw $e;
1704:         }
1705:     }
1706: 
1707:     /**
1708:      * Validates all modified columns of given AttributeCombination object.
1709:      * If parameter $columns is either a single column name or an array of column names
1710:      * than only those columns are validated.
1711:      *
1712:      * NOTICE: This does not apply to primary or foreign keys for now.
1713:      *
1714:      * @param      AttributeCombination $obj The object to validate.
1715:      * @param      mixed $cols Column name or array of column names.
1716:      *
1717:      * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
1718:      */
1719:     public static function doValidate($obj, $cols = null)
1720:     {
1721:         $columns = array();
1722: 
1723:         if ($cols) {
1724:             $dbMap = Propel::getDatabaseMap(AttributeCombinationPeer::DATABASE_NAME);
1725:             $tableMap = $dbMap->getTable(AttributeCombinationPeer::TABLE_NAME);
1726: 
1727:             if (! is_array($cols)) {
1728:                 $cols = array($cols);
1729:             }
1730: 
1731:             foreach ($cols as $colName) {
1732:                 if ($tableMap->hasColumn($colName)) {
1733:                     $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
1734:                     $columns[$colName] = $obj->$get();
1735:                 }
1736:             }
1737:         } else {
1738: 
1739:         }
1740: 
1741:         return BasePeer::doValidate(AttributeCombinationPeer::DATABASE_NAME, AttributeCombinationPeer::TABLE_NAME, $columns);
1742:     }
1743: 
1744:     /**
1745:      * Retrieve object using using composite pkey values.
1746:      * @param   int $id
1747:      * @param   int $attribute_id
1748:      * @param   int $combination_id
1749:      * @param   int $attribute_av_id
1750:      * @param      PropelPDO $con
1751:      * @return   AttributeCombination
1752:      */
1753:     public static function retrieveByPK($id, $attribute_id, $combination_id, $attribute_av_id, PropelPDO $con = null) {
1754:         $_instancePoolKey = serialize(array((string) $id, (string) $attribute_id, (string) $combination_id, (string) $attribute_av_id));
1755:          if (null !== ($obj = AttributeCombinationPeer::getInstanceFromPool($_instancePoolKey))) {
1756:              return $obj;
1757:         }
1758: 
1759:         if ($con === null) {
1760:             $con = Propel::getConnection(AttributeCombinationPeer::DATABASE_NAME, Propel::CONNECTION_READ);
1761:         }
1762:         $criteria = new Criteria(AttributeCombinationPeer::DATABASE_NAME);
1763:         $criteria->add(AttributeCombinationPeer::ID, $id);
1764:         $criteria->add(AttributeCombinationPeer::ATTRIBUTE_ID, $attribute_id);
1765:         $criteria->add(AttributeCombinationPeer::COMBINATION_ID, $combination_id);
1766:         $criteria->add(AttributeCombinationPeer::ATTRIBUTE_AV_ID, $attribute_av_id);
1767:         $v = AttributeCombinationPeer::doSelect($criteria, $con);
1768: 
1769:         return !empty($v) ? $v[0] : null;
1770:     }
1771: } // BaseAttributeCombinationPeer
1772: 
1773: // This is the static code needed to register the TableMap for this table with the main Propel class.
1774: //
1775: BaseAttributeCombinationPeer::buildTableMap();
1776: 
1777: 
thelia API documentation generated by ApiGen 2.8.0