Overview

Namespaces

  • cli_db
    • propel
      • map
      • om
  • cli_import
  • LoggedPDO
  • None
  • PHP
  • webservices
    • cart
    • combisearch
    • details
      • annotations
        • feature
    • graphs
      • barplot
      • genome
    • listing
    • queue

Classes

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