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