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\GroupDesc;
  13: use Thelia\Model\GroupDescPeer;
  14: use Thelia\Model\GroupPeer;
  15: use Thelia\Model\map\GroupDescTableMap;
  16: 
  17: /**
  18:  * Base static class for performing query and update operations on the 'group_desc' table.
  19:  *
  20:  *
  21:  *
  22:  * @package propel.generator.Thelia.Model.om
  23:  */
  24: abstract class BaseGroupDescPeer
  25: {
  26: 
  27:     /** the default database name for this class */
  28:     const DATABASE_NAME = 'thelia';
  29: 
  30:     /** the table name for this class */
  31:     const TABLE_NAME = 'group_desc';
  32: 
  33:     /** the related Propel class for this table */
  34:     const OM_CLASS = 'Thelia\\Model\\GroupDesc';
  35: 
  36:     /** the related TableMap class for this table */
  37:     const TM_CLASS = 'GroupDescTableMap';
  38: 
  39:     /** The total number of columns. */
  40:     const NUM_COLUMNS = 8;
  41: 
  42:     /** The number of lazy-loaded columns. */
  43:     const NUM_LAZY_LOAD_COLUMNS = 0;
  44: 
  45:     /** The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS) */
  46:     const NUM_HYDRATE_COLUMNS = 8;
  47: 
  48:     /** the column name for the ID field */
  49:     const ID = 'group_desc.ID';
  50: 
  51:     /** the column name for the GROUP_ID field */
  52:     const GROUP_ID = 'group_desc.GROUP_ID';
  53: 
  54:     /** the column name for the LANG field */
  55:     const LANG = 'group_desc.LANG';
  56: 
  57:     /** the column name for the TITLE field */
  58:     const TITLE = 'group_desc.TITLE';
  59: 
  60:     /** the column name for the DESCRIPTION field */
  61:     const DESCRIPTION = 'group_desc.DESCRIPTION';
  62: 
  63:     /** the column name for the CHAPO field */
  64:     const CHAPO = 'group_desc.CHAPO';
  65: 
  66:     /** the column name for the CREATED_AT field */
  67:     const CREATED_AT = 'group_desc.CREATED_AT';
  68: 
  69:     /** the column name for the UPDATED_AT field */
  70:     const UPDATED_AT = 'group_desc.UPDATED_AT';
  71: 
  72:     /** The default string format for model objects of the related table **/
  73:     const DEFAULT_STRING_FORMAT = 'YAML';
  74: 
  75:     /**
  76:      * An identiy map to hold any loaded instances of GroupDesc objects.
  77:      * This must be public so that other peer classes can access this when hydrating from JOIN
  78:      * queries.
  79:      * @var        array GroupDesc[]
  80:      */
  81:     public static $instances = array();
  82: 
  83: 
  84:     /**
  85:      * holds an array of fieldnames
  86:      *
  87:      * first dimension keys are the type constants
  88:      * e.g. GroupDescPeer::$fieldNames[GroupDescPeer::TYPE_PHPNAME][0] = 'Id'
  89:      */
  90:     protected static $fieldNames = array (
  91:         BasePeer::TYPE_PHPNAME => array ('Id', 'GroupId', 'Lang', 'Title', 'Description', 'Chapo', 'CreatedAt', 'UpdatedAt', ),
  92:         BasePeer::TYPE_STUDLYPHPNAME => array ('id', 'groupId', 'lang', 'title', 'description', 'chapo', 'createdAt', 'updatedAt', ),
  93:         BasePeer::TYPE_COLNAME => array (GroupDescPeer::ID, GroupDescPeer::GROUP_ID, GroupDescPeer::LANG, GroupDescPeer::TITLE, GroupDescPeer::DESCRIPTION, GroupDescPeer::CHAPO, GroupDescPeer::CREATED_AT, GroupDescPeer::UPDATED_AT, ),
  94:         BasePeer::TYPE_RAW_COLNAME => array ('ID', 'GROUP_ID', 'LANG', 'TITLE', 'DESCRIPTION', 'CHAPO', 'CREATED_AT', 'UPDATED_AT', ),
  95:         BasePeer::TYPE_FIELDNAME => array ('id', 'group_id', 'lang', 'title', 'description', 'chapo', 'created_at', 'updated_at', ),
  96:         BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, )
  97:     );
  98: 
  99:     /**
 100:      * holds an array of keys for quick access to the fieldnames array
 101:      *
 102:      * first dimension keys are the type constants
 103:      * e.g. GroupDescPeer::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
 104:      */
 105:     protected static $fieldKeys = array (
 106:         BasePeer::TYPE_PHPNAME => array ('Id' => 0, 'GroupId' => 1, 'Lang' => 2, 'Title' => 3, 'Description' => 4, 'Chapo' => 5, 'CreatedAt' => 6, 'UpdatedAt' => 7, ),
 107:         BasePeer::TYPE_STUDLYPHPNAME => array ('id' => 0, 'groupId' => 1, 'lang' => 2, 'title' => 3, 'description' => 4, 'chapo' => 5, 'createdAt' => 6, 'updatedAt' => 7, ),
 108:         BasePeer::TYPE_COLNAME => array (GroupDescPeer::ID => 0, GroupDescPeer::GROUP_ID => 1, GroupDescPeer::LANG => 2, GroupDescPeer::TITLE => 3, GroupDescPeer::DESCRIPTION => 4, GroupDescPeer::CHAPO => 5, GroupDescPeer::CREATED_AT => 6, GroupDescPeer::UPDATED_AT => 7, ),
 109:         BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'GROUP_ID' => 1, 'LANG' => 2, 'TITLE' => 3, 'DESCRIPTION' => 4, 'CHAPO' => 5, 'CREATED_AT' => 6, 'UPDATED_AT' => 7, ),
 110:         BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'group_id' => 1, 'lang' => 2, 'title' => 3, 'description' => 4, 'chapo' => 5, 'created_at' => 6, 'updated_at' => 7, ),
 111:         BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, )
 112:     );
 113: 
 114:     /**
 115:      * Translates a fieldname to another type
 116:      *
 117:      * @param      string $name field name
 118:      * @param      string $fromType One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
 119:      *                         BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
 120:      * @param      string $toType   One of the class type constants
 121:      * @return string          translated name of the field.
 122:      * @throws PropelException - if the specified name could not be found in the fieldname mappings.
 123:      */
 124:     public static function translateFieldName($name, $fromType, $toType)
 125:     {
 126:         $toNames = GroupDescPeer::getFieldNames($toType);
 127:         $key = isset(GroupDescPeer::$fieldKeys[$fromType][$name]) ? GroupDescPeer::$fieldKeys[$fromType][$name] : null;
 128:         if ($key === null) {
 129:             throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(GroupDescPeer::$fieldKeys[$fromType], true));
 130:         }
 131: 
 132:         return $toNames[$key];
 133:     }
 134: 
 135:     /**
 136:      * Returns an array of field names.
 137:      *
 138:      * @param      string $type The type of fieldnames to return:
 139:      *                      One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
 140:      *                      BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
 141:      * @return array           A list of field names
 142:      * @throws PropelException - if the type is not valid.
 143:      */
 144:     public static function getFieldNames($type = BasePeer::TYPE_PHPNAME)
 145:     {
 146:         if (!array_key_exists($type, GroupDescPeer::$fieldNames)) {
 147:             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.');
 148:         }
 149: 
 150:         return GroupDescPeer::$fieldNames[$type];
 151:     }
 152: 
 153:     /**
 154:      * Convenience method which changes table.column to alias.column.
 155:      *
 156:      * Using this method you can maintain SQL abstraction while using column aliases.
 157:      * <code>
 158:      *      $c->addAlias("alias1", TablePeer::TABLE_NAME);
 159:      *      $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
 160:      * </code>
 161:      * @param      string $alias The alias for the current table.
 162:      * @param      string $column The column name for current table. (i.e. GroupDescPeer::COLUMN_NAME).
 163:      * @return string
 164:      */
 165:     public static function alias($alias, $column)
 166:     {
 167:         return str_replace(GroupDescPeer::TABLE_NAME.'.', $alias.'.', $column);
 168:     }
 169: 
 170:     /**
 171:      * Add all the columns needed to create a new object.
 172:      *
 173:      * Note: any columns that were marked with lazyLoad="true" in the
 174:      * XML schema will not be added to the select list and only loaded
 175:      * on demand.
 176:      *
 177:      * @param      Criteria $criteria object containing the columns to add.
 178:      * @param      string   $alias    optional table alias
 179:      * @throws PropelException Any exceptions caught during processing will be
 180:      *       rethrown wrapped into a PropelException.
 181:      */
 182:     public static function addSelectColumns(Criteria $criteria, $alias = null)
 183:     {
 184:         if (null === $alias) {
 185:             $criteria->addSelectColumn(GroupDescPeer::ID);
 186:             $criteria->addSelectColumn(GroupDescPeer::GROUP_ID);
 187:             $criteria->addSelectColumn(GroupDescPeer::LANG);
 188:             $criteria->addSelectColumn(GroupDescPeer::TITLE);
 189:             $criteria->addSelectColumn(GroupDescPeer::DESCRIPTION);
 190:             $criteria->addSelectColumn(GroupDescPeer::CHAPO);
 191:             $criteria->addSelectColumn(GroupDescPeer::CREATED_AT);
 192:             $criteria->addSelectColumn(GroupDescPeer::UPDATED_AT);
 193:         } else {
 194:             $criteria->addSelectColumn($alias . '.ID');
 195:             $criteria->addSelectColumn($alias . '.GROUP_ID');
 196:             $criteria->addSelectColumn($alias . '.LANG');
 197:             $criteria->addSelectColumn($alias . '.TITLE');
 198:             $criteria->addSelectColumn($alias . '.DESCRIPTION');
 199:             $criteria->addSelectColumn($alias . '.CHAPO');
 200:             $criteria->addSelectColumn($alias . '.CREATED_AT');
 201:             $criteria->addSelectColumn($alias . '.UPDATED_AT');
 202:         }
 203:     }
 204: 
 205:     /**
 206:      * Returns the number of rows matching criteria.
 207:      *
 208:      * @param      Criteria $criteria
 209:      * @param      boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
 210:      * @param      PropelPDO $con
 211:      * @return int Number of matching rows.
 212:      */
 213:     public static function doCount(Criteria $criteria, $distinct = false, PropelPDO $con = null)
 214:     {
 215:         // we may modify criteria, so copy it first
 216:         $criteria = clone $criteria;
 217: 
 218:         // We need to set the primary table name, since in the case that there are no WHERE columns
 219:         // it will be impossible for the BasePeer::createSelectSql() method to determine which
 220:         // tables go into the FROM clause.
 221:         $criteria->setPrimaryTableName(GroupDescPeer::TABLE_NAME);
 222: 
 223:         if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
 224:             $criteria->setDistinct();
 225:         }
 226: 
 227:         if (!$criteria->hasSelectClause()) {
 228:             GroupDescPeer::addSelectColumns($criteria);
 229:         }
 230: 
 231:         $criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count
 232:         $criteria->setDbName(GroupDescPeer::DATABASE_NAME); // Set the correct dbName
 233: 
 234:         if ($con === null) {
 235:             $con = Propel::getConnection(GroupDescPeer::DATABASE_NAME, Propel::CONNECTION_READ);
 236:         }
 237:         // BasePeer returns a PDOStatement
 238:         $stmt = BasePeer::doCount($criteria, $con);
 239: 
 240:         if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
 241:             $count = (int) $row[0];
 242:         } else {
 243:             $count = 0; // no rows returned; we infer that means 0 matches.
 244:         }
 245:         $stmt->closeCursor();
 246: 
 247:         return $count;
 248:     }
 249:     /**
 250:      * Selects one object from the DB.
 251:      *
 252:      * @param      Criteria $criteria object used to create the SELECT statement.
 253:      * @param      PropelPDO $con
 254:      * @return                 GroupDesc
 255:      * @throws PropelException Any exceptions caught during processing will be
 256:      *       rethrown wrapped into a PropelException.
 257:      */
 258:     public static function doSelectOne(Criteria $criteria, PropelPDO $con = null)
 259:     {
 260:         $critcopy = clone $criteria;
 261:         $critcopy->setLimit(1);
 262:         $objects = GroupDescPeer::doSelect($critcopy, $con);
 263:         if ($objects) {
 264:             return $objects[0];
 265:         }
 266: 
 267:         return null;
 268:     }
 269:     /**
 270:      * Selects several row from the DB.
 271:      *
 272:      * @param      Criteria $criteria The Criteria object used to build the SELECT statement.
 273:      * @param      PropelPDO $con
 274:      * @return array           Array of selected Objects
 275:      * @throws PropelException Any exceptions caught during processing will be
 276:      *       rethrown wrapped into a PropelException.
 277:      */
 278:     public static function doSelect(Criteria $criteria, PropelPDO $con = null)
 279:     {
 280:         return GroupDescPeer::populateObjects(GroupDescPeer::doSelectStmt($criteria, $con));
 281:     }
 282:     /**
 283:      * Prepares the Criteria object and uses the parent doSelect() method to execute a PDOStatement.
 284:      *
 285:      * Use this method directly if you want to work with an executed statement durirectly (for example
 286:      * to perform your own object hydration).
 287:      *
 288:      * @param      Criteria $criteria The Criteria object used to build the SELECT statement.
 289:      * @param      PropelPDO $con The connection to use
 290:      * @throws PropelException Any exceptions caught during processing will be
 291:      *       rethrown wrapped into a PropelException.
 292:      * @return PDOStatement The executed PDOStatement object.
 293:      * @see        BasePeer::doSelect()
 294:      */
 295:     public static function doSelectStmt(Criteria $criteria, PropelPDO $con = null)
 296:     {
 297:         if ($con === null) {
 298:             $con = Propel::getConnection(GroupDescPeer::DATABASE_NAME, Propel::CONNECTION_READ);
 299:         }
 300: 
 301:         if (!$criteria->hasSelectClause()) {
 302:             $criteria = clone $criteria;
 303:             GroupDescPeer::addSelectColumns($criteria);
 304:         }
 305: 
 306:         // Set the correct dbName
 307:         $criteria->setDbName(GroupDescPeer::DATABASE_NAME);
 308: 
 309:         // BasePeer returns a PDOStatement
 310:         return BasePeer::doSelect($criteria, $con);
 311:     }
 312:     /**
 313:      * Adds an object to the instance pool.
 314:      *
 315:      * Propel keeps cached copies of objects in an instance pool when they are retrieved
 316:      * from the database.  In some cases -- especially when you override doSelect*()
 317:      * methods in your stub classes -- you may need to explicitly add objects
 318:      * to the cache in order to ensure that the same objects are always returned by doSelect*()
 319:      * and retrieveByPK*() calls.
 320:      *
 321:      * @param      GroupDesc $obj A GroupDesc object.
 322:      * @param      string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
 323:      */
 324:     public static function addInstanceToPool($obj, $key = null)
 325:     {
 326:         if (Propel::isInstancePoolingEnabled()) {
 327:             if ($key === null) {
 328:                 $key = (string) $obj->getId();
 329:             } // if key === null
 330:             GroupDescPeer::$instances[$key] = $obj;
 331:         }
 332:     }
 333: 
 334:     /**
 335:      * Removes an object from the instance pool.
 336:      *
 337:      * Propel keeps cached copies of objects in an instance pool when they are retrieved
 338:      * from the database.  In some cases -- especially when you override doDelete
 339:      * methods in your stub classes -- you may need to explicitly remove objects
 340:      * from the cache in order to prevent returning objects that no longer exist.
 341:      *
 342:      * @param      mixed $value A GroupDesc object or a primary key value.
 343:      *
 344:      * @return void
 345:      * @throws PropelException - if the value is invalid.
 346:      */
 347:     public static function removeInstanceFromPool($value)
 348:     {
 349:         if (Propel::isInstancePoolingEnabled() && $value !== null) {
 350:             if (is_object($value) && $value instanceof GroupDesc) {
 351:                 $key = (string) $value->getId();
 352:             } elseif (is_scalar($value)) {
 353:                 // assume we've been passed a primary key
 354:                 $key = (string) $value;
 355:             } else {
 356:                 $e = new PropelException("Invalid value passed to removeInstanceFromPool().  Expected primary key or GroupDesc object; got " . (is_object($value) ? get_class($value) . ' object.' : var_export($value,true)));
 357:                 throw $e;
 358:             }
 359: 
 360:             unset(GroupDescPeer::$instances[$key]);
 361:         }
 362:     } // removeInstanceFromPool()
 363: 
 364:     /**
 365:      * 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.
 366:      *
 367:      * For tables with a single-column primary key, that simple pkey value will be returned.  For tables with
 368:      * a multi-column primary key, a serialize()d version of the primary key will be returned.
 369:      *
 370:      * @param      string $key The key (@see getPrimaryKeyHash()) for this instance.
 371:      * @return   GroupDesc Found object or null if 1) no instance exists for specified key or 2) instance pooling has been disabled.
 372:      * @see        getPrimaryKeyHash()
 373:      */
 374:     public static function getInstanceFromPool($key)
 375:     {
 376:         if (Propel::isInstancePoolingEnabled()) {
 377:             if (isset(GroupDescPeer::$instances[$key])) {
 378:                 return GroupDescPeer::$instances[$key];
 379:             }
 380:         }
 381: 
 382:         return null; // just to be explicit
 383:     }
 384: 
 385:     /**
 386:      * Clear the instance pool.
 387:      *
 388:      * @return void
 389:      */
 390:     public static function clearInstancePool()
 391:     {
 392:         GroupDescPeer::$instances = array();
 393:     }
 394: 
 395:     /**
 396:      * Method to invalidate the instance pool of all tables related to group_desc
 397:      * by a foreign key with ON DELETE CASCADE
 398:      */
 399:     public static function clearRelatedInstancePool()
 400:     {
 401:     }
 402: 
 403:     /**
 404:      * 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.
 405:      *
 406:      * For tables with a single-column primary key, that simple pkey value will be returned.  For tables with
 407:      * a multi-column primary key, a serialize()d version of the primary key will be returned.
 408:      *
 409:      * @param      array $row PropelPDO resultset row.
 410:      * @param      int $startcol The 0-based offset for reading from the resultset row.
 411:      * @return string A string version of PK or null if the components of primary key in result array are all null.
 412:      */
 413:     public static function getPrimaryKeyHashFromRow($row, $startcol = 0)
 414:     {
 415:         // If the PK cannot be derived from the row, return null.
 416:         if ($row[$startcol] === null) {
 417:             return null;
 418:         }
 419: 
 420:         return (string) $row[$startcol];
 421:     }
 422: 
 423:     /**
 424:      * Retrieves the primary key from the DB resultset row
 425:      * For tables with a single-column primary key, that simple pkey value will be returned.  For tables with
 426:      * a multi-column primary key, an array of the primary key columns will be returned.
 427:      *
 428:      * @param      array $row PropelPDO resultset row.
 429:      * @param      int $startcol The 0-based offset for reading from the resultset row.
 430:      * @return mixed The primary key of the row
 431:      */
 432:     public static function getPrimaryKeyFromRow($row, $startcol = 0)
 433:     {
 434: 
 435:         return (int) $row[$startcol];
 436:     }
 437: 
 438:     /**
 439:      * The returned array will contain objects of the default type or
 440:      * objects that inherit from the default.
 441:      *
 442:      * @throws PropelException Any exceptions caught during processing will be
 443:      *       rethrown wrapped into a PropelException.
 444:      */
 445:     public static function populateObjects(PDOStatement $stmt)
 446:     {
 447:         $results = array();
 448: 
 449:         // set the class once to avoid overhead in the loop
 450:         $cls = GroupDescPeer::getOMClass();
 451:         // populate the object(s)
 452:         while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
 453:             $key = GroupDescPeer::getPrimaryKeyHashFromRow($row, 0);
 454:             if (null !== ($obj = GroupDescPeer::getInstanceFromPool($key))) {
 455:                 // We no longer rehydrate the object, since this can cause data loss.
 456:                 // See http://www.propelorm.org/ticket/509
 457:                 // $obj->hydrate($row, 0, true); // rehydrate
 458:                 $results[] = $obj;
 459:             } else {
 460:                 $obj = new $cls();
 461:                 $obj->hydrate($row);
 462:                 $results[] = $obj;
 463:                 GroupDescPeer::addInstanceToPool($obj, $key);
 464:             } // if key exists
 465:         }
 466:         $stmt->closeCursor();
 467: 
 468:         return $results;
 469:     }
 470:     /**
 471:      * Populates an object of the default type or an object that inherit from the default.
 472:      *
 473:      * @param      array $row PropelPDO resultset row.
 474:      * @param      int $startcol The 0-based offset for reading from the resultset row.
 475:      * @throws PropelException Any exceptions caught during processing will be
 476:      *       rethrown wrapped into a PropelException.
 477:      * @return array (GroupDesc object, last column rank)
 478:      */
 479:     public static function populateObject($row, $startcol = 0)
 480:     {
 481:         $key = GroupDescPeer::getPrimaryKeyHashFromRow($row, $startcol);
 482:         if (null !== ($obj = GroupDescPeer::getInstanceFromPool($key))) {
 483:             // We no longer rehydrate the object, since this can cause data loss.
 484:             // See http://www.propelorm.org/ticket/509
 485:             // $obj->hydrate($row, $startcol, true); // rehydrate
 486:             $col = $startcol + GroupDescPeer::NUM_HYDRATE_COLUMNS;
 487:         } else {
 488:             $cls = GroupDescPeer::OM_CLASS;
 489:             $obj = new $cls();
 490:             $col = $obj->hydrate($row, $startcol);
 491:             GroupDescPeer::addInstanceToPool($obj, $key);
 492:         }
 493: 
 494:         return array($obj, $col);
 495:     }
 496: 
 497: 
 498:     /**
 499:      * Returns the number of rows matching criteria, joining the related Group table
 500:      *
 501:      * @param      Criteria $criteria
 502:      * @param      boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
 503:      * @param      PropelPDO $con
 504:      * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
 505:      * @return int Number of matching rows.
 506:      */
 507:     public static function doCountJoinGroup(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)
 508:     {
 509:         // we're going to modify criteria, so copy it first
 510:         $criteria = clone $criteria;
 511: 
 512:         // We need to set the primary table name, since in the case that there are no WHERE columns
 513:         // it will be impossible for the BasePeer::createSelectSql() method to determine which
 514:         // tables go into the FROM clause.
 515:         $criteria->setPrimaryTableName(GroupDescPeer::TABLE_NAME);
 516: 
 517:         if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
 518:             $criteria->setDistinct();
 519:         }
 520: 
 521:         if (!$criteria->hasSelectClause()) {
 522:             GroupDescPeer::addSelectColumns($criteria);
 523:         }
 524: 
 525:         $criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count
 526: 
 527:         // Set the correct dbName
 528:         $criteria->setDbName(GroupDescPeer::DATABASE_NAME);
 529: 
 530:         if ($con === null) {
 531:             $con = Propel::getConnection(GroupDescPeer::DATABASE_NAME, Propel::CONNECTION_READ);
 532:         }
 533: 
 534:         $criteria->addJoin(GroupDescPeer::GROUP_ID, GroupPeer::ID, $join_behavior);
 535: 
 536:         $stmt = BasePeer::doCount($criteria, $con);
 537: 
 538:         if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
 539:             $count = (int) $row[0];
 540:         } else {
 541:             $count = 0; // no rows returned; we infer that means 0 matches.
 542:         }
 543:         $stmt->closeCursor();
 544: 
 545:         return $count;
 546:     }
 547: 
 548: 
 549:     /**
 550:      * Selects a collection of GroupDesc objects pre-filled with their Group objects.
 551:      * @param      Criteria  $criteria
 552:      * @param      PropelPDO $con
 553:      * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
 554:      * @return array           Array of GroupDesc objects.
 555:      * @throws PropelException Any exceptions caught during processing will be
 556:      *       rethrown wrapped into a PropelException.
 557:      */
 558:     public static function doSelectJoinGroup(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
 559:     {
 560:         $criteria = clone $criteria;
 561: 
 562:         // Set the correct dbName if it has not been overridden
 563:         if ($criteria->getDbName() == Propel::getDefaultDB()) {
 564:             $criteria->setDbName(GroupDescPeer::DATABASE_NAME);
 565:         }
 566: 
 567:         GroupDescPeer::addSelectColumns($criteria);
 568:         $startcol = GroupDescPeer::NUM_HYDRATE_COLUMNS;
 569:         GroupPeer::addSelectColumns($criteria);
 570: 
 571:         $criteria->addJoin(GroupDescPeer::GROUP_ID, GroupPeer::ID, $join_behavior);
 572: 
 573:         $stmt = BasePeer::doSelect($criteria, $con);
 574:         $results = array();
 575: 
 576:         while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
 577:             $key1 = GroupDescPeer::getPrimaryKeyHashFromRow($row, 0);
 578:             if (null !== ($obj1 = GroupDescPeer::getInstanceFromPool($key1))) {
 579:                 // We no longer rehydrate the object, since this can cause data loss.
 580:                 // See http://www.propelorm.org/ticket/509
 581:                 // $obj1->hydrate($row, 0, true); // rehydrate
 582:             } else {
 583: 
 584:                 $cls = GroupDescPeer::getOMClass();
 585: 
 586:                 $obj1 = new $cls();
 587:                 $obj1->hydrate($row);
 588:                 GroupDescPeer::addInstanceToPool($obj1, $key1);
 589:             } // if $obj1 already loaded
 590: 
 591:             $key2 = GroupPeer::getPrimaryKeyHashFromRow($row, $startcol);
 592:             if ($key2 !== null) {
 593:                 $obj2 = GroupPeer::getInstanceFromPool($key2);
 594:                 if (!$obj2) {
 595: 
 596:                     $cls = GroupPeer::getOMClass();
 597: 
 598:                     $obj2 = new $cls();
 599:                     $obj2->hydrate($row, $startcol);
 600:                     GroupPeer::addInstanceToPool($obj2, $key2);
 601:                 } // if obj2 already loaded
 602: 
 603:                 // Add the $obj1 (GroupDesc) to $obj2 (Group)
 604:                 $obj2->addGroupDesc($obj1);
 605: 
 606:             } // if joined row was not null
 607: 
 608:             $results[] = $obj1;
 609:         }
 610:         $stmt->closeCursor();
 611: 
 612:         return $results;
 613:     }
 614: 
 615: 
 616:     /**
 617:      * Returns the number of rows matching criteria, joining all related tables
 618:      *
 619:      * @param      Criteria $criteria
 620:      * @param      boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
 621:      * @param      PropelPDO $con
 622:      * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
 623:      * @return int Number of matching rows.
 624:      */
 625:     public static function doCountJoinAll(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)
 626:     {
 627:         // we're going to modify criteria, so copy it first
 628:         $criteria = clone $criteria;
 629: 
 630:         // We need to set the primary table name, since in the case that there are no WHERE columns
 631:         // it will be impossible for the BasePeer::createSelectSql() method to determine which
 632:         // tables go into the FROM clause.
 633:         $criteria->setPrimaryTableName(GroupDescPeer::TABLE_NAME);
 634: 
 635:         if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
 636:             $criteria->setDistinct();
 637:         }
 638: 
 639:         if (!$criteria->hasSelectClause()) {
 640:             GroupDescPeer::addSelectColumns($criteria);
 641:         }
 642: 
 643:         $criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count
 644: 
 645:         // Set the correct dbName
 646:         $criteria->setDbName(GroupDescPeer::DATABASE_NAME);
 647: 
 648:         if ($con === null) {
 649:             $con = Propel::getConnection(GroupDescPeer::DATABASE_NAME, Propel::CONNECTION_READ);
 650:         }
 651: 
 652:         $criteria->addJoin(GroupDescPeer::GROUP_ID, GroupPeer::ID, $join_behavior);
 653: 
 654:         $stmt = BasePeer::doCount($criteria, $con);
 655: 
 656:         if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
 657:             $count = (int) $row[0];
 658:         } else {
 659:             $count = 0; // no rows returned; we infer that means 0 matches.
 660:         }
 661:         $stmt->closeCursor();
 662: 
 663:         return $count;
 664:     }
 665: 
 666:     /**
 667:      * Selects a collection of GroupDesc objects pre-filled with all related objects.
 668:      *
 669:      * @param      Criteria  $criteria
 670:      * @param      PropelPDO $con
 671:      * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
 672:      * @return array           Array of GroupDesc objects.
 673:      * @throws PropelException Any exceptions caught during processing will be
 674:      *       rethrown wrapped into a PropelException.
 675:      */
 676:     public static function doSelectJoinAll(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
 677:     {
 678:         $criteria = clone $criteria;
 679: 
 680:         // Set the correct dbName if it has not been overridden
 681:         if ($criteria->getDbName() == Propel::getDefaultDB()) {
 682:             $criteria->setDbName(GroupDescPeer::DATABASE_NAME);
 683:         }
 684: 
 685:         GroupDescPeer::addSelectColumns($criteria);
 686:         $startcol2 = GroupDescPeer::NUM_HYDRATE_COLUMNS;
 687: 
 688:         GroupPeer::addSelectColumns($criteria);
 689:         $startcol3 = $startcol2 + GroupPeer::NUM_HYDRATE_COLUMNS;
 690: 
 691:         $criteria->addJoin(GroupDescPeer::GROUP_ID, GroupPeer::ID, $join_behavior);
 692: 
 693:         $stmt = BasePeer::doSelect($criteria, $con);
 694:         $results = array();
 695: 
 696:         while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
 697:             $key1 = GroupDescPeer::getPrimaryKeyHashFromRow($row, 0);
 698:             if (null !== ($obj1 = GroupDescPeer::getInstanceFromPool($key1))) {
 699:                 // We no longer rehydrate the object, since this can cause data loss.
 700:                 // See http://www.propelorm.org/ticket/509
 701:                 // $obj1->hydrate($row, 0, true); // rehydrate
 702:             } else {
 703:                 $cls = GroupDescPeer::getOMClass();
 704: 
 705:                 $obj1 = new $cls();
 706:                 $obj1->hydrate($row);
 707:                 GroupDescPeer::addInstanceToPool($obj1, $key1);
 708:             } // if obj1 already loaded
 709: 
 710:             // Add objects for joined Group rows
 711: 
 712:             $key2 = GroupPeer::getPrimaryKeyHashFromRow($row, $startcol2);
 713:             if ($key2 !== null) {
 714:                 $obj2 = GroupPeer::getInstanceFromPool($key2);
 715:                 if (!$obj2) {
 716: 
 717:                     $cls = GroupPeer::getOMClass();
 718: 
 719:                     $obj2 = new $cls();
 720:                     $obj2->hydrate($row, $startcol2);
 721:                     GroupPeer::addInstanceToPool($obj2, $key2);
 722:                 } // if obj2 loaded
 723: 
 724:                 // Add the $obj1 (GroupDesc) to the collection in $obj2 (Group)
 725:                 $obj2->addGroupDesc($obj1);
 726:             } // if joined row not null
 727: 
 728:             $results[] = $obj1;
 729:         }
 730:         $stmt->closeCursor();
 731: 
 732:         return $results;
 733:     }
 734: 
 735:     /**
 736:      * Returns the TableMap related to this peer.
 737:      * This method is not needed for general use but a specific application could have a need.
 738:      * @return TableMap
 739:      * @throws PropelException Any exceptions caught during processing will be
 740:      *       rethrown wrapped into a PropelException.
 741:      */
 742:     public static function getTableMap()
 743:     {
 744:         return Propel::getDatabaseMap(GroupDescPeer::DATABASE_NAME)->getTable(GroupDescPeer::TABLE_NAME);
 745:     }
 746: 
 747:     /**
 748:      * Add a TableMap instance to the database for this peer class.
 749:      */
 750:     public static function buildTableMap()
 751:     {
 752:       $dbMap = Propel::getDatabaseMap(BaseGroupDescPeer::DATABASE_NAME);
 753:       if (!$dbMap->hasTable(BaseGroupDescPeer::TABLE_NAME)) {
 754:         $dbMap->addTableObject(new GroupDescTableMap());
 755:       }
 756:     }
 757: 
 758:     /**
 759:      * The class that the Peer will make instances of.
 760:      *
 761:      *
 762:      * @return string ClassName
 763:      */
 764:     public static function getOMClass()
 765:     {
 766:         return GroupDescPeer::OM_CLASS;
 767:     }
 768: 
 769:     /**
 770:      * Performs an INSERT on the database, given a GroupDesc or Criteria object.
 771:      *
 772:      * @param      mixed $values Criteria or GroupDesc object containing data that is used to create the INSERT statement.
 773:      * @param      PropelPDO $con the PropelPDO connection to use
 774:      * @return mixed           The new primary key.
 775:      * @throws PropelException Any exceptions caught during processing will be
 776:      *       rethrown wrapped into a PropelException.
 777:      */
 778:     public static function doInsert($values, PropelPDO $con = null)
 779:     {
 780:         if ($con === null) {
 781:             $con = Propel::getConnection(GroupDescPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
 782:         }
 783: 
 784:         if ($values instanceof Criteria) {
 785:             $criteria = clone $values; // rename for clarity
 786:         } else {
 787:             $criteria = $values->buildCriteria(); // build Criteria from GroupDesc object
 788:         }
 789: 
 790: 
 791:         // Set the correct dbName
 792:         $criteria->setDbName(GroupDescPeer::DATABASE_NAME);
 793: 
 794:         try {
 795:             // use transaction because $criteria could contain info
 796:             // for more than one table (I guess, conceivably)
 797:             $con->beginTransaction();
 798:             $pk = BasePeer::doInsert($criteria, $con);
 799:             $con->commit();
 800:         } catch (PropelException $e) {
 801:             $con->rollBack();
 802:             throw $e;
 803:         }
 804: 
 805:         return $pk;
 806:     }
 807: 
 808:     /**
 809:      * Performs an UPDATE on the database, given a GroupDesc or Criteria object.
 810:      *
 811:      * @param      mixed $values Criteria or GroupDesc object containing data that is used to create the UPDATE statement.
 812:      * @param      PropelPDO $con The connection to use (specify PropelPDO connection object to exert more control over transactions).
 813:      * @return int             The number of affected rows (if supported by underlying database driver).
 814:      * @throws PropelException Any exceptions caught during processing will be
 815:      *       rethrown wrapped into a PropelException.
 816:      */
 817:     public static function doUpdate($values, PropelPDO $con = null)
 818:     {
 819:         if ($con === null) {
 820:             $con = Propel::getConnection(GroupDescPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
 821:         }
 822: 
 823:         $selectCriteria = new Criteria(GroupDescPeer::DATABASE_NAME);
 824: 
 825:         if ($values instanceof Criteria) {
 826:             $criteria = clone $values; // rename for clarity
 827: 
 828:             $comparison = $criteria->getComparison(GroupDescPeer::ID);
 829:             $value = $criteria->remove(GroupDescPeer::ID);
 830:             if ($value) {
 831:                 $selectCriteria->add(GroupDescPeer::ID, $value, $comparison);
 832:             } else {
 833:                 $selectCriteria->setPrimaryTableName(GroupDescPeer::TABLE_NAME);
 834:             }
 835: 
 836:         } else { // $values is GroupDesc object
 837:             $criteria = $values->buildCriteria(); // gets full criteria
 838:             $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
 839:         }
 840: 
 841:         // set the correct dbName
 842:         $criteria->setDbName(GroupDescPeer::DATABASE_NAME);
 843: 
 844:         return BasePeer::doUpdate($selectCriteria, $criteria, $con);
 845:     }
 846: 
 847:     /**
 848:      * Deletes all rows from the group_desc table.
 849:      *
 850:      * @param      PropelPDO $con the connection to use
 851:      * @return int             The number of affected rows (if supported by underlying database driver).
 852:      * @throws PropelException
 853:      */
 854:     public static function doDeleteAll(PropelPDO $con = null)
 855:     {
 856:         if ($con === null) {
 857:             $con = Propel::getConnection(GroupDescPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
 858:         }
 859:         $affectedRows = 0; // initialize var to track total num of affected rows
 860:         try {
 861:             // use transaction because $criteria could contain info
 862:             // for more than one table or we could emulating ON DELETE CASCADE, etc.
 863:             $con->beginTransaction();
 864:             $affectedRows += BasePeer::doDeleteAll(GroupDescPeer::TABLE_NAME, $con, GroupDescPeer::DATABASE_NAME);
 865:             // Because this db requires some delete cascade/set null emulation, we have to
 866:             // clear the cached instance *after* the emulation has happened (since
 867:             // instances get re-added by the select statement contained therein).
 868:             GroupDescPeer::clearInstancePool();
 869:             GroupDescPeer::clearRelatedInstancePool();
 870:             $con->commit();
 871: 
 872:             return $affectedRows;
 873:         } catch (PropelException $e) {
 874:             $con->rollBack();
 875:             throw $e;
 876:         }
 877:     }
 878: 
 879:     /**
 880:      * Performs a DELETE on the database, given a GroupDesc or Criteria object OR a primary key value.
 881:      *
 882:      * @param      mixed $values Criteria or GroupDesc object or primary key or array of primary keys
 883:      *              which is used to create the DELETE statement
 884:      * @param      PropelPDO $con the connection to use
 885:      * @return int The number of affected rows (if supported by underlying database driver).  This includes CASCADE-related rows
 886:      *              if supported by native driver or if emulated using Propel.
 887:      * @throws PropelException Any exceptions caught during processing will be
 888:      *       rethrown wrapped into a PropelException.
 889:      */
 890:      public static function doDelete($values, PropelPDO $con = null)
 891:      {
 892:         if ($con === null) {
 893:             $con = Propel::getConnection(GroupDescPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
 894:         }
 895: 
 896:         if ($values instanceof Criteria) {
 897:             // invalidate the cache for all objects of this type, since we have no
 898:             // way of knowing (without running a query) what objects should be invalidated
 899:             // from the cache based on this Criteria.
 900:             GroupDescPeer::clearInstancePool();
 901:             // rename for clarity
 902:             $criteria = clone $values;
 903:         } elseif ($values instanceof GroupDesc) { // it's a model object
 904:             // invalidate the cache for this single object
 905:             GroupDescPeer::removeInstanceFromPool($values);
 906:             // create criteria based on pk values
 907:             $criteria = $values->buildPkeyCriteria();
 908:         } else { // it's a primary key, or an array of pks
 909:             $criteria = new Criteria(GroupDescPeer::DATABASE_NAME);
 910:             $criteria->add(GroupDescPeer::ID, (array) $values, Criteria::IN);
 911:             // invalidate the cache for this object(s)
 912:             foreach ((array) $values as $singleval) {
 913:                 GroupDescPeer::removeInstanceFromPool($singleval);
 914:             }
 915:         }
 916: 
 917:         // Set the correct dbName
 918:         $criteria->setDbName(GroupDescPeer::DATABASE_NAME);
 919: 
 920:         $affectedRows = 0; // initialize var to track total num of affected rows
 921: 
 922:         try {
 923:             // use transaction because $criteria could contain info
 924:             // for more than one table or we could emulating ON DELETE CASCADE, etc.
 925:             $con->beginTransaction();
 926: 
 927:             $affectedRows += BasePeer::doDelete($criteria, $con);
 928:             GroupDescPeer::clearRelatedInstancePool();
 929:             $con->commit();
 930: 
 931:             return $affectedRows;
 932:         } catch (PropelException $e) {
 933:             $con->rollBack();
 934:             throw $e;
 935:         }
 936:     }
 937: 
 938:     /**
 939:      * Validates all modified columns of given GroupDesc object.
 940:      * If parameter $columns is either a single column name or an array of column names
 941:      * than only those columns are validated.
 942:      *
 943:      * NOTICE: This does not apply to primary or foreign keys for now.
 944:      *
 945:      * @param      GroupDesc $obj The object to validate.
 946:      * @param      mixed $cols Column name or array of column names.
 947:      *
 948:      * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
 949:      */
 950:     public static function doValidate($obj, $cols = null)
 951:     {
 952:         $columns = array();
 953: 
 954:         if ($cols) {
 955:             $dbMap = Propel::getDatabaseMap(GroupDescPeer::DATABASE_NAME);
 956:             $tableMap = $dbMap->getTable(GroupDescPeer::TABLE_NAME);
 957: 
 958:             if (! is_array($cols)) {
 959:                 $cols = array($cols);
 960:             }
 961: 
 962:             foreach ($cols as $colName) {
 963:                 if ($tableMap->hasColumn($colName)) {
 964:                     $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
 965:                     $columns[$colName] = $obj->$get();
 966:                 }
 967:             }
 968:         } else {
 969: 
 970:         }
 971: 
 972:         return BasePeer::doValidate(GroupDescPeer::DATABASE_NAME, GroupDescPeer::TABLE_NAME, $columns);
 973:     }
 974: 
 975:     /**
 976:      * Retrieve a single object by pkey.
 977:      *
 978:      * @param      int $pk the primary key.
 979:      * @param      PropelPDO $con the connection to use
 980:      * @return GroupDesc
 981:      */
 982:     public static function retrieveByPK($pk, PropelPDO $con = null)
 983:     {
 984: 
 985:         if (null !== ($obj = GroupDescPeer::getInstanceFromPool((string) $pk))) {
 986:             return $obj;
 987:         }
 988: 
 989:         if ($con === null) {
 990:             $con = Propel::getConnection(GroupDescPeer::DATABASE_NAME, Propel::CONNECTION_READ);
 991:         }
 992: 
 993:         $criteria = new Criteria(GroupDescPeer::DATABASE_NAME);
 994:         $criteria->add(GroupDescPeer::ID, $pk);
 995: 
 996:         $v = GroupDescPeer::doSelect($criteria, $con);
 997: 
 998:         return !empty($v) > 0 ? $v[0] : null;
 999:     }
1000: 
1001:     /**
1002:      * Retrieve multiple objects by pkey.
1003:      *
1004:      * @param      array $pks List of primary keys
1005:      * @param      PropelPDO $con the connection to use
1006:      * @return GroupDesc[]
1007:      * @throws PropelException Any exceptions caught during processing will be
1008:      *       rethrown wrapped into a PropelException.
1009:      */
1010:     public static function retrieveByPKs($pks, PropelPDO $con = null)
1011:     {
1012:         if ($con === null) {
1013:             $con = Propel::getConnection(GroupDescPeer::DATABASE_NAME, Propel::CONNECTION_READ);
1014:         }
1015: 
1016:         $objs = null;
1017:         if (empty($pks)) {
1018:             $objs = array();
1019:         } else {
1020:             $criteria = new Criteria(GroupDescPeer::DATABASE_NAME);
1021:             $criteria->add(GroupDescPeer::ID, $pks, Criteria::IN);
1022:             $objs = GroupDescPeer::doSelect($criteria, $con);
1023:         }
1024: 
1025:         return $objs;
1026:     }
1027: 
1028: } // BaseGroupDescPeer
1029: 
1030: // This is the static code needed to register the TableMap for this table with the main Propel class.
1031: //
1032: BaseGroupDescPeer::buildTableMap();
1033: 
1034: 
thelia API documentation generated by ApiGen 2.8.0