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 \BaseObject;
   6: use \BasePeer;
   7: use \Criteria;
   8: use \Exception;
   9: use \PDO;
  10: use \Persistent;
  11: use \Propel;
  12: use \PropelCollection;
  13: use \PropelException;
  14: use \PropelObjectCollection;
  15: use \PropelPDO;
  16: use cli_db\propel\Cvterm;
  17: use cli_db\propel\CvtermQuery;
  18: use cli_db\propel\Feature;
  19: use cli_db\propel\FeatureCvterm;
  20: use cli_db\propel\FeatureCvtermDbxref;
  21: use cli_db\propel\FeatureCvtermDbxrefQuery;
  22: use cli_db\propel\FeatureCvtermPeer;
  23: use cli_db\propel\FeatureCvtermPub;
  24: use cli_db\propel\FeatureCvtermPubQuery;
  25: use cli_db\propel\FeatureCvtermQuery;
  26: use cli_db\propel\FeatureCvtermprop;
  27: use cli_db\propel\FeatureCvtermpropQuery;
  28: use cli_db\propel\FeatureQuery;
  29: use cli_db\propel\Pub;
  30: use cli_db\propel\PubQuery;
  31: 
  32: /**
  33:  * Base class that represents a row from the 'feature_cvterm' table.
  34:  *
  35:  *
  36:  *
  37:  * @package    propel.generator.cli_db.om
  38:  */
  39: abstract class BaseFeatureCvterm extends BaseObject implements Persistent
  40: {
  41:     /**
  42:      * Peer class name
  43:      */
  44:     const PEER = 'cli_db\\propel\\FeatureCvtermPeer';
  45: 
  46:     /**
  47:      * The Peer class.
  48:      * Instance provides a convenient way of calling static methods on a class
  49:      * that calling code may not be able to identify.
  50:      * @var        FeatureCvtermPeer
  51:      */
  52:     protected static $peer;
  53: 
  54:     /**
  55:      * The flag var to prevent infinit loop in deep copy
  56:      * @var       boolean
  57:      */
  58:     protected $startCopy = false;
  59: 
  60:     /**
  61:      * The value for the feature_cvterm_id field.
  62:      * @var        int
  63:      */
  64:     protected $feature_cvterm_id;
  65: 
  66:     /**
  67:      * The value for the feature_id field.
  68:      * @var        int
  69:      */
  70:     protected $feature_id;
  71: 
  72:     /**
  73:      * The value for the cvterm_id field.
  74:      * @var        int
  75:      */
  76:     protected $cvterm_id;
  77: 
  78:     /**
  79:      * The value for the pub_id field.
  80:      * @var        int
  81:      */
  82:     protected $pub_id;
  83: 
  84:     /**
  85:      * The value for the is_not field.
  86:      * Note: this column has a database default value of: false
  87:      * @var        boolean
  88:      */
  89:     protected $is_not;
  90: 
  91:     /**
  92:      * The value for the rank field.
  93:      * Note: this column has a database default value of: 0
  94:      * @var        int
  95:      */
  96:     protected $rank;
  97: 
  98:     /**
  99:      * @var        Cvterm
 100:      */
 101:     protected $aCvterm;
 102: 
 103:     /**
 104:      * @var        Feature
 105:      */
 106:     protected $aFeature;
 107: 
 108:     /**
 109:      * @var        Pub
 110:      */
 111:     protected $aPub;
 112: 
 113:     /**
 114:      * @var        PropelObjectCollection|FeatureCvtermDbxref[] Collection to store aggregation of FeatureCvtermDbxref objects.
 115:      */
 116:     protected $collFeatureCvtermDbxrefs;
 117:     protected $collFeatureCvtermDbxrefsPartial;
 118: 
 119:     /**
 120:      * @var        PropelObjectCollection|FeatureCvtermPub[] Collection to store aggregation of FeatureCvtermPub objects.
 121:      */
 122:     protected $collFeatureCvtermPubs;
 123:     protected $collFeatureCvtermPubsPartial;
 124: 
 125:     /**
 126:      * @var        PropelObjectCollection|FeatureCvtermprop[] Collection to store aggregation of FeatureCvtermprop objects.
 127:      */
 128:     protected $collFeatureCvtermprops;
 129:     protected $collFeatureCvtermpropsPartial;
 130: 
 131:     /**
 132:      * Flag to prevent endless save loop, if this object is referenced
 133:      * by another object which falls in this transaction.
 134:      * @var        boolean
 135:      */
 136:     protected $alreadyInSave = false;
 137: 
 138:     /**
 139:      * Flag to prevent endless validation loop, if this object is referenced
 140:      * by another object which falls in this transaction.
 141:      * @var        boolean
 142:      */
 143:     protected $alreadyInValidation = false;
 144: 
 145:     /**
 146:      * Flag to prevent endless clearAllReferences($deep=true) loop, if this object is referenced
 147:      * @var        boolean
 148:      */
 149:     protected $alreadyInClearAllReferencesDeep = false;
 150: 
 151:     /**
 152:      * An array of objects scheduled for deletion.
 153:      * @var     PropelObjectCollection
 154:      */
 155:     protected $featureCvtermDbxrefsScheduledForDeletion = null;
 156: 
 157:     /**
 158:      * An array of objects scheduled for deletion.
 159:      * @var     PropelObjectCollection
 160:      */
 161:     protected $featureCvtermPubsScheduledForDeletion = null;
 162: 
 163:     /**
 164:      * An array of objects scheduled for deletion.
 165:      * @var     PropelObjectCollection
 166:      */
 167:     protected $featureCvtermpropsScheduledForDeletion = null;
 168: 
 169:     /**
 170:      * Applies default values to this object.
 171:      * This method should be called from the object's constructor (or
 172:      * equivalent initialization method).
 173:      * @see        __construct()
 174:      */
 175:     public function applyDefaultValues()
 176:     {
 177:         $this->is_not = false;
 178:         $this->rank = 0;
 179:     }
 180: 
 181:     /**
 182:      * Initializes internal state of BaseFeatureCvterm object.
 183:      * @see        applyDefaults()
 184:      */
 185:     public function __construct()
 186:     {
 187:         parent::__construct();
 188:         $this->applyDefaultValues();
 189:     }
 190: 
 191:     /**
 192:      * Get the [feature_cvterm_id] column value.
 193:      *
 194:      * @return int
 195:      */
 196:     public function getFeatureCvtermId()
 197:     {
 198:         return $this->feature_cvterm_id;
 199:     }
 200: 
 201:     /**
 202:      * Get the [feature_id] column value.
 203:      *
 204:      * @return int
 205:      */
 206:     public function getFeatureId()
 207:     {
 208:         return $this->feature_id;
 209:     }
 210: 
 211:     /**
 212:      * Get the [cvterm_id] column value.
 213:      *
 214:      * @return int
 215:      */
 216:     public function getCvtermId()
 217:     {
 218:         return $this->cvterm_id;
 219:     }
 220: 
 221:     /**
 222:      * Get the [pub_id] column value.
 223:      *
 224:      * @return int
 225:      */
 226:     public function getPubId()
 227:     {
 228:         return $this->pub_id;
 229:     }
 230: 
 231:     /**
 232:      * Get the [is_not] column value.
 233:      *
 234:      * @return boolean
 235:      */
 236:     public function getIsNot()
 237:     {
 238:         return $this->is_not;
 239:     }
 240: 
 241:     /**
 242:      * Get the [rank] column value.
 243:      *
 244:      * @return int
 245:      */
 246:     public function getRank()
 247:     {
 248:         return $this->rank;
 249:     }
 250: 
 251:     /**
 252:      * Set the value of [feature_cvterm_id] column.
 253:      *
 254:      * @param int $v new value
 255:      * @return FeatureCvterm The current object (for fluent API support)
 256:      */
 257:     public function setFeatureCvtermId($v)
 258:     {
 259:         if ($v !== null && is_numeric($v)) {
 260:             $v = (int) $v;
 261:         }
 262: 
 263:         if ($this->feature_cvterm_id !== $v) {
 264:             $this->feature_cvterm_id = $v;
 265:             $this->modifiedColumns[] = FeatureCvtermPeer::FEATURE_CVTERM_ID;
 266:         }
 267: 
 268: 
 269:         return $this;
 270:     } // setFeatureCvtermId()
 271: 
 272:     /**
 273:      * Set the value of [feature_id] column.
 274:      *
 275:      * @param int $v new value
 276:      * @return FeatureCvterm The current object (for fluent API support)
 277:      */
 278:     public function setFeatureId($v)
 279:     {
 280:         if ($v !== null && is_numeric($v)) {
 281:             $v = (int) $v;
 282:         }
 283: 
 284:         if ($this->feature_id !== $v) {
 285:             $this->feature_id = $v;
 286:             $this->modifiedColumns[] = FeatureCvtermPeer::FEATURE_ID;
 287:         }
 288: 
 289:         if ($this->aFeature !== null && $this->aFeature->getFeatureId() !== $v) {
 290:             $this->aFeature = null;
 291:         }
 292: 
 293: 
 294:         return $this;
 295:     } // setFeatureId()
 296: 
 297:     /**
 298:      * Set the value of [cvterm_id] column.
 299:      *
 300:      * @param int $v new value
 301:      * @return FeatureCvterm The current object (for fluent API support)
 302:      */
 303:     public function setCvtermId($v)
 304:     {
 305:         if ($v !== null && is_numeric($v)) {
 306:             $v = (int) $v;
 307:         }
 308: 
 309:         if ($this->cvterm_id !== $v) {
 310:             $this->cvterm_id = $v;
 311:             $this->modifiedColumns[] = FeatureCvtermPeer::CVTERM_ID;
 312:         }
 313: 
 314:         if ($this->aCvterm !== null && $this->aCvterm->getCvtermId() !== $v) {
 315:             $this->aCvterm = null;
 316:         }
 317: 
 318: 
 319:         return $this;
 320:     } // setCvtermId()
 321: 
 322:     /**
 323:      * Set the value of [pub_id] column.
 324:      *
 325:      * @param int $v new value
 326:      * @return FeatureCvterm The current object (for fluent API support)
 327:      */
 328:     public function setPubId($v)
 329:     {
 330:         if ($v !== null && is_numeric($v)) {
 331:             $v = (int) $v;
 332:         }
 333: 
 334:         if ($this->pub_id !== $v) {
 335:             $this->pub_id = $v;
 336:             $this->modifiedColumns[] = FeatureCvtermPeer::PUB_ID;
 337:         }
 338: 
 339:         if ($this->aPub !== null && $this->aPub->getPubId() !== $v) {
 340:             $this->aPub = null;
 341:         }
 342: 
 343: 
 344:         return $this;
 345:     } // setPubId()
 346: 
 347:     /**
 348:      * Sets the value of the [is_not] column.
 349:      * Non-boolean arguments are converted using the following rules:
 350:      *   * 1, '1', 'true',  'on',  and 'yes' are converted to boolean true
 351:      *   * 0, '0', 'false', 'off', and 'no'  are converted to boolean false
 352:      * Check on string values is case insensitive (so 'FaLsE' is seen as 'false').
 353:      *
 354:      * @param boolean|integer|string $v The new value
 355:      * @return FeatureCvterm The current object (for fluent API support)
 356:      */
 357:     public function setIsNot($v)
 358:     {
 359:         if ($v !== null) {
 360:             if (is_string($v)) {
 361:                 $v = in_array(strtolower($v), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
 362:             } else {
 363:                 $v = (boolean) $v;
 364:             }
 365:         }
 366: 
 367:         if ($this->is_not !== $v) {
 368:             $this->is_not = $v;
 369:             $this->modifiedColumns[] = FeatureCvtermPeer::IS_NOT;
 370:         }
 371: 
 372: 
 373:         return $this;
 374:     } // setIsNot()
 375: 
 376:     /**
 377:      * Set the value of [rank] column.
 378:      *
 379:      * @param int $v new value
 380:      * @return FeatureCvterm The current object (for fluent API support)
 381:      */
 382:     public function setRank($v)
 383:     {
 384:         if ($v !== null && is_numeric($v)) {
 385:             $v = (int) $v;
 386:         }
 387: 
 388:         if ($this->rank !== $v) {
 389:             $this->rank = $v;
 390:             $this->modifiedColumns[] = FeatureCvtermPeer::RANK;
 391:         }
 392: 
 393: 
 394:         return $this;
 395:     } // setRank()
 396: 
 397:     /**
 398:      * Indicates whether the columns in this object are only set to default values.
 399:      *
 400:      * This method can be used in conjunction with isModified() to indicate whether an object is both
 401:      * modified _and_ has some values set which are non-default.
 402:      *
 403:      * @return boolean Whether the columns in this object are only been set with default values.
 404:      */
 405:     public function hasOnlyDefaultValues()
 406:     {
 407:             if ($this->is_not !== false) {
 408:                 return false;
 409:             }
 410: 
 411:             if ($this->rank !== 0) {
 412:                 return false;
 413:             }
 414: 
 415:         // otherwise, everything was equal, so return true
 416:         return true;
 417:     } // hasOnlyDefaultValues()
 418: 
 419:     /**
 420:      * Hydrates (populates) the object variables with values from the database resultset.
 421:      *
 422:      * An offset (0-based "start column") is specified so that objects can be hydrated
 423:      * with a subset of the columns in the resultset rows.  This is needed, for example,
 424:      * for results of JOIN queries where the resultset row includes columns from two or
 425:      * more tables.
 426:      *
 427:      * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM)
 428:      * @param int $startcol 0-based offset column which indicates which restultset column to start with.
 429:      * @param boolean $rehydrate Whether this object is being re-hydrated from the database.
 430:      * @return int             next starting column
 431:      * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
 432:      */
 433:     public function hydrate($row, $startcol = 0, $rehydrate = false)
 434:     {
 435:         try {
 436: 
 437:             $this->feature_cvterm_id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null;
 438:             $this->feature_id = ($row[$startcol + 1] !== null) ? (int) $row[$startcol + 1] : null;
 439:             $this->cvterm_id = ($row[$startcol + 2] !== null) ? (int) $row[$startcol + 2] : null;
 440:             $this->pub_id = ($row[$startcol + 3] !== null) ? (int) $row[$startcol + 3] : null;
 441:             $this->is_not = ($row[$startcol + 4] !== null) ? (boolean) $row[$startcol + 4] : null;
 442:             $this->rank = ($row[$startcol + 5] !== null) ? (int) $row[$startcol + 5] : null;
 443:             $this->resetModified();
 444: 
 445:             $this->setNew(false);
 446: 
 447:             if ($rehydrate) {
 448:                 $this->ensureConsistency();
 449:             }
 450:             $this->postHydrate($row, $startcol, $rehydrate);
 451:             return $startcol + 6; // 6 = FeatureCvtermPeer::NUM_HYDRATE_COLUMNS.
 452: 
 453:         } catch (Exception $e) {
 454:             throw new PropelException("Error populating FeatureCvterm object", $e);
 455:         }
 456:     }
 457: 
 458:     /**
 459:      * Checks and repairs the internal consistency of the object.
 460:      *
 461:      * This method is executed after an already-instantiated object is re-hydrated
 462:      * from the database.  It exists to check any foreign keys to make sure that
 463:      * the objects related to the current object are correct based on foreign key.
 464:      *
 465:      * You can override this method in the stub class, but you should always invoke
 466:      * the base method from the overridden method (i.e. parent::ensureConsistency()),
 467:      * in case your model changes.
 468:      *
 469:      * @throws PropelException
 470:      */
 471:     public function ensureConsistency()
 472:     {
 473: 
 474:         if ($this->aFeature !== null && $this->feature_id !== $this->aFeature->getFeatureId()) {
 475:             $this->aFeature = null;
 476:         }
 477:         if ($this->aCvterm !== null && $this->cvterm_id !== $this->aCvterm->getCvtermId()) {
 478:             $this->aCvterm = null;
 479:         }
 480:         if ($this->aPub !== null && $this->pub_id !== $this->aPub->getPubId()) {
 481:             $this->aPub = null;
 482:         }
 483:     } // ensureConsistency
 484: 
 485:     /**
 486:      * Reloads this object from datastore based on primary key and (optionally) resets all associated objects.
 487:      *
 488:      * This will only work if the object has been saved and has a valid primary key set.
 489:      *
 490:      * @param boolean $deep (optional) Whether to also de-associated any related objects.
 491:      * @param PropelPDO $con (optional) The PropelPDO connection to use.
 492:      * @return void
 493:      * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db
 494:      */
 495:     public function reload($deep = false, PropelPDO $con = null)
 496:     {
 497:         if ($this->isDeleted()) {
 498:             throw new PropelException("Cannot reload a deleted object.");
 499:         }
 500: 
 501:         if ($this->isNew()) {
 502:             throw new PropelException("Cannot reload an unsaved object.");
 503:         }
 504: 
 505:         if ($con === null) {
 506:             $con = Propel::getConnection(FeatureCvtermPeer::DATABASE_NAME, Propel::CONNECTION_READ);
 507:         }
 508: 
 509:         // We don't need to alter the object instance pool; we're just modifying this instance
 510:         // already in the pool.
 511: 
 512:         $stmt = FeatureCvtermPeer::doSelectStmt($this->buildPkeyCriteria(), $con);
 513:         $row = $stmt->fetch(PDO::FETCH_NUM);
 514:         $stmt->closeCursor();
 515:         if (!$row) {
 516:             throw new PropelException('Cannot find matching row in the database to reload object values.');
 517:         }
 518:         $this->hydrate($row, 0, true); // rehydrate
 519: 
 520:         if ($deep) {  // also de-associate any related objects?
 521: 
 522:             $this->aCvterm = null;
 523:             $this->aFeature = null;
 524:             $this->aPub = null;
 525:             $this->collFeatureCvtermDbxrefs = null;
 526: 
 527:             $this->collFeatureCvtermPubs = null;
 528: 
 529:             $this->collFeatureCvtermprops = null;
 530: 
 531:         } // if (deep)
 532:     }
 533: 
 534:     /**
 535:      * Removes this object from datastore and sets delete attribute.
 536:      *
 537:      * @param PropelPDO $con
 538:      * @return void
 539:      * @throws PropelException
 540:      * @throws Exception
 541:      * @see        BaseObject::setDeleted()
 542:      * @see        BaseObject::isDeleted()
 543:      */
 544:     public function delete(PropelPDO $con = null)
 545:     {
 546:         if ($this->isDeleted()) {
 547:             throw new PropelException("This object has already been deleted.");
 548:         }
 549: 
 550:         if ($con === null) {
 551:             $con = Propel::getConnection(FeatureCvtermPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
 552:         }
 553: 
 554:         $con->beginTransaction();
 555:         try {
 556:             $deleteQuery = FeatureCvtermQuery::create()
 557:                 ->filterByPrimaryKey($this->getPrimaryKey());
 558:             $ret = $this->preDelete($con);
 559:             if ($ret) {
 560:                 $deleteQuery->delete($con);
 561:                 $this->postDelete($con);
 562:                 $con->commit();
 563:                 $this->setDeleted(true);
 564:             } else {
 565:                 $con->commit();
 566:             }
 567:         } catch (Exception $e) {
 568:             $con->rollBack();
 569:             throw $e;
 570:         }
 571:     }
 572: 
 573:     /**
 574:      * Persists this object to the database.
 575:      *
 576:      * If the object is new, it inserts it; otherwise an update is performed.
 577:      * All modified related objects will also be persisted in the doSave()
 578:      * method.  This method wraps all precipitate database operations in a
 579:      * single transaction.
 580:      *
 581:      * @param PropelPDO $con
 582:      * @return int             The number of rows affected by this insert/update and any referring fk objects' save() operations.
 583:      * @throws PropelException
 584:      * @throws Exception
 585:      * @see        doSave()
 586:      */
 587:     public function save(PropelPDO $con = null)
 588:     {
 589:         if ($this->isDeleted()) {
 590:             throw new PropelException("You cannot save an object that has been deleted.");
 591:         }
 592: 
 593:         if ($con === null) {
 594:             $con = Propel::getConnection(FeatureCvtermPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
 595:         }
 596: 
 597:         $con->beginTransaction();
 598:         $isInsert = $this->isNew();
 599:         try {
 600:             $ret = $this->preSave($con);
 601:             if ($isInsert) {
 602:                 $ret = $ret && $this->preInsert($con);
 603:             } else {
 604:                 $ret = $ret && $this->preUpdate($con);
 605:             }
 606:             if ($ret) {
 607:                 $affectedRows = $this->doSave($con);
 608:                 if ($isInsert) {
 609:                     $this->postInsert($con);
 610:                 } else {
 611:                     $this->postUpdate($con);
 612:                 }
 613:                 $this->postSave($con);
 614:                 FeatureCvtermPeer::addInstanceToPool($this);
 615:             } else {
 616:                 $affectedRows = 0;
 617:             }
 618:             $con->commit();
 619: 
 620:             return $affectedRows;
 621:         } catch (Exception $e) {
 622:             $con->rollBack();
 623:             throw $e;
 624:         }
 625:     }
 626: 
 627:     /**
 628:      * Performs the work of inserting or updating the row in the database.
 629:      *
 630:      * If the object is new, it inserts it; otherwise an update is performed.
 631:      * All related objects are also updated in this method.
 632:      *
 633:      * @param PropelPDO $con
 634:      * @return int             The number of rows affected by this insert/update and any referring fk objects' save() operations.
 635:      * @throws PropelException
 636:      * @see        save()
 637:      */
 638:     protected function doSave(PropelPDO $con)
 639:     {
 640:         $affectedRows = 0; // initialize var to track total num of affected rows
 641:         if (!$this->alreadyInSave) {
 642:             $this->alreadyInSave = true;
 643: 
 644:             // We call the save method on the following object(s) if they
 645:             // were passed to this object by their coresponding set
 646:             // method.  This object relates to these object(s) by a
 647:             // foreign key reference.
 648: 
 649:             if ($this->aCvterm !== null) {
 650:                 if ($this->aCvterm->isModified() || $this->aCvterm->isNew()) {
 651:                     $affectedRows += $this->aCvterm->save($con);
 652:                 }
 653:                 $this->setCvterm($this->aCvterm);
 654:             }
 655: 
 656:             if ($this->aFeature !== null) {
 657:                 if ($this->aFeature->isModified() || $this->aFeature->isNew()) {
 658:                     $affectedRows += $this->aFeature->save($con);
 659:                 }
 660:                 $this->setFeature($this->aFeature);
 661:             }
 662: 
 663:             if ($this->aPub !== null) {
 664:                 if ($this->aPub->isModified() || $this->aPub->isNew()) {
 665:                     $affectedRows += $this->aPub->save($con);
 666:                 }
 667:                 $this->setPub($this->aPub);
 668:             }
 669: 
 670:             if ($this->isNew() || $this->isModified()) {
 671:                 // persist changes
 672:                 if ($this->isNew()) {
 673:                     $this->doInsert($con);
 674:                 } else {
 675:                     $this->doUpdate($con);
 676:                 }
 677:                 $affectedRows += 1;
 678:                 $this->resetModified();
 679:             }
 680: 
 681:             if ($this->featureCvtermDbxrefsScheduledForDeletion !== null) {
 682:                 if (!$this->featureCvtermDbxrefsScheduledForDeletion->isEmpty()) {
 683:                     FeatureCvtermDbxrefQuery::create()
 684:                         ->filterByPrimaryKeys($this->featureCvtermDbxrefsScheduledForDeletion->getPrimaryKeys(false))
 685:                         ->delete($con);
 686:                     $this->featureCvtermDbxrefsScheduledForDeletion = null;
 687:                 }
 688:             }
 689: 
 690:             if ($this->collFeatureCvtermDbxrefs !== null) {
 691:                 foreach ($this->collFeatureCvtermDbxrefs as $referrerFK) {
 692:                     if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
 693:                         $affectedRows += $referrerFK->save($con);
 694:                     }
 695:                 }
 696:             }
 697: 
 698:             if ($this->featureCvtermPubsScheduledForDeletion !== null) {
 699:                 if (!$this->featureCvtermPubsScheduledForDeletion->isEmpty()) {
 700:                     FeatureCvtermPubQuery::create()
 701:                         ->filterByPrimaryKeys($this->featureCvtermPubsScheduledForDeletion->getPrimaryKeys(false))
 702:                         ->delete($con);
 703:                     $this->featureCvtermPubsScheduledForDeletion = null;
 704:                 }
 705:             }
 706: 
 707:             if ($this->collFeatureCvtermPubs !== null) {
 708:                 foreach ($this->collFeatureCvtermPubs as $referrerFK) {
 709:                     if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
 710:                         $affectedRows += $referrerFK->save($con);
 711:                     }
 712:                 }
 713:             }
 714: 
 715:             if ($this->featureCvtermpropsScheduledForDeletion !== null) {
 716:                 if (!$this->featureCvtermpropsScheduledForDeletion->isEmpty()) {
 717:                     FeatureCvtermpropQuery::create()
 718:                         ->filterByPrimaryKeys($this->featureCvtermpropsScheduledForDeletion->getPrimaryKeys(false))
 719:                         ->delete($con);
 720:                     $this->featureCvtermpropsScheduledForDeletion = null;
 721:                 }
 722:             }
 723: 
 724:             if ($this->collFeatureCvtermprops !== null) {
 725:                 foreach ($this->collFeatureCvtermprops as $referrerFK) {
 726:                     if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
 727:                         $affectedRows += $referrerFK->save($con);
 728:                     }
 729:                 }
 730:             }
 731: 
 732:             $this->alreadyInSave = false;
 733: 
 734:         }
 735: 
 736:         return $affectedRows;
 737:     } // doSave()
 738: 
 739:     /**
 740:      * Insert the row in the database.
 741:      *
 742:      * @param PropelPDO $con
 743:      *
 744:      * @throws PropelException
 745:      * @see        doSave()
 746:      */
 747:     protected function doInsert(PropelPDO $con)
 748:     {
 749:         $modifiedColumns = array();
 750:         $index = 0;
 751: 
 752:         $this->modifiedColumns[] = FeatureCvtermPeer::FEATURE_CVTERM_ID;
 753:         if (null !== $this->feature_cvterm_id) {
 754:             throw new PropelException('Cannot insert a value for auto-increment primary key (' . FeatureCvtermPeer::FEATURE_CVTERM_ID . ')');
 755:         }
 756:         if (null === $this->feature_cvterm_id) {
 757:             try {
 758:                 $stmt = $con->query("SELECT nextval('feature_cvterm_feature_cvterm_id_seq')");
 759:                 $row = $stmt->fetch(PDO::FETCH_NUM);
 760:                 $this->feature_cvterm_id = $row[0];
 761:             } catch (Exception $e) {
 762:                 throw new PropelException('Unable to get sequence id.', $e);
 763:             }
 764:         }
 765: 
 766: 
 767:          // check the columns in natural order for more readable SQL queries
 768:         if ($this->isColumnModified(FeatureCvtermPeer::FEATURE_CVTERM_ID)) {
 769:             $modifiedColumns[':p' . $index++]  = '"feature_cvterm_id"';
 770:         }
 771:         if ($this->isColumnModified(FeatureCvtermPeer::FEATURE_ID)) {
 772:             $modifiedColumns[':p' . $index++]  = '"feature_id"';
 773:         }
 774:         if ($this->isColumnModified(FeatureCvtermPeer::CVTERM_ID)) {
 775:             $modifiedColumns[':p' . $index++]  = '"cvterm_id"';
 776:         }
 777:         if ($this->isColumnModified(FeatureCvtermPeer::PUB_ID)) {
 778:             $modifiedColumns[':p' . $index++]  = '"pub_id"';
 779:         }
 780:         if ($this->isColumnModified(FeatureCvtermPeer::IS_NOT)) {
 781:             $modifiedColumns[':p' . $index++]  = '"is_not"';
 782:         }
 783:         if ($this->isColumnModified(FeatureCvtermPeer::RANK)) {
 784:             $modifiedColumns[':p' . $index++]  = '"rank"';
 785:         }
 786: 
 787:         $sql = sprintf(
 788:             'INSERT INTO "feature_cvterm" (%s) VALUES (%s)',
 789:             implode(', ', $modifiedColumns),
 790:             implode(', ', array_keys($modifiedColumns))
 791:         );
 792: 
 793:         try {
 794:             $stmt = $con->prepare($sql);
 795:             foreach ($modifiedColumns as $identifier => $columnName) {
 796:                 switch ($columnName) {
 797:                     case '"feature_cvterm_id"':
 798:                         $stmt->bindValue($identifier, $this->feature_cvterm_id, PDO::PARAM_INT);
 799:                         break;
 800:                     case '"feature_id"':
 801:                         $stmt->bindValue($identifier, $this->feature_id, PDO::PARAM_INT);
 802:                         break;
 803:                     case '"cvterm_id"':
 804:                         $stmt->bindValue($identifier, $this->cvterm_id, PDO::PARAM_INT);
 805:                         break;
 806:                     case '"pub_id"':
 807:                         $stmt->bindValue($identifier, $this->pub_id, PDO::PARAM_INT);
 808:                         break;
 809:                     case '"is_not"':
 810:                         $stmt->bindValue($identifier, $this->is_not, PDO::PARAM_BOOL);
 811:                         break;
 812:                     case '"rank"':
 813:                         $stmt->bindValue($identifier, $this->rank, PDO::PARAM_INT);
 814:                         break;
 815:                 }
 816:             }
 817:             $stmt->execute();
 818:         } catch (Exception $e) {
 819:             Propel::log($e->getMessage(), Propel::LOG_ERR);
 820:             throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), $e);
 821:         }
 822: 
 823:         $this->setNew(false);
 824:     }
 825: 
 826:     /**
 827:      * Update the row in the database.
 828:      *
 829:      * @param PropelPDO $con
 830:      *
 831:      * @see        doSave()
 832:      */
 833:     protected function doUpdate(PropelPDO $con)
 834:     {
 835:         $selectCriteria = $this->buildPkeyCriteria();
 836:         $valuesCriteria = $this->buildCriteria();
 837:         BasePeer::doUpdate($selectCriteria, $valuesCriteria, $con);
 838:     }
 839: 
 840:     /**
 841:      * Array of ValidationFailed objects.
 842:      * @var        array ValidationFailed[]
 843:      */
 844:     protected $validationFailures = array();
 845: 
 846:     /**
 847:      * Gets any ValidationFailed objects that resulted from last call to validate().
 848:      *
 849:      *
 850:      * @return array ValidationFailed[]
 851:      * @see        validate()
 852:      */
 853:     public function getValidationFailures()
 854:     {
 855:         return $this->validationFailures;
 856:     }
 857: 
 858:     /**
 859:      * Validates the objects modified field values and all objects related to this table.
 860:      *
 861:      * If $columns is either a column name or an array of column names
 862:      * only those columns are validated.
 863:      *
 864:      * @param mixed $columns Column name or an array of column names.
 865:      * @return boolean Whether all columns pass validation.
 866:      * @see        doValidate()
 867:      * @see        getValidationFailures()
 868:      */
 869:     public function validate($columns = null)
 870:     {
 871:         $res = $this->doValidate($columns);
 872:         if ($res === true) {
 873:             $this->validationFailures = array();
 874: 
 875:             return true;
 876:         }
 877: 
 878:         $this->validationFailures = $res;
 879: 
 880:         return false;
 881:     }
 882: 
 883:     /**
 884:      * This function performs the validation work for complex object models.
 885:      *
 886:      * In addition to checking the current object, all related objects will
 887:      * also be validated.  If all pass then <code>true</code> is returned; otherwise
 888:      * an aggreagated array of ValidationFailed objects will be returned.
 889:      *
 890:      * @param array $columns Array of column names to validate.
 891:      * @return mixed <code>true</code> if all validations pass; array of <code>ValidationFailed</code> objets otherwise.
 892:      */
 893:     protected function doValidate($columns = null)
 894:     {
 895:         if (!$this->alreadyInValidation) {
 896:             $this->alreadyInValidation = true;
 897:             $retval = null;
 898: 
 899:             $failureMap = array();
 900: 
 901: 
 902:             // We call the validate method on the following object(s) if they
 903:             // were passed to this object by their coresponding set
 904:             // method.  This object relates to these object(s) by a
 905:             // foreign key reference.
 906: 
 907:             if ($this->aCvterm !== null) {
 908:                 if (!$this->aCvterm->validate($columns)) {
 909:                     $failureMap = array_merge($failureMap, $this->aCvterm->getValidationFailures());
 910:                 }
 911:             }
 912: 
 913:             if ($this->aFeature !== null) {
 914:                 if (!$this->aFeature->validate($columns)) {
 915:                     $failureMap = array_merge($failureMap, $this->aFeature->getValidationFailures());
 916:                 }
 917:             }
 918: 
 919:             if ($this->aPub !== null) {
 920:                 if (!$this->aPub->validate($columns)) {
 921:                     $failureMap = array_merge($failureMap, $this->aPub->getValidationFailures());
 922:                 }
 923:             }
 924: 
 925: 
 926:             if (($retval = FeatureCvtermPeer::doValidate($this, $columns)) !== true) {
 927:                 $failureMap = array_merge($failureMap, $retval);
 928:             }
 929: 
 930: 
 931:                 if ($this->collFeatureCvtermDbxrefs !== null) {
 932:                     foreach ($this->collFeatureCvtermDbxrefs as $referrerFK) {
 933:                         if (!$referrerFK->validate($columns)) {
 934:                             $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
 935:                         }
 936:                     }
 937:                 }
 938: 
 939:                 if ($this->collFeatureCvtermPubs !== null) {
 940:                     foreach ($this->collFeatureCvtermPubs as $referrerFK) {
 941:                         if (!$referrerFK->validate($columns)) {
 942:                             $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
 943:                         }
 944:                     }
 945:                 }
 946: 
 947:                 if ($this->collFeatureCvtermprops !== null) {
 948:                     foreach ($this->collFeatureCvtermprops as $referrerFK) {
 949:                         if (!$referrerFK->validate($columns)) {
 950:                             $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
 951:                         }
 952:                     }
 953:                 }
 954: 
 955: 
 956:             $this->alreadyInValidation = false;
 957:         }
 958: 
 959:         return (!empty($failureMap) ? $failureMap : true);
 960:     }
 961: 
 962:     /**
 963:      * Retrieves a field from the object by name passed in as a string.
 964:      *
 965:      * @param string $name name
 966:      * @param string $type The type of fieldname the $name is of:
 967:      *               one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
 968:      *               BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
 969:      *               Defaults to BasePeer::TYPE_PHPNAME
 970:      * @return mixed Value of field.
 971:      */
 972:     public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
 973:     {
 974:         $pos = FeatureCvtermPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
 975:         $field = $this->getByPosition($pos);
 976: 
 977:         return $field;
 978:     }
 979: 
 980:     /**
 981:      * Retrieves a field from the object by Position as specified in the xml schema.
 982:      * Zero-based.
 983:      *
 984:      * @param int $pos position in xml schema
 985:      * @return mixed Value of field at $pos
 986:      */
 987:     public function getByPosition($pos)
 988:     {
 989:         switch ($pos) {
 990:             case 0:
 991:                 return $this->getFeatureCvtermId();
 992:                 break;
 993:             case 1:
 994:                 return $this->getFeatureId();
 995:                 break;
 996:             case 2:
 997:                 return $this->getCvtermId();
 998:                 break;
 999:             case 3:
1000:                 return $this->getPubId();
1001:                 break;
1002:             case 4:
1003:                 return $this->getIsNot();
1004:                 break;
1005:             case 5:
1006:                 return $this->getRank();
1007:                 break;
1008:             default:
1009:                 return null;
1010:                 break;
1011:         } // switch()
1012:     }
1013: 
1014:     /**
1015:      * Exports the object as an array.
1016:      *
1017:      * You can specify the key type of the array by passing one of the class
1018:      * type constants.
1019:      *
1020:      * @param     string  $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME,
1021:      *                    BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
1022:      *                    Defaults to BasePeer::TYPE_PHPNAME.
1023:      * @param     boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to true.
1024:      * @param     array $alreadyDumpedObjects List of objects to skip to avoid recursion
1025:      * @param     boolean $includeForeignObjects (optional) Whether to include hydrated related objects. Default to FALSE.
1026:      *
1027:      * @return array an associative array containing the field names (as keys) and field values
1028:      */
1029:     public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
1030:     {
1031:         if (isset($alreadyDumpedObjects['FeatureCvterm'][$this->getPrimaryKey()])) {
1032:             return '*RECURSION*';
1033:         }
1034:         $alreadyDumpedObjects['FeatureCvterm'][$this->getPrimaryKey()] = true;
1035:         $keys = FeatureCvtermPeer::getFieldNames($keyType);
1036:         $result = array(
1037:             $keys[0] => $this->getFeatureCvtermId(),
1038:             $keys[1] => $this->getFeatureId(),
1039:             $keys[2] => $this->getCvtermId(),
1040:             $keys[3] => $this->getPubId(),
1041:             $keys[4] => $this->getIsNot(),
1042:             $keys[5] => $this->getRank(),
1043:         );
1044:         if ($includeForeignObjects) {
1045:             if (null !== $this->aCvterm) {
1046:                 $result['Cvterm'] = $this->aCvterm->toArray($keyType, $includeLazyLoadColumns,  $alreadyDumpedObjects, true);
1047:             }
1048:             if (null !== $this->aFeature) {
1049:                 $result['Feature'] = $this->aFeature->toArray($keyType, $includeLazyLoadColumns,  $alreadyDumpedObjects, true);
1050:             }
1051:             if (null !== $this->aPub) {
1052:                 $result['Pub'] = $this->aPub->toArray($keyType, $includeLazyLoadColumns,  $alreadyDumpedObjects, true);
1053:             }
1054:             if (null !== $this->collFeatureCvtermDbxrefs) {
1055:                 $result['FeatureCvtermDbxrefs'] = $this->collFeatureCvtermDbxrefs->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
1056:             }
1057:             if (null !== $this->collFeatureCvtermPubs) {
1058:                 $result['FeatureCvtermPubs'] = $this->collFeatureCvtermPubs->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
1059:             }
1060:             if (null !== $this->collFeatureCvtermprops) {
1061:                 $result['FeatureCvtermprops'] = $this->collFeatureCvtermprops->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
1062:             }
1063:         }
1064: 
1065:         return $result;
1066:     }
1067: 
1068:     /**
1069:      * Sets a field from the object by name passed in as a string.
1070:      *
1071:      * @param string $name peer name
1072:      * @param mixed $value field value
1073:      * @param string $type The type of fieldname the $name is of:
1074:      *                     one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
1075:      *                     BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
1076:      *                     Defaults to BasePeer::TYPE_PHPNAME
1077:      * @return void
1078:      */
1079:     public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
1080:     {
1081:         $pos = FeatureCvtermPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
1082: 
1083:         $this->setByPosition($pos, $value);
1084:     }
1085: 
1086:     /**
1087:      * Sets a field from the object by Position as specified in the xml schema.
1088:      * Zero-based.
1089:      *
1090:      * @param int $pos position in xml schema
1091:      * @param mixed $value field value
1092:      * @return void
1093:      */
1094:     public function setByPosition($pos, $value)
1095:     {
1096:         switch ($pos) {
1097:             case 0:
1098:                 $this->setFeatureCvtermId($value);
1099:                 break;
1100:             case 1:
1101:                 $this->setFeatureId($value);
1102:                 break;
1103:             case 2:
1104:                 $this->setCvtermId($value);
1105:                 break;
1106:             case 3:
1107:                 $this->setPubId($value);
1108:                 break;
1109:             case 4:
1110:                 $this->setIsNot($value);
1111:                 break;
1112:             case 5:
1113:                 $this->setRank($value);
1114:                 break;
1115:         } // switch()
1116:     }
1117: 
1118:     /**
1119:      * Populates the object using an array.
1120:      *
1121:      * This is particularly useful when populating an object from one of the
1122:      * request arrays (e.g. $_POST).  This method goes through the column
1123:      * names, checking to see whether a matching key exists in populated
1124:      * array. If so the setByName() method is called for that column.
1125:      *
1126:      * You can specify the key type of the array by additionally passing one
1127:      * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME,
1128:      * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
1129:      * The default key type is the column's BasePeer::TYPE_PHPNAME
1130:      *
1131:      * @param array  $arr     An array to populate the object from.
1132:      * @param string $keyType The type of keys the array uses.
1133:      * @return void
1134:      */
1135:     public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
1136:     {
1137:         $keys = FeatureCvtermPeer::getFieldNames($keyType);
1138: 
1139:         if (array_key_exists($keys[0], $arr)) $this->setFeatureCvtermId($arr[$keys[0]]);
1140:         if (array_key_exists($keys[1], $arr)) $this->setFeatureId($arr[$keys[1]]);
1141:         if (array_key_exists($keys[2], $arr)) $this->setCvtermId($arr[$keys[2]]);
1142:         if (array_key_exists($keys[3], $arr)) $this->setPubId($arr[$keys[3]]);
1143:         if (array_key_exists($keys[4], $arr)) $this->setIsNot($arr[$keys[4]]);
1144:         if (array_key_exists($keys[5], $arr)) $this->setRank($arr[$keys[5]]);
1145:     }
1146: 
1147:     /**
1148:      * Build a Criteria object containing the values of all modified columns in this object.
1149:      *
1150:      * @return Criteria The Criteria object containing all modified values.
1151:      */
1152:     public function buildCriteria()
1153:     {
1154:         $criteria = new Criteria(FeatureCvtermPeer::DATABASE_NAME);
1155: 
1156:         if ($this->isColumnModified(FeatureCvtermPeer::FEATURE_CVTERM_ID)) $criteria->add(FeatureCvtermPeer::FEATURE_CVTERM_ID, $this->feature_cvterm_id);
1157:         if ($this->isColumnModified(FeatureCvtermPeer::FEATURE_ID)) $criteria->add(FeatureCvtermPeer::FEATURE_ID, $this->feature_id);
1158:         if ($this->isColumnModified(FeatureCvtermPeer::CVTERM_ID)) $criteria->add(FeatureCvtermPeer::CVTERM_ID, $this->cvterm_id);
1159:         if ($this->isColumnModified(FeatureCvtermPeer::PUB_ID)) $criteria->add(FeatureCvtermPeer::PUB_ID, $this->pub_id);
1160:         if ($this->isColumnModified(FeatureCvtermPeer::IS_NOT)) $criteria->add(FeatureCvtermPeer::IS_NOT, $this->is_not);
1161:         if ($this->isColumnModified(FeatureCvtermPeer::RANK)) $criteria->add(FeatureCvtermPeer::RANK, $this->rank);
1162: 
1163:         return $criteria;
1164:     }
1165: 
1166:     /**
1167:      * Builds a Criteria object containing the primary key for this object.
1168:      *
1169:      * Unlike buildCriteria() this method includes the primary key values regardless
1170:      * of whether or not they have been modified.
1171:      *
1172:      * @return Criteria The Criteria object containing value(s) for primary key(s).
1173:      */
1174:     public function buildPkeyCriteria()
1175:     {
1176:         $criteria = new Criteria(FeatureCvtermPeer::DATABASE_NAME);
1177:         $criteria->add(FeatureCvtermPeer::FEATURE_CVTERM_ID, $this->feature_cvterm_id);
1178: 
1179:         return $criteria;
1180:     }
1181: 
1182:     /**
1183:      * Returns the primary key for this object (row).
1184:      * @return int
1185:      */
1186:     public function getPrimaryKey()
1187:     {
1188:         return $this->getFeatureCvtermId();
1189:     }
1190: 
1191:     /**
1192:      * Generic method to set the primary key (feature_cvterm_id column).
1193:      *
1194:      * @param  int $key Primary key.
1195:      * @return void
1196:      */
1197:     public function setPrimaryKey($key)
1198:     {
1199:         $this->setFeatureCvtermId($key);
1200:     }
1201: 
1202:     /**
1203:      * Returns true if the primary key for this object is null.
1204:      * @return boolean
1205:      */
1206:     public function isPrimaryKeyNull()
1207:     {
1208: 
1209:         return null === $this->getFeatureCvtermId();
1210:     }
1211: 
1212:     /**
1213:      * Sets contents of passed object to values from current object.
1214:      *
1215:      * If desired, this method can also make copies of all associated (fkey referrers)
1216:      * objects.
1217:      *
1218:      * @param object $copyObj An object of FeatureCvterm (or compatible) type.
1219:      * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
1220:      * @param boolean $makeNew Whether to reset autoincrement PKs and make the object new.
1221:      * @throws PropelException
1222:      */
1223:     public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
1224:     {
1225:         $copyObj->setFeatureId($this->getFeatureId());
1226:         $copyObj->setCvtermId($this->getCvtermId());
1227:         $copyObj->setPubId($this->getPubId());
1228:         $copyObj->setIsNot($this->getIsNot());
1229:         $copyObj->setRank($this->getRank());
1230: 
1231:         if ($deepCopy && !$this->startCopy) {
1232:             // important: temporarily setNew(false) because this affects the behavior of
1233:             // the getter/setter methods for fkey referrer objects.
1234:             $copyObj->setNew(false);
1235:             // store object hash to prevent cycle
1236:             $this->startCopy = true;
1237: 
1238:             foreach ($this->getFeatureCvtermDbxrefs() as $relObj) {
1239:                 if ($relObj !== $this) {  // ensure that we don't try to copy a reference to ourselves
1240:                     $copyObj->addFeatureCvtermDbxref($relObj->copy($deepCopy));
1241:                 }
1242:             }
1243: 
1244:             foreach ($this->getFeatureCvtermPubs() as $relObj) {
1245:                 if ($relObj !== $this) {  // ensure that we don't try to copy a reference to ourselves
1246:                     $copyObj->addFeatureCvtermPub($relObj->copy($deepCopy));
1247:                 }
1248:             }
1249: 
1250:             foreach ($this->getFeatureCvtermprops() as $relObj) {
1251:                 if ($relObj !== $this) {  // ensure that we don't try to copy a reference to ourselves
1252:                     $copyObj->addFeatureCvtermprop($relObj->copy($deepCopy));
1253:                 }
1254:             }
1255: 
1256:             //unflag object copy
1257:             $this->startCopy = false;
1258:         } // if ($deepCopy)
1259: 
1260:         if ($makeNew) {
1261:             $copyObj->setNew(true);
1262:             $copyObj->setFeatureCvtermId(NULL); // this is a auto-increment column, so set to default value
1263:         }
1264:     }
1265: 
1266:     /**
1267:      * Makes a copy of this object that will be inserted as a new row in table when saved.
1268:      * It creates a new object filling in the simple attributes, but skipping any primary
1269:      * keys that are defined for the table.
1270:      *
1271:      * If desired, this method can also make copies of all associated (fkey referrers)
1272:      * objects.
1273:      *
1274:      * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
1275:      * @return FeatureCvterm Clone of current object.
1276:      * @throws PropelException
1277:      */
1278:     public function copy($deepCopy = false)
1279:     {
1280:         // we use get_class(), because this might be a subclass
1281:         $clazz = get_class($this);
1282:         $copyObj = new $clazz();
1283:         $this->copyInto($copyObj, $deepCopy);
1284: 
1285:         return $copyObj;
1286:     }
1287: 
1288:     /**
1289:      * Returns a peer instance associated with this om.
1290:      *
1291:      * Since Peer classes are not to have any instance attributes, this method returns the
1292:      * same instance for all member of this class. The method could therefore
1293:      * be static, but this would prevent one from overriding the behavior.
1294:      *
1295:      * @return FeatureCvtermPeer
1296:      */
1297:     public function getPeer()
1298:     {
1299:         if (self::$peer === null) {
1300:             self::$peer = new FeatureCvtermPeer();
1301:         }
1302: 
1303:         return self::$peer;
1304:     }
1305: 
1306:     /**
1307:      * Declares an association between this object and a Cvterm object.
1308:      *
1309:      * @param             Cvterm $v
1310:      * @return FeatureCvterm The current object (for fluent API support)
1311:      * @throws PropelException
1312:      */
1313:     public function setCvterm(Cvterm $v = null)
1314:     {
1315:         if ($v === null) {
1316:             $this->setCvtermId(NULL);
1317:         } else {
1318:             $this->setCvtermId($v->getCvtermId());
1319:         }
1320: 
1321:         $this->aCvterm = $v;
1322: 
1323:         // Add binding for other direction of this n:n relationship.
1324:         // If this object has already been added to the Cvterm object, it will not be re-added.
1325:         if ($v !== null) {
1326:             $v->addFeatureCvterm($this);
1327:         }
1328: 
1329: 
1330:         return $this;
1331:     }
1332: 
1333: 
1334:     /**
1335:      * Get the associated Cvterm object
1336:      *
1337:      * @param PropelPDO $con Optional Connection object.
1338:      * @param $doQuery Executes a query to get the object if required
1339:      * @return Cvterm The associated Cvterm object.
1340:      * @throws PropelException
1341:      */
1342:     public function getCvterm(PropelPDO $con = null, $doQuery = true)
1343:     {
1344:         if ($this->aCvterm === null && ($this->cvterm_id !== null) && $doQuery) {
1345:             $this->aCvterm = CvtermQuery::create()->findPk($this->cvterm_id, $con);
1346:             /* The following can be used additionally to
1347:                 guarantee the related object contains a reference
1348:                 to this object.  This level of coupling may, however, be
1349:                 undesirable since it could result in an only partially populated collection
1350:                 in the referenced object.
1351:                 $this->aCvterm->addFeatureCvterms($this);
1352:              */
1353:         }
1354: 
1355:         return $this->aCvterm;
1356:     }
1357: 
1358:     /**
1359:      * Declares an association between this object and a Feature object.
1360:      *
1361:      * @param             Feature $v
1362:      * @return FeatureCvterm The current object (for fluent API support)
1363:      * @throws PropelException
1364:      */
1365:     public function setFeature(Feature $v = null)
1366:     {
1367:         if ($v === null) {
1368:             $this->setFeatureId(NULL);
1369:         } else {
1370:             $this->setFeatureId($v->getFeatureId());
1371:         }
1372: 
1373:         $this->aFeature = $v;
1374: 
1375:         // Add binding for other direction of this n:n relationship.
1376:         // If this object has already been added to the Feature object, it will not be re-added.
1377:         if ($v !== null) {
1378:             $v->addFeatureCvterm($this);
1379:         }
1380: 
1381: 
1382:         return $this;
1383:     }
1384: 
1385: 
1386:     /**
1387:      * Get the associated Feature object
1388:      *
1389:      * @param PropelPDO $con Optional Connection object.
1390:      * @param $doQuery Executes a query to get the object if required
1391:      * @return Feature The associated Feature object.
1392:      * @throws PropelException
1393:      */
1394:     public function getFeature(PropelPDO $con = null, $doQuery = true)
1395:     {
1396:         if ($this->aFeature === null && ($this->feature_id !== null) && $doQuery) {
1397:             $this->aFeature = FeatureQuery::create()->findPk($this->feature_id, $con);
1398:             /* The following can be used additionally to
1399:                 guarantee the related object contains a reference
1400:                 to this object.  This level of coupling may, however, be
1401:                 undesirable since it could result in an only partially populated collection
1402:                 in the referenced object.
1403:                 $this->aFeature->addFeatureCvterms($this);
1404:              */
1405:         }
1406: 
1407:         return $this->aFeature;
1408:     }
1409: 
1410:     /**
1411:      * Declares an association between this object and a Pub object.
1412:      *
1413:      * @param             Pub $v
1414:      * @return FeatureCvterm The current object (for fluent API support)
1415:      * @throws PropelException
1416:      */
1417:     public function setPub(Pub $v = null)
1418:     {
1419:         if ($v === null) {
1420:             $this->setPubId(NULL);
1421:         } else {
1422:             $this->setPubId($v->getPubId());
1423:         }
1424: 
1425:         $this->aPub = $v;
1426: 
1427:         // Add binding for other direction of this n:n relationship.
1428:         // If this object has already been added to the Pub object, it will not be re-added.
1429:         if ($v !== null) {
1430:             $v->addFeatureCvterm($this);
1431:         }
1432: 
1433: 
1434:         return $this;
1435:     }
1436: 
1437: 
1438:     /**
1439:      * Get the associated Pub object
1440:      *
1441:      * @param PropelPDO $con Optional Connection object.
1442:      * @param $doQuery Executes a query to get the object if required
1443:      * @return Pub The associated Pub object.
1444:      * @throws PropelException
1445:      */
1446:     public function getPub(PropelPDO $con = null, $doQuery = true)
1447:     {
1448:         if ($this->aPub === null && ($this->pub_id !== null) && $doQuery) {
1449:             $this->aPub = PubQuery::create()->findPk($this->pub_id, $con);
1450:             /* The following can be used additionally to
1451:                 guarantee the related object contains a reference
1452:                 to this object.  This level of coupling may, however, be
1453:                 undesirable since it could result in an only partially populated collection
1454:                 in the referenced object.
1455:                 $this->aPub->addFeatureCvterms($this);
1456:              */
1457:         }
1458: 
1459:         return $this->aPub;
1460:     }
1461: 
1462: 
1463:     /**
1464:      * Initializes a collection based on the name of a relation.
1465:      * Avoids crafting an 'init[$relationName]s' method name
1466:      * that wouldn't work when StandardEnglishPluralizer is used.
1467:      *
1468:      * @param string $relationName The name of the relation to initialize
1469:      * @return void
1470:      */
1471:     public function initRelation($relationName)
1472:     {
1473:         if ('FeatureCvtermDbxref' == $relationName) {
1474:             $this->initFeatureCvtermDbxrefs();
1475:         }
1476:         if ('FeatureCvtermPub' == $relationName) {
1477:             $this->initFeatureCvtermPubs();
1478:         }
1479:         if ('FeatureCvtermprop' == $relationName) {
1480:             $this->initFeatureCvtermprops();
1481:         }
1482:     }
1483: 
1484:     /**
1485:      * Clears out the collFeatureCvtermDbxrefs collection
1486:      *
1487:      * This does not modify the database; however, it will remove any associated objects, causing
1488:      * them to be refetched by subsequent calls to accessor method.
1489:      *
1490:      * @return FeatureCvterm The current object (for fluent API support)
1491:      * @see        addFeatureCvtermDbxrefs()
1492:      */
1493:     public function clearFeatureCvtermDbxrefs()
1494:     {
1495:         $this->collFeatureCvtermDbxrefs = null; // important to set this to null since that means it is uninitialized
1496:         $this->collFeatureCvtermDbxrefsPartial = null;
1497: 
1498:         return $this;
1499:     }
1500: 
1501:     /**
1502:      * reset is the collFeatureCvtermDbxrefs collection loaded partially
1503:      *
1504:      * @return void
1505:      */
1506:     public function resetPartialFeatureCvtermDbxrefs($v = true)
1507:     {
1508:         $this->collFeatureCvtermDbxrefsPartial = $v;
1509:     }
1510: 
1511:     /**
1512:      * Initializes the collFeatureCvtermDbxrefs collection.
1513:      *
1514:      * By default this just sets the collFeatureCvtermDbxrefs collection to an empty array (like clearcollFeatureCvtermDbxrefs());
1515:      * however, you may wish to override this method in your stub class to provide setting appropriate
1516:      * to your application -- for example, setting the initial array to the values stored in database.
1517:      *
1518:      * @param boolean $overrideExisting If set to true, the method call initializes
1519:      *                                        the collection even if it is not empty
1520:      *
1521:      * @return void
1522:      */
1523:     public function initFeatureCvtermDbxrefs($overrideExisting = true)
1524:     {
1525:         if (null !== $this->collFeatureCvtermDbxrefs && !$overrideExisting) {
1526:             return;
1527:         }
1528:         $this->collFeatureCvtermDbxrefs = new PropelObjectCollection();
1529:         $this->collFeatureCvtermDbxrefs->setModel('FeatureCvtermDbxref');
1530:     }
1531: 
1532:     /**
1533:      * Gets an array of FeatureCvtermDbxref objects which contain a foreign key that references this object.
1534:      *
1535:      * If the $criteria is not null, it is used to always fetch the results from the database.
1536:      * Otherwise the results are fetched from the database the first time, then cached.
1537:      * Next time the same method is called without $criteria, the cached collection is returned.
1538:      * If this FeatureCvterm is new, it will return
1539:      * an empty collection or the current collection; the criteria is ignored on a new object.
1540:      *
1541:      * @param Criteria $criteria optional Criteria object to narrow the query
1542:      * @param PropelPDO $con optional connection object
1543:      * @return PropelObjectCollection|FeatureCvtermDbxref[] List of FeatureCvtermDbxref objects
1544:      * @throws PropelException
1545:      */
1546:     public function getFeatureCvtermDbxrefs($criteria = null, PropelPDO $con = null)
1547:     {
1548:         $partial = $this->collFeatureCvtermDbxrefsPartial && !$this->isNew();
1549:         if (null === $this->collFeatureCvtermDbxrefs || null !== $criteria  || $partial) {
1550:             if ($this->isNew() && null === $this->collFeatureCvtermDbxrefs) {
1551:                 // return empty collection
1552:                 $this->initFeatureCvtermDbxrefs();
1553:             } else {
1554:                 $collFeatureCvtermDbxrefs = FeatureCvtermDbxrefQuery::create(null, $criteria)
1555:                     ->filterByFeatureCvterm($this)
1556:                     ->find($con);
1557:                 if (null !== $criteria) {
1558:                     if (false !== $this->collFeatureCvtermDbxrefsPartial && count($collFeatureCvtermDbxrefs)) {
1559:                       $this->initFeatureCvtermDbxrefs(false);
1560: 
1561:                       foreach($collFeatureCvtermDbxrefs as $obj) {
1562:                         if (false == $this->collFeatureCvtermDbxrefs->contains($obj)) {
1563:                           $this->collFeatureCvtermDbxrefs->append($obj);
1564:                         }
1565:                       }
1566: 
1567:                       $this->collFeatureCvtermDbxrefsPartial = true;
1568:                     }
1569: 
1570:                     $collFeatureCvtermDbxrefs->getInternalIterator()->rewind();
1571:                     return $collFeatureCvtermDbxrefs;
1572:                 }
1573: 
1574:                 if($partial && $this->collFeatureCvtermDbxrefs) {
1575:                     foreach($this->collFeatureCvtermDbxrefs as $obj) {
1576:                         if($obj->isNew()) {
1577:                             $collFeatureCvtermDbxrefs[] = $obj;
1578:                         }
1579:                     }
1580:                 }
1581: 
1582:                 $this->collFeatureCvtermDbxrefs = $collFeatureCvtermDbxrefs;
1583:                 $this->collFeatureCvtermDbxrefsPartial = false;
1584:             }
1585:         }
1586: 
1587:         return $this->collFeatureCvtermDbxrefs;
1588:     }
1589: 
1590:     /**
1591:      * Sets a collection of FeatureCvtermDbxref objects related by a one-to-many relationship
1592:      * to the current object.
1593:      * It will also schedule objects for deletion based on a diff between old objects (aka persisted)
1594:      * and new objects from the given Propel collection.
1595:      *
1596:      * @param PropelCollection $featureCvtermDbxrefs A Propel collection.
1597:      * @param PropelPDO $con Optional connection object
1598:      * @return FeatureCvterm The current object (for fluent API support)
1599:      */
1600:     public function setFeatureCvtermDbxrefs(PropelCollection $featureCvtermDbxrefs, PropelPDO $con = null)
1601:     {
1602:         $featureCvtermDbxrefsToDelete = $this->getFeatureCvtermDbxrefs(new Criteria(), $con)->diff($featureCvtermDbxrefs);
1603: 
1604:         $this->featureCvtermDbxrefsScheduledForDeletion = unserialize(serialize($featureCvtermDbxrefsToDelete));
1605: 
1606:         foreach ($featureCvtermDbxrefsToDelete as $featureCvtermDbxrefRemoved) {
1607:             $featureCvtermDbxrefRemoved->setFeatureCvterm(null);
1608:         }
1609: 
1610:         $this->collFeatureCvtermDbxrefs = null;
1611:         foreach ($featureCvtermDbxrefs as $featureCvtermDbxref) {
1612:             $this->addFeatureCvtermDbxref($featureCvtermDbxref);
1613:         }
1614: 
1615:         $this->collFeatureCvtermDbxrefs = $featureCvtermDbxrefs;
1616:         $this->collFeatureCvtermDbxrefsPartial = false;
1617: 
1618:         return $this;
1619:     }
1620: 
1621:     /**
1622:      * Returns the number of related FeatureCvtermDbxref objects.
1623:      *
1624:      * @param Criteria $criteria
1625:      * @param boolean $distinct
1626:      * @param PropelPDO $con
1627:      * @return int             Count of related FeatureCvtermDbxref objects.
1628:      * @throws PropelException
1629:      */
1630:     public function countFeatureCvtermDbxrefs(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
1631:     {
1632:         $partial = $this->collFeatureCvtermDbxrefsPartial && !$this->isNew();
1633:         if (null === $this->collFeatureCvtermDbxrefs || null !== $criteria || $partial) {
1634:             if ($this->isNew() && null === $this->collFeatureCvtermDbxrefs) {
1635:                 return 0;
1636:             }
1637: 
1638:             if($partial && !$criteria) {
1639:                 return count($this->getFeatureCvtermDbxrefs());
1640:             }
1641:             $query = FeatureCvtermDbxrefQuery::create(null, $criteria);
1642:             if ($distinct) {
1643:                 $query->distinct();
1644:             }
1645: 
1646:             return $query
1647:                 ->filterByFeatureCvterm($this)
1648:                 ->count($con);
1649:         }
1650: 
1651:         return count($this->collFeatureCvtermDbxrefs);
1652:     }
1653: 
1654:     /**
1655:      * Method called to associate a FeatureCvtermDbxref object to this object
1656:      * through the FeatureCvtermDbxref foreign key attribute.
1657:      *
1658:      * @param    FeatureCvtermDbxref $l FeatureCvtermDbxref
1659:      * @return FeatureCvterm The current object (for fluent API support)
1660:      */
1661:     public function addFeatureCvtermDbxref(FeatureCvtermDbxref $l)
1662:     {
1663:         if ($this->collFeatureCvtermDbxrefs === null) {
1664:             $this->initFeatureCvtermDbxrefs();
1665:             $this->collFeatureCvtermDbxrefsPartial = true;
1666:         }
1667:         if (!in_array($l, $this->collFeatureCvtermDbxrefs->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
1668:             $this->doAddFeatureCvtermDbxref($l);
1669:         }
1670: 
1671:         return $this;
1672:     }
1673: 
1674:     /**
1675:      * @param   FeatureCvtermDbxref $featureCvtermDbxref The featureCvtermDbxref object to add.
1676:      */
1677:     protected function doAddFeatureCvtermDbxref($featureCvtermDbxref)
1678:     {
1679:         $this->collFeatureCvtermDbxrefs[]= $featureCvtermDbxref;
1680:         $featureCvtermDbxref->setFeatureCvterm($this);
1681:     }
1682: 
1683:     /**
1684:      * @param   FeatureCvtermDbxref $featureCvtermDbxref The featureCvtermDbxref object to remove.
1685:      * @return FeatureCvterm The current object (for fluent API support)
1686:      */
1687:     public function removeFeatureCvtermDbxref($featureCvtermDbxref)
1688:     {
1689:         if ($this->getFeatureCvtermDbxrefs()->contains($featureCvtermDbxref)) {
1690:             $this->collFeatureCvtermDbxrefs->remove($this->collFeatureCvtermDbxrefs->search($featureCvtermDbxref));
1691:             if (null === $this->featureCvtermDbxrefsScheduledForDeletion) {
1692:                 $this->featureCvtermDbxrefsScheduledForDeletion = clone $this->collFeatureCvtermDbxrefs;
1693:                 $this->featureCvtermDbxrefsScheduledForDeletion->clear();
1694:             }
1695:             $this->featureCvtermDbxrefsScheduledForDeletion[]= clone $featureCvtermDbxref;
1696:             $featureCvtermDbxref->setFeatureCvterm(null);
1697:         }
1698: 
1699:         return $this;
1700:     }
1701: 
1702: 
1703:     /**
1704:      * If this collection has already been initialized with
1705:      * an identical criteria, it returns the collection.
1706:      * Otherwise if this FeatureCvterm is new, it will return
1707:      * an empty collection; or if this FeatureCvterm has previously
1708:      * been saved, it will retrieve related FeatureCvtermDbxrefs from storage.
1709:      *
1710:      * This method is protected by default in order to keep the public
1711:      * api reasonable.  You can provide public methods for those you
1712:      * actually need in FeatureCvterm.
1713:      *
1714:      * @param Criteria $criteria optional Criteria object to narrow the query
1715:      * @param PropelPDO $con optional connection object
1716:      * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN)
1717:      * @return PropelObjectCollection|FeatureCvtermDbxref[] List of FeatureCvtermDbxref objects
1718:      */
1719:     public function getFeatureCvtermDbxrefsJoinDbxref($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
1720:     {
1721:         $query = FeatureCvtermDbxrefQuery::create(null, $criteria);
1722:         $query->joinWith('Dbxref', $join_behavior);
1723: 
1724:         return $this->getFeatureCvtermDbxrefs($query, $con);
1725:     }
1726: 
1727:     /**
1728:      * Clears out the collFeatureCvtermPubs collection
1729:      *
1730:      * This does not modify the database; however, it will remove any associated objects, causing
1731:      * them to be refetched by subsequent calls to accessor method.
1732:      *
1733:      * @return FeatureCvterm The current object (for fluent API support)
1734:      * @see        addFeatureCvtermPubs()
1735:      */
1736:     public function clearFeatureCvtermPubs()
1737:     {
1738:         $this->collFeatureCvtermPubs = null; // important to set this to null since that means it is uninitialized
1739:         $this->collFeatureCvtermPubsPartial = null;
1740: 
1741:         return $this;
1742:     }
1743: 
1744:     /**
1745:      * reset is the collFeatureCvtermPubs collection loaded partially
1746:      *
1747:      * @return void
1748:      */
1749:     public function resetPartialFeatureCvtermPubs($v = true)
1750:     {
1751:         $this->collFeatureCvtermPubsPartial = $v;
1752:     }
1753: 
1754:     /**
1755:      * Initializes the collFeatureCvtermPubs collection.
1756:      *
1757:      * By default this just sets the collFeatureCvtermPubs collection to an empty array (like clearcollFeatureCvtermPubs());
1758:      * however, you may wish to override this method in your stub class to provide setting appropriate
1759:      * to your application -- for example, setting the initial array to the values stored in database.
1760:      *
1761:      * @param boolean $overrideExisting If set to true, the method call initializes
1762:      *                                        the collection even if it is not empty
1763:      *
1764:      * @return void
1765:      */
1766:     public function initFeatureCvtermPubs($overrideExisting = true)
1767:     {
1768:         if (null !== $this->collFeatureCvtermPubs && !$overrideExisting) {
1769:             return;
1770:         }
1771:         $this->collFeatureCvtermPubs = new PropelObjectCollection();
1772:         $this->collFeatureCvtermPubs->setModel('FeatureCvtermPub');
1773:     }
1774: 
1775:     /**
1776:      * Gets an array of FeatureCvtermPub objects which contain a foreign key that references this object.
1777:      *
1778:      * If the $criteria is not null, it is used to always fetch the results from the database.
1779:      * Otherwise the results are fetched from the database the first time, then cached.
1780:      * Next time the same method is called without $criteria, the cached collection is returned.
1781:      * If this FeatureCvterm is new, it will return
1782:      * an empty collection or the current collection; the criteria is ignored on a new object.
1783:      *
1784:      * @param Criteria $criteria optional Criteria object to narrow the query
1785:      * @param PropelPDO $con optional connection object
1786:      * @return PropelObjectCollection|FeatureCvtermPub[] List of FeatureCvtermPub objects
1787:      * @throws PropelException
1788:      */
1789:     public function getFeatureCvtermPubs($criteria = null, PropelPDO $con = null)
1790:     {
1791:         $partial = $this->collFeatureCvtermPubsPartial && !$this->isNew();
1792:         if (null === $this->collFeatureCvtermPubs || null !== $criteria  || $partial) {
1793:             if ($this->isNew() && null === $this->collFeatureCvtermPubs) {
1794:                 // return empty collection
1795:                 $this->initFeatureCvtermPubs();
1796:             } else {
1797:                 $collFeatureCvtermPubs = FeatureCvtermPubQuery::create(null, $criteria)
1798:                     ->filterByFeatureCvterm($this)
1799:                     ->find($con);
1800:                 if (null !== $criteria) {
1801:                     if (false !== $this->collFeatureCvtermPubsPartial && count($collFeatureCvtermPubs)) {
1802:                       $this->initFeatureCvtermPubs(false);
1803: 
1804:                       foreach($collFeatureCvtermPubs as $obj) {
1805:                         if (false == $this->collFeatureCvtermPubs->contains($obj)) {
1806:                           $this->collFeatureCvtermPubs->append($obj);
1807:                         }
1808:                       }
1809: 
1810:                       $this->collFeatureCvtermPubsPartial = true;
1811:                     }
1812: 
1813:                     $collFeatureCvtermPubs->getInternalIterator()->rewind();
1814:                     return $collFeatureCvtermPubs;
1815:                 }
1816: 
1817:                 if($partial && $this->collFeatureCvtermPubs) {
1818:                     foreach($this->collFeatureCvtermPubs as $obj) {
1819:                         if($obj->isNew()) {
1820:                             $collFeatureCvtermPubs[] = $obj;
1821:                         }
1822:                     }
1823:                 }
1824: 
1825:                 $this->collFeatureCvtermPubs = $collFeatureCvtermPubs;
1826:                 $this->collFeatureCvtermPubsPartial = false;
1827:             }
1828:         }
1829: 
1830:         return $this->collFeatureCvtermPubs;
1831:     }
1832: 
1833:     /**
1834:      * Sets a collection of FeatureCvtermPub objects related by a one-to-many relationship
1835:      * to the current object.
1836:      * It will also schedule objects for deletion based on a diff between old objects (aka persisted)
1837:      * and new objects from the given Propel collection.
1838:      *
1839:      * @param PropelCollection $featureCvtermPubs A Propel collection.
1840:      * @param PropelPDO $con Optional connection object
1841:      * @return FeatureCvterm The current object (for fluent API support)
1842:      */
1843:     public function setFeatureCvtermPubs(PropelCollection $featureCvtermPubs, PropelPDO $con = null)
1844:     {
1845:         $featureCvtermPubsToDelete = $this->getFeatureCvtermPubs(new Criteria(), $con)->diff($featureCvtermPubs);
1846: 
1847:         $this->featureCvtermPubsScheduledForDeletion = unserialize(serialize($featureCvtermPubsToDelete));
1848: 
1849:         foreach ($featureCvtermPubsToDelete as $featureCvtermPubRemoved) {
1850:             $featureCvtermPubRemoved->setFeatureCvterm(null);
1851:         }
1852: 
1853:         $this->collFeatureCvtermPubs = null;
1854:         foreach ($featureCvtermPubs as $featureCvtermPub) {
1855:             $this->addFeatureCvtermPub($featureCvtermPub);
1856:         }
1857: 
1858:         $this->collFeatureCvtermPubs = $featureCvtermPubs;
1859:         $this->collFeatureCvtermPubsPartial = false;
1860: 
1861:         return $this;
1862:     }
1863: 
1864:     /**
1865:      * Returns the number of related FeatureCvtermPub objects.
1866:      *
1867:      * @param Criteria $criteria
1868:      * @param boolean $distinct
1869:      * @param PropelPDO $con
1870:      * @return int             Count of related FeatureCvtermPub objects.
1871:      * @throws PropelException
1872:      */
1873:     public function countFeatureCvtermPubs(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
1874:     {
1875:         $partial = $this->collFeatureCvtermPubsPartial && !$this->isNew();
1876:         if (null === $this->collFeatureCvtermPubs || null !== $criteria || $partial) {
1877:             if ($this->isNew() && null === $this->collFeatureCvtermPubs) {
1878:                 return 0;
1879:             }
1880: 
1881:             if($partial && !$criteria) {
1882:                 return count($this->getFeatureCvtermPubs());
1883:             }
1884:             $query = FeatureCvtermPubQuery::create(null, $criteria);
1885:             if ($distinct) {
1886:                 $query->distinct();
1887:             }
1888: 
1889:             return $query
1890:                 ->filterByFeatureCvterm($this)
1891:                 ->count($con);
1892:         }
1893: 
1894:         return count($this->collFeatureCvtermPubs);
1895:     }
1896: 
1897:     /**
1898:      * Method called to associate a FeatureCvtermPub object to this object
1899:      * through the FeatureCvtermPub foreign key attribute.
1900:      *
1901:      * @param    FeatureCvtermPub $l FeatureCvtermPub
1902:      * @return FeatureCvterm The current object (for fluent API support)
1903:      */
1904:     public function addFeatureCvtermPub(FeatureCvtermPub $l)
1905:     {
1906:         if ($this->collFeatureCvtermPubs === null) {
1907:             $this->initFeatureCvtermPubs();
1908:             $this->collFeatureCvtermPubsPartial = true;
1909:         }
1910:         if (!in_array($l, $this->collFeatureCvtermPubs->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
1911:             $this->doAddFeatureCvtermPub($l);
1912:         }
1913: 
1914:         return $this;
1915:     }
1916: 
1917:     /**
1918:      * @param   FeatureCvtermPub $featureCvtermPub The featureCvtermPub object to add.
1919:      */
1920:     protected function doAddFeatureCvtermPub($featureCvtermPub)
1921:     {
1922:         $this->collFeatureCvtermPubs[]= $featureCvtermPub;
1923:         $featureCvtermPub->setFeatureCvterm($this);
1924:     }
1925: 
1926:     /**
1927:      * @param   FeatureCvtermPub $featureCvtermPub The featureCvtermPub object to remove.
1928:      * @return FeatureCvterm The current object (for fluent API support)
1929:      */
1930:     public function removeFeatureCvtermPub($featureCvtermPub)
1931:     {
1932:         if ($this->getFeatureCvtermPubs()->contains($featureCvtermPub)) {
1933:             $this->collFeatureCvtermPubs->remove($this->collFeatureCvtermPubs->search($featureCvtermPub));
1934:             if (null === $this->featureCvtermPubsScheduledForDeletion) {
1935:                 $this->featureCvtermPubsScheduledForDeletion = clone $this->collFeatureCvtermPubs;
1936:                 $this->featureCvtermPubsScheduledForDeletion->clear();
1937:             }
1938:             $this->featureCvtermPubsScheduledForDeletion[]= clone $featureCvtermPub;
1939:             $featureCvtermPub->setFeatureCvterm(null);
1940:         }
1941: 
1942:         return $this;
1943:     }
1944: 
1945: 
1946:     /**
1947:      * If this collection has already been initialized with
1948:      * an identical criteria, it returns the collection.
1949:      * Otherwise if this FeatureCvterm is new, it will return
1950:      * an empty collection; or if this FeatureCvterm has previously
1951:      * been saved, it will retrieve related FeatureCvtermPubs from storage.
1952:      *
1953:      * This method is protected by default in order to keep the public
1954:      * api reasonable.  You can provide public methods for those you
1955:      * actually need in FeatureCvterm.
1956:      *
1957:      * @param Criteria $criteria optional Criteria object to narrow the query
1958:      * @param PropelPDO $con optional connection object
1959:      * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN)
1960:      * @return PropelObjectCollection|FeatureCvtermPub[] List of FeatureCvtermPub objects
1961:      */
1962:     public function getFeatureCvtermPubsJoinPub($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
1963:     {
1964:         $query = FeatureCvtermPubQuery::create(null, $criteria);
1965:         $query->joinWith('Pub', $join_behavior);
1966: 
1967:         return $this->getFeatureCvtermPubs($query, $con);
1968:     }
1969: 
1970:     /**
1971:      * Clears out the collFeatureCvtermprops collection
1972:      *
1973:      * This does not modify the database; however, it will remove any associated objects, causing
1974:      * them to be refetched by subsequent calls to accessor method.
1975:      *
1976:      * @return FeatureCvterm The current object (for fluent API support)
1977:      * @see        addFeatureCvtermprops()
1978:      */
1979:     public function clearFeatureCvtermprops()
1980:     {
1981:         $this->collFeatureCvtermprops = null; // important to set this to null since that means it is uninitialized
1982:         $this->collFeatureCvtermpropsPartial = null;
1983: 
1984:         return $this;
1985:     }
1986: 
1987:     /**
1988:      * reset is the collFeatureCvtermprops collection loaded partially
1989:      *
1990:      * @return void
1991:      */
1992:     public function resetPartialFeatureCvtermprops($v = true)
1993:     {
1994:         $this->collFeatureCvtermpropsPartial = $v;
1995:     }
1996: 
1997:     /**
1998:      * Initializes the collFeatureCvtermprops collection.
1999:      *
2000:      * By default this just sets the collFeatureCvtermprops collection to an empty array (like clearcollFeatureCvtermprops());
2001:      * however, you may wish to override this method in your stub class to provide setting appropriate
2002:      * to your application -- for example, setting the initial array to the values stored in database.
2003:      *
2004:      * @param boolean $overrideExisting If set to true, the method call initializes
2005:      *                                        the collection even if it is not empty
2006:      *
2007:      * @return void
2008:      */
2009:     public function initFeatureCvtermprops($overrideExisting = true)
2010:     {
2011:         if (null !== $this->collFeatureCvtermprops && !$overrideExisting) {
2012:             return;
2013:         }
2014:         $this->collFeatureCvtermprops = new PropelObjectCollection();
2015:         $this->collFeatureCvtermprops->setModel('FeatureCvtermprop');
2016:     }
2017: 
2018:     /**
2019:      * Gets an array of FeatureCvtermprop objects which contain a foreign key that references this object.
2020:      *
2021:      * If the $criteria is not null, it is used to always fetch the results from the database.
2022:      * Otherwise the results are fetched from the database the first time, then cached.
2023:      * Next time the same method is called without $criteria, the cached collection is returned.
2024:      * If this FeatureCvterm is new, it will return
2025:      * an empty collection or the current collection; the criteria is ignored on a new object.
2026:      *
2027:      * @param Criteria $criteria optional Criteria object to narrow the query
2028:      * @param PropelPDO $con optional connection object
2029:      * @return PropelObjectCollection|FeatureCvtermprop[] List of FeatureCvtermprop objects
2030:      * @throws PropelException
2031:      */
2032:     public function getFeatureCvtermprops($criteria = null, PropelPDO $con = null)
2033:     {
2034:         $partial = $this->collFeatureCvtermpropsPartial && !$this->isNew();
2035:         if (null === $this->collFeatureCvtermprops || null !== $criteria  || $partial) {
2036:             if ($this->isNew() && null === $this->collFeatureCvtermprops) {
2037:                 // return empty collection
2038:                 $this->initFeatureCvtermprops();
2039:             } else {
2040:                 $collFeatureCvtermprops = FeatureCvtermpropQuery::create(null, $criteria)
2041:                     ->filterByFeatureCvterm($this)
2042:                     ->find($con);
2043:                 if (null !== $criteria) {
2044:                     if (false !== $this->collFeatureCvtermpropsPartial && count($collFeatureCvtermprops)) {
2045:                       $this->initFeatureCvtermprops(false);
2046: 
2047:                       foreach($collFeatureCvtermprops as $obj) {
2048:                         if (false == $this->collFeatureCvtermprops->contains($obj)) {
2049:                           $this->collFeatureCvtermprops->append($obj);
2050:                         }
2051:                       }
2052: 
2053:                       $this->collFeatureCvtermpropsPartial = true;
2054:                     }
2055: 
2056:                     $collFeatureCvtermprops->getInternalIterator()->rewind();
2057:                     return $collFeatureCvtermprops;
2058:                 }
2059: 
2060:                 if($partial && $this->collFeatureCvtermprops) {
2061:                     foreach($this->collFeatureCvtermprops as $obj) {
2062:                         if($obj->isNew()) {
2063:                             $collFeatureCvtermprops[] = $obj;
2064:                         }
2065:                     }
2066:                 }
2067: 
2068:                 $this->collFeatureCvtermprops = $collFeatureCvtermprops;
2069:                 $this->collFeatureCvtermpropsPartial = false;
2070:             }
2071:         }
2072: 
2073:         return $this->collFeatureCvtermprops;
2074:     }
2075: 
2076:     /**
2077:      * Sets a collection of FeatureCvtermprop objects related by a one-to-many relationship
2078:      * to the current object.
2079:      * It will also schedule objects for deletion based on a diff between old objects (aka persisted)
2080:      * and new objects from the given Propel collection.
2081:      *
2082:      * @param PropelCollection $featureCvtermprops A Propel collection.
2083:      * @param PropelPDO $con Optional connection object
2084:      * @return FeatureCvterm The current object (for fluent API support)
2085:      */
2086:     public function setFeatureCvtermprops(PropelCollection $featureCvtermprops, PropelPDO $con = null)
2087:     {
2088:         $featureCvtermpropsToDelete = $this->getFeatureCvtermprops(new Criteria(), $con)->diff($featureCvtermprops);
2089: 
2090:         $this->featureCvtermpropsScheduledForDeletion = unserialize(serialize($featureCvtermpropsToDelete));
2091: 
2092:         foreach ($featureCvtermpropsToDelete as $featureCvtermpropRemoved) {
2093:             $featureCvtermpropRemoved->setFeatureCvterm(null);
2094:         }
2095: 
2096:         $this->collFeatureCvtermprops = null;
2097:         foreach ($featureCvtermprops as $featureCvtermprop) {
2098:             $this->addFeatureCvtermprop($featureCvtermprop);
2099:         }
2100: 
2101:         $this->collFeatureCvtermprops = $featureCvtermprops;
2102:         $this->collFeatureCvtermpropsPartial = false;
2103: 
2104:         return $this;
2105:     }
2106: 
2107:     /**
2108:      * Returns the number of related FeatureCvtermprop objects.
2109:      *
2110:      * @param Criteria $criteria
2111:      * @param boolean $distinct
2112:      * @param PropelPDO $con
2113:      * @return int             Count of related FeatureCvtermprop objects.
2114:      * @throws PropelException
2115:      */
2116:     public function countFeatureCvtermprops(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
2117:     {
2118:         $partial = $this->collFeatureCvtermpropsPartial && !$this->isNew();
2119:         if (null === $this->collFeatureCvtermprops || null !== $criteria || $partial) {
2120:             if ($this->isNew() && null === $this->collFeatureCvtermprops) {
2121:                 return 0;
2122:             }
2123: 
2124:             if($partial && !$criteria) {
2125:                 return count($this->getFeatureCvtermprops());
2126:             }
2127:             $query = FeatureCvtermpropQuery::create(null, $criteria);
2128:             if ($distinct) {
2129:                 $query->distinct();
2130:             }
2131: 
2132:             return $query
2133:                 ->filterByFeatureCvterm($this)
2134:                 ->count($con);
2135:         }
2136: 
2137:         return count($this->collFeatureCvtermprops);
2138:     }
2139: 
2140:     /**
2141:      * Method called to associate a FeatureCvtermprop object to this object
2142:      * through the FeatureCvtermprop foreign key attribute.
2143:      *
2144:      * @param    FeatureCvtermprop $l FeatureCvtermprop
2145:      * @return FeatureCvterm The current object (for fluent API support)
2146:      */
2147:     public function addFeatureCvtermprop(FeatureCvtermprop $l)
2148:     {
2149:         if ($this->collFeatureCvtermprops === null) {
2150:             $this->initFeatureCvtermprops();
2151:             $this->collFeatureCvtermpropsPartial = true;
2152:         }
2153:         if (!in_array($l, $this->collFeatureCvtermprops->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
2154:             $this->doAddFeatureCvtermprop($l);
2155:         }
2156: 
2157:         return $this;
2158:     }
2159: 
2160:     /**
2161:      * @param   FeatureCvtermprop $featureCvtermprop The featureCvtermprop object to add.
2162:      */
2163:     protected function doAddFeatureCvtermprop($featureCvtermprop)
2164:     {
2165:         $this->collFeatureCvtermprops[]= $featureCvtermprop;
2166:         $featureCvtermprop->setFeatureCvterm($this);
2167:     }
2168: 
2169:     /**
2170:      * @param   FeatureCvtermprop $featureCvtermprop The featureCvtermprop object to remove.
2171:      * @return FeatureCvterm The current object (for fluent API support)
2172:      */
2173:     public function removeFeatureCvtermprop($featureCvtermprop)
2174:     {
2175:         if ($this->getFeatureCvtermprops()->contains($featureCvtermprop)) {
2176:             $this->collFeatureCvtermprops->remove($this->collFeatureCvtermprops->search($featureCvtermprop));
2177:             if (null === $this->featureCvtermpropsScheduledForDeletion) {
2178:                 $this->featureCvtermpropsScheduledForDeletion = clone $this->collFeatureCvtermprops;
2179:                 $this->featureCvtermpropsScheduledForDeletion->clear();
2180:             }
2181:             $this->featureCvtermpropsScheduledForDeletion[]= clone $featureCvtermprop;
2182:             $featureCvtermprop->setFeatureCvterm(null);
2183:         }
2184: 
2185:         return $this;
2186:     }
2187: 
2188: 
2189:     /**
2190:      * If this collection has already been initialized with
2191:      * an identical criteria, it returns the collection.
2192:      * Otherwise if this FeatureCvterm is new, it will return
2193:      * an empty collection; or if this FeatureCvterm has previously
2194:      * been saved, it will retrieve related FeatureCvtermprops from storage.
2195:      *
2196:      * This method is protected by default in order to keep the public
2197:      * api reasonable.  You can provide public methods for those you
2198:      * actually need in FeatureCvterm.
2199:      *
2200:      * @param Criteria $criteria optional Criteria object to narrow the query
2201:      * @param PropelPDO $con optional connection object
2202:      * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN)
2203:      * @return PropelObjectCollection|FeatureCvtermprop[] List of FeatureCvtermprop objects
2204:      */
2205:     public function getFeatureCvtermpropsJoinCvterm($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
2206:     {
2207:         $query = FeatureCvtermpropQuery::create(null, $criteria);
2208:         $query->joinWith('Cvterm', $join_behavior);
2209: 
2210:         return $this->getFeatureCvtermprops($query, $con);
2211:     }
2212: 
2213:     /**
2214:      * Clears the current object and sets all attributes to their default values
2215:      */
2216:     public function clear()
2217:     {
2218:         $this->feature_cvterm_id = null;
2219:         $this->feature_id = null;
2220:         $this->cvterm_id = null;
2221:         $this->pub_id = null;
2222:         $this->is_not = null;
2223:         $this->rank = null;
2224:         $this->alreadyInSave = false;
2225:         $this->alreadyInValidation = false;
2226:         $this->alreadyInClearAllReferencesDeep = false;
2227:         $this->clearAllReferences();
2228:         $this->applyDefaultValues();
2229:         $this->resetModified();
2230:         $this->setNew(true);
2231:         $this->setDeleted(false);
2232:     }
2233: 
2234:     /**
2235:      * Resets all references to other model objects or collections of model objects.
2236:      *
2237:      * This method is a user-space workaround for PHP's inability to garbage collect
2238:      * objects with circular references (even in PHP 5.3). This is currently necessary
2239:      * when using Propel in certain daemon or large-volumne/high-memory operations.
2240:      *
2241:      * @param boolean $deep Whether to also clear the references on all referrer objects.
2242:      */
2243:     public function clearAllReferences($deep = false)
2244:     {
2245:         if ($deep && !$this->alreadyInClearAllReferencesDeep) {
2246:             $this->alreadyInClearAllReferencesDeep = true;
2247:             if ($this->collFeatureCvtermDbxrefs) {
2248:                 foreach ($this->collFeatureCvtermDbxrefs as $o) {
2249:                     $o->clearAllReferences($deep);
2250:                 }
2251:             }
2252:             if ($this->collFeatureCvtermPubs) {
2253:                 foreach ($this->collFeatureCvtermPubs as $o) {
2254:                     $o->clearAllReferences($deep);
2255:                 }
2256:             }
2257:             if ($this->collFeatureCvtermprops) {
2258:                 foreach ($this->collFeatureCvtermprops as $o) {
2259:                     $o->clearAllReferences($deep);
2260:                 }
2261:             }
2262:             if ($this->aCvterm instanceof Persistent) {
2263:               $this->aCvterm->clearAllReferences($deep);
2264:             }
2265:             if ($this->aFeature instanceof Persistent) {
2266:               $this->aFeature->clearAllReferences($deep);
2267:             }
2268:             if ($this->aPub instanceof Persistent) {
2269:               $this->aPub->clearAllReferences($deep);
2270:             }
2271: 
2272:             $this->alreadyInClearAllReferencesDeep = false;
2273:         } // if ($deep)
2274: 
2275:         if ($this->collFeatureCvtermDbxrefs instanceof PropelCollection) {
2276:             $this->collFeatureCvtermDbxrefs->clearIterator();
2277:         }
2278:         $this->collFeatureCvtermDbxrefs = null;
2279:         if ($this->collFeatureCvtermPubs instanceof PropelCollection) {
2280:             $this->collFeatureCvtermPubs->clearIterator();
2281:         }
2282:         $this->collFeatureCvtermPubs = null;
2283:         if ($this->collFeatureCvtermprops instanceof PropelCollection) {
2284:             $this->collFeatureCvtermprops->clearIterator();
2285:         }
2286:         $this->collFeatureCvtermprops = null;
2287:         $this->aCvterm = null;
2288:         $this->aFeature = null;
2289:         $this->aPub = null;
2290:     }
2291: 
2292:     /**
2293:      * return the string representation of this object
2294:      *
2295:      * @return string
2296:      */
2297:     public function __toString()
2298:     {
2299:         return (string) $this->exportTo(FeatureCvtermPeer::DEFAULT_STRING_FORMAT);
2300:     }
2301: 
2302:     /**
2303:      * return true is the object is in saving state
2304:      *
2305:      * @return boolean
2306:      */
2307:     public function isAlreadyInSave()
2308:     {
2309:         return $this->alreadyInSave;
2310:     }
2311: 
2312: }
2313: 
tbro API documentation generated by ApiGen 2.8.0