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 \DateTime;
   9: use \Exception;
  10: use \PDO;
  11: use \Persistent;
  12: use \Propel;
  13: use \PropelCollection;
  14: use \PropelDateTime;
  15: use \PropelException;
  16: use \PropelObjectCollection;
  17: use \PropelPDO;
  18: use cli_db\propel\Cvterm;
  19: use cli_db\propel\CvtermQuery;
  20: use cli_db\propel\Dbxref;
  21: use cli_db\propel\DbxrefQuery;
  22: use cli_db\propel\Feature;
  23: use cli_db\propel\FeatureCvterm;
  24: use cli_db\propel\FeatureCvtermQuery;
  25: use cli_db\propel\FeatureDbxref;
  26: use cli_db\propel\FeatureDbxrefQuery;
  27: use cli_db\propel\FeaturePeer;
  28: use cli_db\propel\FeaturePub;
  29: use cli_db\propel\FeaturePubQuery;
  30: use cli_db\propel\FeatureQuery;
  31: use cli_db\propel\FeatureSynonym;
  32: use cli_db\propel\FeatureSynonymQuery;
  33: use cli_db\propel\Organism;
  34: use cli_db\propel\OrganismQuery;
  35: 
  36: /**
  37:  * Base class that represents a row from the 'feature' table.
  38:  *
  39:  *
  40:  *
  41:  * @package    propel.generator.cli_db.om
  42:  */
  43: abstract class BaseFeature extends BaseObject implements Persistent
  44: {
  45:     /**
  46:      * Peer class name
  47:      */
  48:     const PEER = 'cli_db\\propel\\FeaturePeer';
  49: 
  50:     /**
  51:      * The Peer class.
  52:      * Instance provides a convenient way of calling static methods on a class
  53:      * that calling code may not be able to identify.
  54:      * @var        FeaturePeer
  55:      */
  56:     protected static $peer;
  57: 
  58:     /**
  59:      * The flag var to prevent infinit loop in deep copy
  60:      * @var       boolean
  61:      */
  62:     protected $startCopy = false;
  63: 
  64:     /**
  65:      * The value for the feature_id field.
  66:      * @var        int
  67:      */
  68:     protected $feature_id;
  69: 
  70:     /**
  71:      * The value for the dbxref_id field.
  72:      * @var        int
  73:      */
  74:     protected $dbxref_id;
  75: 
  76:     /**
  77:      * The value for the organism_id field.
  78:      * @var        int
  79:      */
  80:     protected $organism_id;
  81: 
  82:     /**
  83:      * The value for the name field.
  84:      * @var        string
  85:      */
  86:     protected $name;
  87: 
  88:     /**
  89:      * The value for the uniquename field.
  90:      * @var        string
  91:      */
  92:     protected $uniquename;
  93: 
  94:     /**
  95:      * The value for the residues field.
  96:      * @var        string
  97:      */
  98:     protected $residues;
  99: 
 100:     /**
 101:      * The value for the seqlen field.
 102:      * @var        int
 103:      */
 104:     protected $seqlen;
 105: 
 106:     /**
 107:      * The value for the md5checksum field.
 108:      * @var        string
 109:      */
 110:     protected $md5checksum;
 111: 
 112:     /**
 113:      * The value for the type_id field.
 114:      * @var        int
 115:      */
 116:     protected $type_id;
 117: 
 118:     /**
 119:      * The value for the is_analysis field.
 120:      * Note: this column has a database default value of: false
 121:      * @var        boolean
 122:      */
 123:     protected $is_analysis;
 124: 
 125:     /**
 126:      * The value for the is_obsolete field.
 127:      * Note: this column has a database default value of: false
 128:      * @var        boolean
 129:      */
 130:     protected $is_obsolete;
 131: 
 132:     /**
 133:      * The value for the timeaccessioned field.
 134:      * Note: this column has a database default value of: (expression) now()
 135:      * @var        string
 136:      */
 137:     protected $timeaccessioned;
 138: 
 139:     /**
 140:      * The value for the timelastmodified field.
 141:      * Note: this column has a database default value of: (expression) now()
 142:      * @var        string
 143:      */
 144:     protected $timelastmodified;
 145: 
 146:     /**
 147:      * @var        Dbxref
 148:      */
 149:     protected $aDbxref;
 150: 
 151:     /**
 152:      * @var        Organism
 153:      */
 154:     protected $aOrganism;
 155: 
 156:     /**
 157:      * @var        Cvterm
 158:      */
 159:     protected $aCvterm;
 160: 
 161:     /**
 162:      * @var        PropelObjectCollection|FeatureCvterm[] Collection to store aggregation of FeatureCvterm objects.
 163:      */
 164:     protected $collFeatureCvterms;
 165:     protected $collFeatureCvtermsPartial;
 166: 
 167:     /**
 168:      * @var        PropelObjectCollection|FeatureDbxref[] Collection to store aggregation of FeatureDbxref objects.
 169:      */
 170:     protected $collFeatureDbxrefs;
 171:     protected $collFeatureDbxrefsPartial;
 172: 
 173:     /**
 174:      * @var        PropelObjectCollection|FeaturePub[] Collection to store aggregation of FeaturePub objects.
 175:      */
 176:     protected $collFeaturePubs;
 177:     protected $collFeaturePubsPartial;
 178: 
 179:     /**
 180:      * @var        PropelObjectCollection|FeatureSynonym[] Collection to store aggregation of FeatureSynonym objects.
 181:      */
 182:     protected $collFeatureSynonyms;
 183:     protected $collFeatureSynonymsPartial;
 184: 
 185:     /**
 186:      * Flag to prevent endless save loop, if this object is referenced
 187:      * by another object which falls in this transaction.
 188:      * @var        boolean
 189:      */
 190:     protected $alreadyInSave = false;
 191: 
 192:     /**
 193:      * Flag to prevent endless validation loop, if this object is referenced
 194:      * by another object which falls in this transaction.
 195:      * @var        boolean
 196:      */
 197:     protected $alreadyInValidation = false;
 198: 
 199:     /**
 200:      * Flag to prevent endless clearAllReferences($deep=true) loop, if this object is referenced
 201:      * @var        boolean
 202:      */
 203:     protected $alreadyInClearAllReferencesDeep = false;
 204: 
 205:     /**
 206:      * An array of objects scheduled for deletion.
 207:      * @var     PropelObjectCollection
 208:      */
 209:     protected $featureCvtermsScheduledForDeletion = null;
 210: 
 211:     /**
 212:      * An array of objects scheduled for deletion.
 213:      * @var     PropelObjectCollection
 214:      */
 215:     protected $featureDbxrefsScheduledForDeletion = null;
 216: 
 217:     /**
 218:      * An array of objects scheduled for deletion.
 219:      * @var     PropelObjectCollection
 220:      */
 221:     protected $featurePubsScheduledForDeletion = null;
 222: 
 223:     /**
 224:      * An array of objects scheduled for deletion.
 225:      * @var     PropelObjectCollection
 226:      */
 227:     protected $featureSynonymsScheduledForDeletion = null;
 228: 
 229:     /**
 230:      * Applies default values to this object.
 231:      * This method should be called from the object's constructor (or
 232:      * equivalent initialization method).
 233:      * @see        __construct()
 234:      */
 235:     public function applyDefaultValues()
 236:     {
 237:         $this->is_analysis = false;
 238:         $this->is_obsolete = false;
 239:     }
 240: 
 241:     /**
 242:      * Initializes internal state of BaseFeature object.
 243:      * @see        applyDefaults()
 244:      */
 245:     public function __construct()
 246:     {
 247:         parent::__construct();
 248:         $this->applyDefaultValues();
 249:     }
 250: 
 251:     /**
 252:      * Get the [feature_id] column value.
 253:      *
 254:      * @return int
 255:      */
 256:     public function getFeatureId()
 257:     {
 258:         return $this->feature_id;
 259:     }
 260: 
 261:     /**
 262:      * Get the [dbxref_id] column value.
 263:      *
 264:      * @return int
 265:      */
 266:     public function getDbxrefId()
 267:     {
 268:         return $this->dbxref_id;
 269:     }
 270: 
 271:     /**
 272:      * Get the [organism_id] column value.
 273:      *
 274:      * @return int
 275:      */
 276:     public function getOrganismId()
 277:     {
 278:         return $this->organism_id;
 279:     }
 280: 
 281:     /**
 282:      * Get the [name] column value.
 283:      *
 284:      * @return string
 285:      */
 286:     public function getName()
 287:     {
 288:         return $this->name;
 289:     }
 290: 
 291:     /**
 292:      * Get the [uniquename] column value.
 293:      *
 294:      * @return string
 295:      */
 296:     public function getUniquename()
 297:     {
 298:         return $this->uniquename;
 299:     }
 300: 
 301:     /**
 302:      * Get the [residues] column value.
 303:      *
 304:      * @return string
 305:      */
 306:     public function getResidues()
 307:     {
 308:         return $this->residues;
 309:     }
 310: 
 311:     /**
 312:      * Get the [seqlen] column value.
 313:      *
 314:      * @return int
 315:      */
 316:     public function getSeqlen()
 317:     {
 318:         return $this->seqlen;
 319:     }
 320: 
 321:     /**
 322:      * Get the [md5checksum] column value.
 323:      *
 324:      * @return string
 325:      */
 326:     public function getMd5checksum()
 327:     {
 328:         return $this->md5checksum;
 329:     }
 330: 
 331:     /**
 332:      * Get the [type_id] column value.
 333:      *
 334:      * @return int
 335:      */
 336:     public function getTypeId()
 337:     {
 338:         return $this->type_id;
 339:     }
 340: 
 341:     /**
 342:      * Get the [is_analysis] column value.
 343:      *
 344:      * @return boolean
 345:      */
 346:     public function getIsAnalysis()
 347:     {
 348:         return $this->is_analysis;
 349:     }
 350: 
 351:     /**
 352:      * Get the [is_obsolete] column value.
 353:      *
 354:      * @return boolean
 355:      */
 356:     public function getIsObsolete()
 357:     {
 358:         return $this->is_obsolete;
 359:     }
 360: 
 361:     /**
 362:      * Get the [optionally formatted] temporal [timeaccessioned] column value.
 363:      *
 364:      *
 365:      * @param string $format The date/time format string (either date()-style or strftime()-style).
 366:      *               If format is null, then the raw DateTime object will be returned.
 367:      * @return mixed Formatted date/time value as string or DateTime object (if format is null), null if column is null
 368:      * @throws PropelException - if unable to parse/validate the date/time value.
 369:      */
 370:     public function getTimeaccessioned($format = 'Y-m-d H:i:s')
 371:     {
 372:         if ($this->timeaccessioned === null) {
 373:             return null;
 374:         }
 375: 
 376: 
 377:         try {
 378:             $dt = new DateTime($this->timeaccessioned);
 379:         } catch (Exception $x) {
 380:             throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->timeaccessioned, true), $x);
 381:         }
 382: 
 383:         if ($format === null) {
 384:             // Because propel.useDateTimeClass is true, we return a DateTime object.
 385:             return $dt;
 386:         }
 387: 
 388:         if (strpos($format, '%') !== false) {
 389:             return strftime($format, $dt->format('U'));
 390:         }
 391: 
 392:         return $dt->format($format);
 393: 
 394:     }
 395: 
 396:     /**
 397:      * Get the [optionally formatted] temporal [timelastmodified] column value.
 398:      *
 399:      *
 400:      * @param string $format The date/time format string (either date()-style or strftime()-style).
 401:      *               If format is null, then the raw DateTime object will be returned.
 402:      * @return mixed Formatted date/time value as string or DateTime object (if format is null), null if column is null
 403:      * @throws PropelException - if unable to parse/validate the date/time value.
 404:      */
 405:     public function getTimelastmodified($format = 'Y-m-d H:i:s')
 406:     {
 407:         if ($this->timelastmodified === null) {
 408:             return null;
 409:         }
 410: 
 411: 
 412:         try {
 413:             $dt = new DateTime($this->timelastmodified);
 414:         } catch (Exception $x) {
 415:             throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->timelastmodified, true), $x);
 416:         }
 417: 
 418:         if ($format === null) {
 419:             // Because propel.useDateTimeClass is true, we return a DateTime object.
 420:             return $dt;
 421:         }
 422: 
 423:         if (strpos($format, '%') !== false) {
 424:             return strftime($format, $dt->format('U'));
 425:         }
 426: 
 427:         return $dt->format($format);
 428: 
 429:     }
 430: 
 431:     /**
 432:      * Set the value of [feature_id] column.
 433:      *
 434:      * @param int $v new value
 435:      * @return Feature The current object (for fluent API support)
 436:      */
 437:     public function setFeatureId($v)
 438:     {
 439:         if ($v !== null && is_numeric($v)) {
 440:             $v = (int) $v;
 441:         }
 442: 
 443:         if ($this->feature_id !== $v) {
 444:             $this->feature_id = $v;
 445:             $this->modifiedColumns[] = FeaturePeer::FEATURE_ID;
 446:         }
 447: 
 448: 
 449:         return $this;
 450:     } // setFeatureId()
 451: 
 452:     /**
 453:      * Set the value of [dbxref_id] column.
 454:      *
 455:      * @param int $v new value
 456:      * @return Feature The current object (for fluent API support)
 457:      */
 458:     public function setDbxrefId($v)
 459:     {
 460:         if ($v !== null && is_numeric($v)) {
 461:             $v = (int) $v;
 462:         }
 463: 
 464:         if ($this->dbxref_id !== $v) {
 465:             $this->dbxref_id = $v;
 466:             $this->modifiedColumns[] = FeaturePeer::DBXREF_ID;
 467:         }
 468: 
 469:         if ($this->aDbxref !== null && $this->aDbxref->getDbxrefId() !== $v) {
 470:             $this->aDbxref = null;
 471:         }
 472: 
 473: 
 474:         return $this;
 475:     } // setDbxrefId()
 476: 
 477:     /**
 478:      * Set the value of [organism_id] column.
 479:      *
 480:      * @param int $v new value
 481:      * @return Feature The current object (for fluent API support)
 482:      */
 483:     public function setOrganismId($v)
 484:     {
 485:         if ($v !== null && is_numeric($v)) {
 486:             $v = (int) $v;
 487:         }
 488: 
 489:         if ($this->organism_id !== $v) {
 490:             $this->organism_id = $v;
 491:             $this->modifiedColumns[] = FeaturePeer::ORGANISM_ID;
 492:         }
 493: 
 494:         if ($this->aOrganism !== null && $this->aOrganism->getOrganismId() !== $v) {
 495:             $this->aOrganism = null;
 496:         }
 497: 
 498: 
 499:         return $this;
 500:     } // setOrganismId()
 501: 
 502:     /**
 503:      * Set the value of [name] column.
 504:      *
 505:      * @param string $v new value
 506:      * @return Feature The current object (for fluent API support)
 507:      */
 508:     public function setName($v)
 509:     {
 510:         if ($v !== null && is_numeric($v)) {
 511:             $v = (string) $v;
 512:         }
 513: 
 514:         if ($this->name !== $v) {
 515:             $this->name = $v;
 516:             $this->modifiedColumns[] = FeaturePeer::NAME;
 517:         }
 518: 
 519: 
 520:         return $this;
 521:     } // setName()
 522: 
 523:     /**
 524:      * Set the value of [uniquename] column.
 525:      *
 526:      * @param string $v new value
 527:      * @return Feature The current object (for fluent API support)
 528:      */
 529:     public function setUniquename($v)
 530:     {
 531:         if ($v !== null && is_numeric($v)) {
 532:             $v = (string) $v;
 533:         }
 534: 
 535:         if ($this->uniquename !== $v) {
 536:             $this->uniquename = $v;
 537:             $this->modifiedColumns[] = FeaturePeer::UNIQUENAME;
 538:         }
 539: 
 540: 
 541:         return $this;
 542:     } // setUniquename()
 543: 
 544:     /**
 545:      * Set the value of [residues] column.
 546:      *
 547:      * @param string $v new value
 548:      * @return Feature The current object (for fluent API support)
 549:      */
 550:     public function setResidues($v)
 551:     {
 552:         if ($v !== null && is_numeric($v)) {
 553:             $v = (string) $v;
 554:         }
 555: 
 556:         if ($this->residues !== $v) {
 557:             $this->residues = $v;
 558:             $this->modifiedColumns[] = FeaturePeer::RESIDUES;
 559:         }
 560: 
 561: 
 562:         return $this;
 563:     } // setResidues()
 564: 
 565:     /**
 566:      * Set the value of [seqlen] column.
 567:      *
 568:      * @param int $v new value
 569:      * @return Feature The current object (for fluent API support)
 570:      */
 571:     public function setSeqlen($v)
 572:     {
 573:         if ($v !== null && is_numeric($v)) {
 574:             $v = (int) $v;
 575:         }
 576: 
 577:         if ($this->seqlen !== $v) {
 578:             $this->seqlen = $v;
 579:             $this->modifiedColumns[] = FeaturePeer::SEQLEN;
 580:         }
 581: 
 582: 
 583:         return $this;
 584:     } // setSeqlen()
 585: 
 586:     /**
 587:      * Set the value of [md5checksum] column.
 588:      *
 589:      * @param string $v new value
 590:      * @return Feature The current object (for fluent API support)
 591:      */
 592:     public function setMd5checksum($v)
 593:     {
 594:         if ($v !== null && is_numeric($v)) {
 595:             $v = (string) $v;
 596:         }
 597: 
 598:         if ($this->md5checksum !== $v) {
 599:             $this->md5checksum = $v;
 600:             $this->modifiedColumns[] = FeaturePeer::MD5CHECKSUM;
 601:         }
 602: 
 603: 
 604:         return $this;
 605:     } // setMd5checksum()
 606: 
 607:     /**
 608:      * Set the value of [type_id] column.
 609:      *
 610:      * @param int $v new value
 611:      * @return Feature The current object (for fluent API support)
 612:      */
 613:     public function setTypeId($v)
 614:     {
 615:         if ($v !== null && is_numeric($v)) {
 616:             $v = (int) $v;
 617:         }
 618: 
 619:         if ($this->type_id !== $v) {
 620:             $this->type_id = $v;
 621:             $this->modifiedColumns[] = FeaturePeer::TYPE_ID;
 622:         }
 623: 
 624:         if ($this->aCvterm !== null && $this->aCvterm->getCvtermId() !== $v) {
 625:             $this->aCvterm = null;
 626:         }
 627: 
 628: 
 629:         return $this;
 630:     } // setTypeId()
 631: 
 632:     /**
 633:      * Sets the value of the [is_analysis] column.
 634:      * Non-boolean arguments are converted using the following rules:
 635:      *   * 1, '1', 'true',  'on',  and 'yes' are converted to boolean true
 636:      *   * 0, '0', 'false', 'off', and 'no'  are converted to boolean false
 637:      * Check on string values is case insensitive (so 'FaLsE' is seen as 'false').
 638:      *
 639:      * @param boolean|integer|string $v The new value
 640:      * @return Feature The current object (for fluent API support)
 641:      */
 642:     public function setIsAnalysis($v)
 643:     {
 644:         if ($v !== null) {
 645:             if (is_string($v)) {
 646:                 $v = in_array(strtolower($v), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
 647:             } else {
 648:                 $v = (boolean) $v;
 649:             }
 650:         }
 651: 
 652:         if ($this->is_analysis !== $v) {
 653:             $this->is_analysis = $v;
 654:             $this->modifiedColumns[] = FeaturePeer::IS_ANALYSIS;
 655:         }
 656: 
 657: 
 658:         return $this;
 659:     } // setIsAnalysis()
 660: 
 661:     /**
 662:      * Sets the value of the [is_obsolete] column.
 663:      * Non-boolean arguments are converted using the following rules:
 664:      *   * 1, '1', 'true',  'on',  and 'yes' are converted to boolean true
 665:      *   * 0, '0', 'false', 'off', and 'no'  are converted to boolean false
 666:      * Check on string values is case insensitive (so 'FaLsE' is seen as 'false').
 667:      *
 668:      * @param boolean|integer|string $v The new value
 669:      * @return Feature The current object (for fluent API support)
 670:      */
 671:     public function setIsObsolete($v)
 672:     {
 673:         if ($v !== null) {
 674:             if (is_string($v)) {
 675:                 $v = in_array(strtolower($v), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;
 676:             } else {
 677:                 $v = (boolean) $v;
 678:             }
 679:         }
 680: 
 681:         if ($this->is_obsolete !== $v) {
 682:             $this->is_obsolete = $v;
 683:             $this->modifiedColumns[] = FeaturePeer::IS_OBSOLETE;
 684:         }
 685: 
 686: 
 687:         return $this;
 688:     } // setIsObsolete()
 689: 
 690:     /**
 691:      * Sets the value of [timeaccessioned] column to a normalized version of the date/time value specified.
 692:      *
 693:      * @param mixed $v string, integer (timestamp), or DateTime value.
 694:      *               Empty strings are treated as null.
 695:      * @return Feature The current object (for fluent API support)
 696:      */
 697:     public function setTimeaccessioned($v)
 698:     {
 699:         $dt = PropelDateTime::newInstance($v, null, 'DateTime');
 700:         if ($this->timeaccessioned !== null || $dt !== null) {
 701:             $currentDateAsString = ($this->timeaccessioned !== null && $tmpDt = new DateTime($this->timeaccessioned)) ? $tmpDt->format('Y-m-d H:i:s') : null;
 702:             $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null;
 703:             if ($currentDateAsString !== $newDateAsString) {
 704:                 $this->timeaccessioned = $newDateAsString;
 705:                 $this->modifiedColumns[] = FeaturePeer::TIMEACCESSIONED;
 706:             }
 707:         } // if either are not null
 708: 
 709: 
 710:         return $this;
 711:     } // setTimeaccessioned()
 712: 
 713:     /**
 714:      * Sets the value of [timelastmodified] column to a normalized version of the date/time value specified.
 715:      *
 716:      * @param mixed $v string, integer (timestamp), or DateTime value.
 717:      *               Empty strings are treated as null.
 718:      * @return Feature The current object (for fluent API support)
 719:      */
 720:     public function setTimelastmodified($v)
 721:     {
 722:         $dt = PropelDateTime::newInstance($v, null, 'DateTime');
 723:         if ($this->timelastmodified !== null || $dt !== null) {
 724:             $currentDateAsString = ($this->timelastmodified !== null && $tmpDt = new DateTime($this->timelastmodified)) ? $tmpDt->format('Y-m-d H:i:s') : null;
 725:             $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null;
 726:             if ($currentDateAsString !== $newDateAsString) {
 727:                 $this->timelastmodified = $newDateAsString;
 728:                 $this->modifiedColumns[] = FeaturePeer::TIMELASTMODIFIED;
 729:             }
 730:         } // if either are not null
 731: 
 732: 
 733:         return $this;
 734:     } // setTimelastmodified()
 735: 
 736:     /**
 737:      * Indicates whether the columns in this object are only set to default values.
 738:      *
 739:      * This method can be used in conjunction with isModified() to indicate whether an object is both
 740:      * modified _and_ has some values set which are non-default.
 741:      *
 742:      * @return boolean Whether the columns in this object are only been set with default values.
 743:      */
 744:     public function hasOnlyDefaultValues()
 745:     {
 746:             if ($this->is_analysis !== false) {
 747:                 return false;
 748:             }
 749: 
 750:             if ($this->is_obsolete !== false) {
 751:                 return false;
 752:             }
 753: 
 754:         // otherwise, everything was equal, so return true
 755:         return true;
 756:     } // hasOnlyDefaultValues()
 757: 
 758:     /**
 759:      * Hydrates (populates) the object variables with values from the database resultset.
 760:      *
 761:      * An offset (0-based "start column") is specified so that objects can be hydrated
 762:      * with a subset of the columns in the resultset rows.  This is needed, for example,
 763:      * for results of JOIN queries where the resultset row includes columns from two or
 764:      * more tables.
 765:      *
 766:      * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM)
 767:      * @param int $startcol 0-based offset column which indicates which restultset column to start with.
 768:      * @param boolean $rehydrate Whether this object is being re-hydrated from the database.
 769:      * @return int             next starting column
 770:      * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
 771:      */
 772:     public function hydrate($row, $startcol = 0, $rehydrate = false)
 773:     {
 774:         try {
 775: 
 776:             $this->feature_id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null;
 777:             $this->dbxref_id = ($row[$startcol + 1] !== null) ? (int) $row[$startcol + 1] : null;
 778:             $this->organism_id = ($row[$startcol + 2] !== null) ? (int) $row[$startcol + 2] : null;
 779:             $this->name = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null;
 780:             $this->uniquename = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null;
 781:             $this->residues = ($row[$startcol + 5] !== null) ? (string) $row[$startcol + 5] : null;
 782:             $this->seqlen = ($row[$startcol + 6] !== null) ? (int) $row[$startcol + 6] : null;
 783:             $this->md5checksum = ($row[$startcol + 7] !== null) ? (string) $row[$startcol + 7] : null;
 784:             $this->type_id = ($row[$startcol + 8] !== null) ? (int) $row[$startcol + 8] : null;
 785:             $this->is_analysis = ($row[$startcol + 9] !== null) ? (boolean) $row[$startcol + 9] : null;
 786:             $this->is_obsolete = ($row[$startcol + 10] !== null) ? (boolean) $row[$startcol + 10] : null;
 787:             $this->timeaccessioned = ($row[$startcol + 11] !== null) ? (string) $row[$startcol + 11] : null;
 788:             $this->timelastmodified = ($row[$startcol + 12] !== null) ? (string) $row[$startcol + 12] : null;
 789:             $this->resetModified();
 790: 
 791:             $this->setNew(false);
 792: 
 793:             if ($rehydrate) {
 794:                 $this->ensureConsistency();
 795:             }
 796:             $this->postHydrate($row, $startcol, $rehydrate);
 797:             return $startcol + 13; // 13 = FeaturePeer::NUM_HYDRATE_COLUMNS.
 798: 
 799:         } catch (Exception $e) {
 800:             throw new PropelException("Error populating Feature object", $e);
 801:         }
 802:     }
 803: 
 804:     /**
 805:      * Checks and repairs the internal consistency of the object.
 806:      *
 807:      * This method is executed after an already-instantiated object is re-hydrated
 808:      * from the database.  It exists to check any foreign keys to make sure that
 809:      * the objects related to the current object are correct based on foreign key.
 810:      *
 811:      * You can override this method in the stub class, but you should always invoke
 812:      * the base method from the overridden method (i.e. parent::ensureConsistency()),
 813:      * in case your model changes.
 814:      *
 815:      * @throws PropelException
 816:      */
 817:     public function ensureConsistency()
 818:     {
 819: 
 820:         if ($this->aDbxref !== null && $this->dbxref_id !== $this->aDbxref->getDbxrefId()) {
 821:             $this->aDbxref = null;
 822:         }
 823:         if ($this->aOrganism !== null && $this->organism_id !== $this->aOrganism->getOrganismId()) {
 824:             $this->aOrganism = null;
 825:         }
 826:         if ($this->aCvterm !== null && $this->type_id !== $this->aCvterm->getCvtermId()) {
 827:             $this->aCvterm = null;
 828:         }
 829:     } // ensureConsistency
 830: 
 831:     /**
 832:      * Reloads this object from datastore based on primary key and (optionally) resets all associated objects.
 833:      *
 834:      * This will only work if the object has been saved and has a valid primary key set.
 835:      *
 836:      * @param boolean $deep (optional) Whether to also de-associated any related objects.
 837:      * @param PropelPDO $con (optional) The PropelPDO connection to use.
 838:      * @return void
 839:      * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db
 840:      */
 841:     public function reload($deep = false, PropelPDO $con = null)
 842:     {
 843:         if ($this->isDeleted()) {
 844:             throw new PropelException("Cannot reload a deleted object.");
 845:         }
 846: 
 847:         if ($this->isNew()) {
 848:             throw new PropelException("Cannot reload an unsaved object.");
 849:         }
 850: 
 851:         if ($con === null) {
 852:             $con = Propel::getConnection(FeaturePeer::DATABASE_NAME, Propel::CONNECTION_READ);
 853:         }
 854: 
 855:         // We don't need to alter the object instance pool; we're just modifying this instance
 856:         // already in the pool.
 857: 
 858:         $stmt = FeaturePeer::doSelectStmt($this->buildPkeyCriteria(), $con);
 859:         $row = $stmt->fetch(PDO::FETCH_NUM);
 860:         $stmt->closeCursor();
 861:         if (!$row) {
 862:             throw new PropelException('Cannot find matching row in the database to reload object values.');
 863:         }
 864:         $this->hydrate($row, 0, true); // rehydrate
 865: 
 866:         if ($deep) {  // also de-associate any related objects?
 867: 
 868:             $this->aDbxref = null;
 869:             $this->aOrganism = null;
 870:             $this->aCvterm = null;
 871:             $this->collFeatureCvterms = null;
 872: 
 873:             $this->collFeatureDbxrefs = null;
 874: 
 875:             $this->collFeaturePubs = null;
 876: 
 877:             $this->collFeatureSynonyms = null;
 878: 
 879:         } // if (deep)
 880:     }
 881: 
 882:     /**
 883:      * Removes this object from datastore and sets delete attribute.
 884:      *
 885:      * @param PropelPDO $con
 886:      * @return void
 887:      * @throws PropelException
 888:      * @throws Exception
 889:      * @see        BaseObject::setDeleted()
 890:      * @see        BaseObject::isDeleted()
 891:      */
 892:     public function delete(PropelPDO $con = null)
 893:     {
 894:         if ($this->isDeleted()) {
 895:             throw new PropelException("This object has already been deleted.");
 896:         }
 897: 
 898:         if ($con === null) {
 899:             $con = Propel::getConnection(FeaturePeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
 900:         }
 901: 
 902:         $con->beginTransaction();
 903:         try {
 904:             $deleteQuery = FeatureQuery::create()
 905:                 ->filterByPrimaryKey($this->getPrimaryKey());
 906:             $ret = $this->preDelete($con);
 907:             if ($ret) {
 908:                 $deleteQuery->delete($con);
 909:                 $this->postDelete($con);
 910:                 $con->commit();
 911:                 $this->setDeleted(true);
 912:             } else {
 913:                 $con->commit();
 914:             }
 915:         } catch (Exception $e) {
 916:             $con->rollBack();
 917:             throw $e;
 918:         }
 919:     }
 920: 
 921:     /**
 922:      * Persists this object to the database.
 923:      *
 924:      * If the object is new, it inserts it; otherwise an update is performed.
 925:      * All modified related objects will also be persisted in the doSave()
 926:      * method.  This method wraps all precipitate database operations in a
 927:      * single transaction.
 928:      *
 929:      * @param PropelPDO $con
 930:      * @return int             The number of rows affected by this insert/update and any referring fk objects' save() operations.
 931:      * @throws PropelException
 932:      * @throws Exception
 933:      * @see        doSave()
 934:      */
 935:     public function save(PropelPDO $con = null)
 936:     {
 937:         if ($this->isDeleted()) {
 938:             throw new PropelException("You cannot save an object that has been deleted.");
 939:         }
 940: 
 941:         if ($con === null) {
 942:             $con = Propel::getConnection(FeaturePeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
 943:         }
 944: 
 945:         $con->beginTransaction();
 946:         $isInsert = $this->isNew();
 947:         try {
 948:             $ret = $this->preSave($con);
 949:             if ($isInsert) {
 950:                 $ret = $ret && $this->preInsert($con);
 951:             } else {
 952:                 $ret = $ret && $this->preUpdate($con);
 953:             }
 954:             if ($ret) {
 955:                 $affectedRows = $this->doSave($con);
 956:                 if ($isInsert) {
 957:                     $this->postInsert($con);
 958:                 } else {
 959:                     $this->postUpdate($con);
 960:                 }
 961:                 $this->postSave($con);
 962:                 FeaturePeer::addInstanceToPool($this);
 963:             } else {
 964:                 $affectedRows = 0;
 965:             }
 966:             $con->commit();
 967: 
 968:             return $affectedRows;
 969:         } catch (Exception $e) {
 970:             $con->rollBack();
 971:             throw $e;
 972:         }
 973:     }
 974: 
 975:     /**
 976:      * Performs the work of inserting or updating the row in the database.
 977:      *
 978:      * If the object is new, it inserts it; otherwise an update is performed.
 979:      * All related objects are also updated in this method.
 980:      *
 981:      * @param PropelPDO $con
 982:      * @return int             The number of rows affected by this insert/update and any referring fk objects' save() operations.
 983:      * @throws PropelException
 984:      * @see        save()
 985:      */
 986:     protected function doSave(PropelPDO $con)
 987:     {
 988:         $affectedRows = 0; // initialize var to track total num of affected rows
 989:         if (!$this->alreadyInSave) {
 990:             $this->alreadyInSave = true;
 991: 
 992:             // We call the save method on the following object(s) if they
 993:             // were passed to this object by their coresponding set
 994:             // method.  This object relates to these object(s) by a
 995:             // foreign key reference.
 996: 
 997:             if ($this->aDbxref !== null) {
 998:                 if ($this->aDbxref->isModified() || $this->aDbxref->isNew()) {
 999:                     $affectedRows += $this->aDbxref->save($con);
1000:                 }
1001:                 $this->setDbxref($this->aDbxref);
1002:             }
1003: 
1004:             if ($this->aOrganism !== null) {
1005:                 if ($this->aOrganism->isModified() || $this->aOrganism->isNew()) {
1006:                     $affectedRows += $this->aOrganism->save($con);
1007:                 }
1008:                 $this->setOrganism($this->aOrganism);
1009:             }
1010: 
1011:             if ($this->aCvterm !== null) {
1012:                 if ($this->aCvterm->isModified() || $this->aCvterm->isNew()) {
1013:                     $affectedRows += $this->aCvterm->save($con);
1014:                 }
1015:                 $this->setCvterm($this->aCvterm);
1016:             }
1017: 
1018:             if ($this->isNew() || $this->isModified()) {
1019:                 // persist changes
1020:                 if ($this->isNew()) {
1021:                     $this->doInsert($con);
1022:                 } else {
1023:                     $this->doUpdate($con);
1024:                 }
1025:                 $affectedRows += 1;
1026:                 $this->resetModified();
1027:             }
1028: 
1029:             if ($this->featureCvtermsScheduledForDeletion !== null) {
1030:                 if (!$this->featureCvtermsScheduledForDeletion->isEmpty()) {
1031:                     FeatureCvtermQuery::create()
1032:                         ->filterByPrimaryKeys($this->featureCvtermsScheduledForDeletion->getPrimaryKeys(false))
1033:                         ->delete($con);
1034:                     $this->featureCvtermsScheduledForDeletion = null;
1035:                 }
1036:             }
1037: 
1038:             if ($this->collFeatureCvterms !== null) {
1039:                 foreach ($this->collFeatureCvterms as $referrerFK) {
1040:                     if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
1041:                         $affectedRows += $referrerFK->save($con);
1042:                     }
1043:                 }
1044:             }
1045: 
1046:             if ($this->featureDbxrefsScheduledForDeletion !== null) {
1047:                 if (!$this->featureDbxrefsScheduledForDeletion->isEmpty()) {
1048:                     FeatureDbxrefQuery::create()
1049:                         ->filterByPrimaryKeys($this->featureDbxrefsScheduledForDeletion->getPrimaryKeys(false))
1050:                         ->delete($con);
1051:                     $this->featureDbxrefsScheduledForDeletion = null;
1052:                 }
1053:             }
1054: 
1055:             if ($this->collFeatureDbxrefs !== null) {
1056:                 foreach ($this->collFeatureDbxrefs as $referrerFK) {
1057:                     if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
1058:                         $affectedRows += $referrerFK->save($con);
1059:                     }
1060:                 }
1061:             }
1062: 
1063:             if ($this->featurePubsScheduledForDeletion !== null) {
1064:                 if (!$this->featurePubsScheduledForDeletion->isEmpty()) {
1065:                     FeaturePubQuery::create()
1066:                         ->filterByPrimaryKeys($this->featurePubsScheduledForDeletion->getPrimaryKeys(false))
1067:                         ->delete($con);
1068:                     $this->featurePubsScheduledForDeletion = null;
1069:                 }
1070:             }
1071: 
1072:             if ($this->collFeaturePubs !== null) {
1073:                 foreach ($this->collFeaturePubs as $referrerFK) {
1074:                     if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
1075:                         $affectedRows += $referrerFK->save($con);
1076:                     }
1077:                 }
1078:             }
1079: 
1080:             if ($this->featureSynonymsScheduledForDeletion !== null) {
1081:                 if (!$this->featureSynonymsScheduledForDeletion->isEmpty()) {
1082:                     FeatureSynonymQuery::create()
1083:                         ->filterByPrimaryKeys($this->featureSynonymsScheduledForDeletion->getPrimaryKeys(false))
1084:                         ->delete($con);
1085:                     $this->featureSynonymsScheduledForDeletion = null;
1086:                 }
1087:             }
1088: 
1089:             if ($this->collFeatureSynonyms !== null) {
1090:                 foreach ($this->collFeatureSynonyms as $referrerFK) {
1091:                     if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
1092:                         $affectedRows += $referrerFK->save($con);
1093:                     }
1094:                 }
1095:             }
1096: 
1097:             $this->alreadyInSave = false;
1098: 
1099:         }
1100: 
1101:         return $affectedRows;
1102:     } // doSave()
1103: 
1104:     /**
1105:      * Insert the row in the database.
1106:      *
1107:      * @param PropelPDO $con
1108:      *
1109:      * @throws PropelException
1110:      * @see        doSave()
1111:      */
1112:     protected function doInsert(PropelPDO $con)
1113:     {
1114:         $modifiedColumns = array();
1115:         $index = 0;
1116: 
1117:         $this->modifiedColumns[] = FeaturePeer::FEATURE_ID;
1118:         if (null !== $this->feature_id) {
1119:             throw new PropelException('Cannot insert a value for auto-increment primary key (' . FeaturePeer::FEATURE_ID . ')');
1120:         }
1121:         if (null === $this->feature_id) {
1122:             try {
1123:                 $stmt = $con->query("SELECT nextval('feature_feature_id_seq')");
1124:                 $row = $stmt->fetch(PDO::FETCH_NUM);
1125:                 $this->feature_id = $row[0];
1126:             } catch (Exception $e) {
1127:                 throw new PropelException('Unable to get sequence id.', $e);
1128:             }
1129:         }
1130: 
1131: 
1132:          // check the columns in natural order for more readable SQL queries
1133:         if ($this->isColumnModified(FeaturePeer::FEATURE_ID)) {
1134:             $modifiedColumns[':p' . $index++]  = '"feature_id"';
1135:         }
1136:         if ($this->isColumnModified(FeaturePeer::DBXREF_ID)) {
1137:             $modifiedColumns[':p' . $index++]  = '"dbxref_id"';
1138:         }
1139:         if ($this->isColumnModified(FeaturePeer::ORGANISM_ID)) {
1140:             $modifiedColumns[':p' . $index++]  = '"organism_id"';
1141:         }
1142:         if ($this->isColumnModified(FeaturePeer::NAME)) {
1143:             $modifiedColumns[':p' . $index++]  = '"name"';
1144:         }
1145:         if ($this->isColumnModified(FeaturePeer::UNIQUENAME)) {
1146:             $modifiedColumns[':p' . $index++]  = '"uniquename"';
1147:         }
1148:         if ($this->isColumnModified(FeaturePeer::RESIDUES)) {
1149:             $modifiedColumns[':p' . $index++]  = '"residues"';
1150:         }
1151:         if ($this->isColumnModified(FeaturePeer::SEQLEN)) {
1152:             $modifiedColumns[':p' . $index++]  = '"seqlen"';
1153:         }
1154:         if ($this->isColumnModified(FeaturePeer::MD5CHECKSUM)) {
1155:             $modifiedColumns[':p' . $index++]  = '"md5checksum"';
1156:         }
1157:         if ($this->isColumnModified(FeaturePeer::TYPE_ID)) {
1158:             $modifiedColumns[':p' . $index++]  = '"type_id"';
1159:         }
1160:         if ($this->isColumnModified(FeaturePeer::IS_ANALYSIS)) {
1161:             $modifiedColumns[':p' . $index++]  = '"is_analysis"';
1162:         }
1163:         if ($this->isColumnModified(FeaturePeer::IS_OBSOLETE)) {
1164:             $modifiedColumns[':p' . $index++]  = '"is_obsolete"';
1165:         }
1166:         if ($this->isColumnModified(FeaturePeer::TIMEACCESSIONED)) {
1167:             $modifiedColumns[':p' . $index++]  = '"timeaccessioned"';
1168:         }
1169:         if ($this->isColumnModified(FeaturePeer::TIMELASTMODIFIED)) {
1170:             $modifiedColumns[':p' . $index++]  = '"timelastmodified"';
1171:         }
1172: 
1173:         $sql = sprintf(
1174:             'INSERT INTO "feature" (%s) VALUES (%s)',
1175:             implode(', ', $modifiedColumns),
1176:             implode(', ', array_keys($modifiedColumns))
1177:         );
1178: 
1179:         try {
1180:             $stmt = $con->prepare($sql);
1181:             foreach ($modifiedColumns as $identifier => $columnName) {
1182:                 switch ($columnName) {
1183:                     case '"feature_id"':
1184:                         $stmt->bindValue($identifier, $this->feature_id, PDO::PARAM_INT);
1185:                         break;
1186:                     case '"dbxref_id"':
1187:                         $stmt->bindValue($identifier, $this->dbxref_id, PDO::PARAM_INT);
1188:                         break;
1189:                     case '"organism_id"':
1190:                         $stmt->bindValue($identifier, $this->organism_id, PDO::PARAM_INT);
1191:                         break;
1192:                     case '"name"':
1193:                         $stmt->bindValue($identifier, $this->name, PDO::PARAM_STR);
1194:                         break;
1195:                     case '"uniquename"':
1196:                         $stmt->bindValue($identifier, $this->uniquename, PDO::PARAM_STR);
1197:                         break;
1198:                     case '"residues"':
1199:                         $stmt->bindValue($identifier, $this->residues, PDO::PARAM_STR);
1200:                         break;
1201:                     case '"seqlen"':
1202:                         $stmt->bindValue($identifier, $this->seqlen, PDO::PARAM_INT);
1203:                         break;
1204:                     case '"md5checksum"':
1205:                         $stmt->bindValue($identifier, $this->md5checksum, PDO::PARAM_STR);
1206:                         break;
1207:                     case '"type_id"':
1208:                         $stmt->bindValue($identifier, $this->type_id, PDO::PARAM_INT);
1209:                         break;
1210:                     case '"is_analysis"':
1211:                         $stmt->bindValue($identifier, $this->is_analysis, PDO::PARAM_BOOL);
1212:                         break;
1213:                     case '"is_obsolete"':
1214:                         $stmt->bindValue($identifier, $this->is_obsolete, PDO::PARAM_BOOL);
1215:                         break;
1216:                     case '"timeaccessioned"':
1217:                         $stmt->bindValue($identifier, $this->timeaccessioned, PDO::PARAM_STR);
1218:                         break;
1219:                     case '"timelastmodified"':
1220:                         $stmt->bindValue($identifier, $this->timelastmodified, PDO::PARAM_STR);
1221:                         break;
1222:                 }
1223:             }
1224:             $stmt->execute();
1225:         } catch (Exception $e) {
1226:             Propel::log($e->getMessage(), Propel::LOG_ERR);
1227:             throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), $e);
1228:         }
1229: 
1230:         $this->setNew(false);
1231:     }
1232: 
1233:     /**
1234:      * Update the row in the database.
1235:      *
1236:      * @param PropelPDO $con
1237:      *
1238:      * @see        doSave()
1239:      */
1240:     protected function doUpdate(PropelPDO $con)
1241:     {
1242:         $selectCriteria = $this->buildPkeyCriteria();
1243:         $valuesCriteria = $this->buildCriteria();
1244:         BasePeer::doUpdate($selectCriteria, $valuesCriteria, $con);
1245:     }
1246: 
1247:     /**
1248:      * Array of ValidationFailed objects.
1249:      * @var        array ValidationFailed[]
1250:      */
1251:     protected $validationFailures = array();
1252: 
1253:     /**
1254:      * Gets any ValidationFailed objects that resulted from last call to validate().
1255:      *
1256:      *
1257:      * @return array ValidationFailed[]
1258:      * @see        validate()
1259:      */
1260:     public function getValidationFailures()
1261:     {
1262:         return $this->validationFailures;
1263:     }
1264: 
1265:     /**
1266:      * Validates the objects modified field values and all objects related to this table.
1267:      *
1268:      * If $columns is either a column name or an array of column names
1269:      * only those columns are validated.
1270:      *
1271:      * @param mixed $columns Column name or an array of column names.
1272:      * @return boolean Whether all columns pass validation.
1273:      * @see        doValidate()
1274:      * @see        getValidationFailures()
1275:      */
1276:     public function validate($columns = null)
1277:     {
1278:         $res = $this->doValidate($columns);
1279:         if ($res === true) {
1280:             $this->validationFailures = array();
1281: 
1282:             return true;
1283:         }
1284: 
1285:         $this->validationFailures = $res;
1286: 
1287:         return false;
1288:     }
1289: 
1290:     /**
1291:      * This function performs the validation work for complex object models.
1292:      *
1293:      * In addition to checking the current object, all related objects will
1294:      * also be validated.  If all pass then <code>true</code> is returned; otherwise
1295:      * an aggreagated array of ValidationFailed objects will be returned.
1296:      *
1297:      * @param array $columns Array of column names to validate.
1298:      * @return mixed <code>true</code> if all validations pass; array of <code>ValidationFailed</code> objets otherwise.
1299:      */
1300:     protected function doValidate($columns = null)
1301:     {
1302:         if (!$this->alreadyInValidation) {
1303:             $this->alreadyInValidation = true;
1304:             $retval = null;
1305: 
1306:             $failureMap = array();
1307: 
1308: 
1309:             // We call the validate method on the following object(s) if they
1310:             // were passed to this object by their coresponding set
1311:             // method.  This object relates to these object(s) by a
1312:             // foreign key reference.
1313: 
1314:             if ($this->aDbxref !== null) {
1315:                 if (!$this->aDbxref->validate($columns)) {
1316:                     $failureMap = array_merge($failureMap, $this->aDbxref->getValidationFailures());
1317:                 }
1318:             }
1319: 
1320:             if ($this->aOrganism !== null) {
1321:                 if (!$this->aOrganism->validate($columns)) {
1322:                     $failureMap = array_merge($failureMap, $this->aOrganism->getValidationFailures());
1323:                 }
1324:             }
1325: 
1326:             if ($this->aCvterm !== null) {
1327:                 if (!$this->aCvterm->validate($columns)) {
1328:                     $failureMap = array_merge($failureMap, $this->aCvterm->getValidationFailures());
1329:                 }
1330:             }
1331: 
1332: 
1333:             if (($retval = FeaturePeer::doValidate($this, $columns)) !== true) {
1334:                 $failureMap = array_merge($failureMap, $retval);
1335:             }
1336: 
1337: 
1338:                 if ($this->collFeatureCvterms !== null) {
1339:                     foreach ($this->collFeatureCvterms as $referrerFK) {
1340:                         if (!$referrerFK->validate($columns)) {
1341:                             $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
1342:                         }
1343:                     }
1344:                 }
1345: 
1346:                 if ($this->collFeatureDbxrefs !== null) {
1347:                     foreach ($this->collFeatureDbxrefs as $referrerFK) {
1348:                         if (!$referrerFK->validate($columns)) {
1349:                             $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
1350:                         }
1351:                     }
1352:                 }
1353: 
1354:                 if ($this->collFeaturePubs !== null) {
1355:                     foreach ($this->collFeaturePubs as $referrerFK) {
1356:                         if (!$referrerFK->validate($columns)) {
1357:                             $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
1358:                         }
1359:                     }
1360:                 }
1361: 
1362:                 if ($this->collFeatureSynonyms !== null) {
1363:                     foreach ($this->collFeatureSynonyms as $referrerFK) {
1364:                         if (!$referrerFK->validate($columns)) {
1365:                             $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
1366:                         }
1367:                     }
1368:                 }
1369: 
1370: 
1371:             $this->alreadyInValidation = false;
1372:         }
1373: 
1374:         return (!empty($failureMap) ? $failureMap : true);
1375:     }
1376: 
1377:     /**
1378:      * Retrieves a field from the object by name passed in as a string.
1379:      *
1380:      * @param string $name name
1381:      * @param string $type The type of fieldname the $name is of:
1382:      *               one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
1383:      *               BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
1384:      *               Defaults to BasePeer::TYPE_PHPNAME
1385:      * @return mixed Value of field.
1386:      */
1387:     public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
1388:     {
1389:         $pos = FeaturePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
1390:         $field = $this->getByPosition($pos);
1391: 
1392:         return $field;
1393:     }
1394: 
1395:     /**
1396:      * Retrieves a field from the object by Position as specified in the xml schema.
1397:      * Zero-based.
1398:      *
1399:      * @param int $pos position in xml schema
1400:      * @return mixed Value of field at $pos
1401:      */
1402:     public function getByPosition($pos)
1403:     {
1404:         switch ($pos) {
1405:             case 0:
1406:                 return $this->getFeatureId();
1407:                 break;
1408:             case 1:
1409:                 return $this->getDbxrefId();
1410:                 break;
1411:             case 2:
1412:                 return $this->getOrganismId();
1413:                 break;
1414:             case 3:
1415:                 return $this->getName();
1416:                 break;
1417:             case 4:
1418:                 return $this->getUniquename();
1419:                 break;
1420:             case 5:
1421:                 return $this->getResidues();
1422:                 break;
1423:             case 6:
1424:                 return $this->getSeqlen();
1425:                 break;
1426:             case 7:
1427:                 return $this->getMd5checksum();
1428:                 break;
1429:             case 8:
1430:                 return $this->getTypeId();
1431:                 break;
1432:             case 9:
1433:                 return $this->getIsAnalysis();
1434:                 break;
1435:             case 10:
1436:                 return $this->getIsObsolete();
1437:                 break;
1438:             case 11:
1439:                 return $this->getTimeaccessioned();
1440:                 break;
1441:             case 12:
1442:                 return $this->getTimelastmodified();
1443:                 break;
1444:             default:
1445:                 return null;
1446:                 break;
1447:         } // switch()
1448:     }
1449: 
1450:     /**
1451:      * Exports the object as an array.
1452:      *
1453:      * You can specify the key type of the array by passing one of the class
1454:      * type constants.
1455:      *
1456:      * @param     string  $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME,
1457:      *                    BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
1458:      *                    Defaults to BasePeer::TYPE_PHPNAME.
1459:      * @param     boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to true.
1460:      * @param     array $alreadyDumpedObjects List of objects to skip to avoid recursion
1461:      * @param     boolean $includeForeignObjects (optional) Whether to include hydrated related objects. Default to FALSE.
1462:      *
1463:      * @return array an associative array containing the field names (as keys) and field values
1464:      */
1465:     public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
1466:     {
1467:         if (isset($alreadyDumpedObjects['Feature'][$this->getPrimaryKey()])) {
1468:             return '*RECURSION*';
1469:         }
1470:         $alreadyDumpedObjects['Feature'][$this->getPrimaryKey()] = true;
1471:         $keys = FeaturePeer::getFieldNames($keyType);
1472:         $result = array(
1473:             $keys[0] => $this->getFeatureId(),
1474:             $keys[1] => $this->getDbxrefId(),
1475:             $keys[2] => $this->getOrganismId(),
1476:             $keys[3] => $this->getName(),
1477:             $keys[4] => $this->getUniquename(),
1478:             $keys[5] => $this->getResidues(),
1479:             $keys[6] => $this->getSeqlen(),
1480:             $keys[7] => $this->getMd5checksum(),
1481:             $keys[8] => $this->getTypeId(),
1482:             $keys[9] => $this->getIsAnalysis(),
1483:             $keys[10] => $this->getIsObsolete(),
1484:             $keys[11] => $this->getTimeaccessioned(),
1485:             $keys[12] => $this->getTimelastmodified(),
1486:         );
1487:         if ($includeForeignObjects) {
1488:             if (null !== $this->aDbxref) {
1489:                 $result['Dbxref'] = $this->aDbxref->toArray($keyType, $includeLazyLoadColumns,  $alreadyDumpedObjects, true);
1490:             }
1491:             if (null !== $this->aOrganism) {
1492:                 $result['Organism'] = $this->aOrganism->toArray($keyType, $includeLazyLoadColumns,  $alreadyDumpedObjects, true);
1493:             }
1494:             if (null !== $this->aCvterm) {
1495:                 $result['Cvterm'] = $this->aCvterm->toArray($keyType, $includeLazyLoadColumns,  $alreadyDumpedObjects, true);
1496:             }
1497:             if (null !== $this->collFeatureCvterms) {
1498:                 $result['FeatureCvterms'] = $this->collFeatureCvterms->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
1499:             }
1500:             if (null !== $this->collFeatureDbxrefs) {
1501:                 $result['FeatureDbxrefs'] = $this->collFeatureDbxrefs->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
1502:             }
1503:             if (null !== $this->collFeaturePubs) {
1504:                 $result['FeaturePubs'] = $this->collFeaturePubs->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
1505:             }
1506:             if (null !== $this->collFeatureSynonyms) {
1507:                 $result['FeatureSynonyms'] = $this->collFeatureSynonyms->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
1508:             }
1509:         }
1510: 
1511:         return $result;
1512:     }
1513: 
1514:     /**
1515:      * Sets a field from the object by name passed in as a string.
1516:      *
1517:      * @param string $name peer name
1518:      * @param mixed $value field value
1519:      * @param string $type The type of fieldname the $name is of:
1520:      *                     one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
1521:      *                     BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
1522:      *                     Defaults to BasePeer::TYPE_PHPNAME
1523:      * @return void
1524:      */
1525:     public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
1526:     {
1527:         $pos = FeaturePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
1528: 
1529:         $this->setByPosition($pos, $value);
1530:     }
1531: 
1532:     /**
1533:      * Sets a field from the object by Position as specified in the xml schema.
1534:      * Zero-based.
1535:      *
1536:      * @param int $pos position in xml schema
1537:      * @param mixed $value field value
1538:      * @return void
1539:      */
1540:     public function setByPosition($pos, $value)
1541:     {
1542:         switch ($pos) {
1543:             case 0:
1544:                 $this->setFeatureId($value);
1545:                 break;
1546:             case 1:
1547:                 $this->setDbxrefId($value);
1548:                 break;
1549:             case 2:
1550:                 $this->setOrganismId($value);
1551:                 break;
1552:             case 3:
1553:                 $this->setName($value);
1554:                 break;
1555:             case 4:
1556:                 $this->setUniquename($value);
1557:                 break;
1558:             case 5:
1559:                 $this->setResidues($value);
1560:                 break;
1561:             case 6:
1562:                 $this->setSeqlen($value);
1563:                 break;
1564:             case 7:
1565:                 $this->setMd5checksum($value);
1566:                 break;
1567:             case 8:
1568:                 $this->setTypeId($value);
1569:                 break;
1570:             case 9:
1571:                 $this->setIsAnalysis($value);
1572:                 break;
1573:             case 10:
1574:                 $this->setIsObsolete($value);
1575:                 break;
1576:             case 11:
1577:                 $this->setTimeaccessioned($value);
1578:                 break;
1579:             case 12:
1580:                 $this->setTimelastmodified($value);
1581:                 break;
1582:         } // switch()
1583:     }
1584: 
1585:     /**
1586:      * Populates the object using an array.
1587:      *
1588:      * This is particularly useful when populating an object from one of the
1589:      * request arrays (e.g. $_POST).  This method goes through the column
1590:      * names, checking to see whether a matching key exists in populated
1591:      * array. If so the setByName() method is called for that column.
1592:      *
1593:      * You can specify the key type of the array by additionally passing one
1594:      * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME,
1595:      * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
1596:      * The default key type is the column's BasePeer::TYPE_PHPNAME
1597:      *
1598:      * @param array  $arr     An array to populate the object from.
1599:      * @param string $keyType The type of keys the array uses.
1600:      * @return void
1601:      */
1602:     public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
1603:     {
1604:         $keys = FeaturePeer::getFieldNames($keyType);
1605: 
1606:         if (array_key_exists($keys[0], $arr)) $this->setFeatureId($arr[$keys[0]]);
1607:         if (array_key_exists($keys[1], $arr)) $this->setDbxrefId($arr[$keys[1]]);
1608:         if (array_key_exists($keys[2], $arr)) $this->setOrganismId($arr[$keys[2]]);
1609:         if (array_key_exists($keys[3], $arr)) $this->setName($arr[$keys[3]]);
1610:         if (array_key_exists($keys[4], $arr)) $this->setUniquename($arr[$keys[4]]);
1611:         if (array_key_exists($keys[5], $arr)) $this->setResidues($arr[$keys[5]]);
1612:         if (array_key_exists($keys[6], $arr)) $this->setSeqlen($arr[$keys[6]]);
1613:         if (array_key_exists($keys[7], $arr)) $this->setMd5checksum($arr[$keys[7]]);
1614:         if (array_key_exists($keys[8], $arr)) $this->setTypeId($arr[$keys[8]]);
1615:         if (array_key_exists($keys[9], $arr)) $this->setIsAnalysis($arr[$keys[9]]);
1616:         if (array_key_exists($keys[10], $arr)) $this->setIsObsolete($arr[$keys[10]]);
1617:         if (array_key_exists($keys[11], $arr)) $this->setTimeaccessioned($arr[$keys[11]]);
1618:         if (array_key_exists($keys[12], $arr)) $this->setTimelastmodified($arr[$keys[12]]);
1619:     }
1620: 
1621:     /**
1622:      * Build a Criteria object containing the values of all modified columns in this object.
1623:      *
1624:      * @return Criteria The Criteria object containing all modified values.
1625:      */
1626:     public function buildCriteria()
1627:     {
1628:         $criteria = new Criteria(FeaturePeer::DATABASE_NAME);
1629: 
1630:         if ($this->isColumnModified(FeaturePeer::FEATURE_ID)) $criteria->add(FeaturePeer::FEATURE_ID, $this->feature_id);
1631:         if ($this->isColumnModified(FeaturePeer::DBXREF_ID)) $criteria->add(FeaturePeer::DBXREF_ID, $this->dbxref_id);
1632:         if ($this->isColumnModified(FeaturePeer::ORGANISM_ID)) $criteria->add(FeaturePeer::ORGANISM_ID, $this->organism_id);
1633:         if ($this->isColumnModified(FeaturePeer::NAME)) $criteria->add(FeaturePeer::NAME, $this->name);
1634:         if ($this->isColumnModified(FeaturePeer::UNIQUENAME)) $criteria->add(FeaturePeer::UNIQUENAME, $this->uniquename);
1635:         if ($this->isColumnModified(FeaturePeer::RESIDUES)) $criteria->add(FeaturePeer::RESIDUES, $this->residues);
1636:         if ($this->isColumnModified(FeaturePeer::SEQLEN)) $criteria->add(FeaturePeer::SEQLEN, $this->seqlen);
1637:         if ($this->isColumnModified(FeaturePeer::MD5CHECKSUM)) $criteria->add(FeaturePeer::MD5CHECKSUM, $this->md5checksum);
1638:         if ($this->isColumnModified(FeaturePeer::TYPE_ID)) $criteria->add(FeaturePeer::TYPE_ID, $this->type_id);
1639:         if ($this->isColumnModified(FeaturePeer::IS_ANALYSIS)) $criteria->add(FeaturePeer::IS_ANALYSIS, $this->is_analysis);
1640:         if ($this->isColumnModified(FeaturePeer::IS_OBSOLETE)) $criteria->add(FeaturePeer::IS_OBSOLETE, $this->is_obsolete);
1641:         if ($this->isColumnModified(FeaturePeer::TIMEACCESSIONED)) $criteria->add(FeaturePeer::TIMEACCESSIONED, $this->timeaccessioned);
1642:         if ($this->isColumnModified(FeaturePeer::TIMELASTMODIFIED)) $criteria->add(FeaturePeer::TIMELASTMODIFIED, $this->timelastmodified);
1643: 
1644:         return $criteria;
1645:     }
1646: 
1647:     /**
1648:      * Builds a Criteria object containing the primary key for this object.
1649:      *
1650:      * Unlike buildCriteria() this method includes the primary key values regardless
1651:      * of whether or not they have been modified.
1652:      *
1653:      * @return Criteria The Criteria object containing value(s) for primary key(s).
1654:      */
1655:     public function buildPkeyCriteria()
1656:     {
1657:         $criteria = new Criteria(FeaturePeer::DATABASE_NAME);
1658:         $criteria->add(FeaturePeer::FEATURE_ID, $this->feature_id);
1659: 
1660:         return $criteria;
1661:     }
1662: 
1663:     /**
1664:      * Returns the primary key for this object (row).
1665:      * @return int
1666:      */
1667:     public function getPrimaryKey()
1668:     {
1669:         return $this->getFeatureId();
1670:     }
1671: 
1672:     /**
1673:      * Generic method to set the primary key (feature_id column).
1674:      *
1675:      * @param  int $key Primary key.
1676:      * @return void
1677:      */
1678:     public function setPrimaryKey($key)
1679:     {
1680:         $this->setFeatureId($key);
1681:     }
1682: 
1683:     /**
1684:      * Returns true if the primary key for this object is null.
1685:      * @return boolean
1686:      */
1687:     public function isPrimaryKeyNull()
1688:     {
1689: 
1690:         return null === $this->getFeatureId();
1691:     }
1692: 
1693:     /**
1694:      * Sets contents of passed object to values from current object.
1695:      *
1696:      * If desired, this method can also make copies of all associated (fkey referrers)
1697:      * objects.
1698:      *
1699:      * @param object $copyObj An object of Feature (or compatible) type.
1700:      * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
1701:      * @param boolean $makeNew Whether to reset autoincrement PKs and make the object new.
1702:      * @throws PropelException
1703:      */
1704:     public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
1705:     {
1706:         $copyObj->setDbxrefId($this->getDbxrefId());
1707:         $copyObj->setOrganismId($this->getOrganismId());
1708:         $copyObj->setName($this->getName());
1709:         $copyObj->setUniquename($this->getUniquename());
1710:         $copyObj->setResidues($this->getResidues());
1711:         $copyObj->setSeqlen($this->getSeqlen());
1712:         $copyObj->setMd5checksum($this->getMd5checksum());
1713:         $copyObj->setTypeId($this->getTypeId());
1714:         $copyObj->setIsAnalysis($this->getIsAnalysis());
1715:         $copyObj->setIsObsolete($this->getIsObsolete());
1716:         $copyObj->setTimeaccessioned($this->getTimeaccessioned());
1717:         $copyObj->setTimelastmodified($this->getTimelastmodified());
1718: 
1719:         if ($deepCopy && !$this->startCopy) {
1720:             // important: temporarily setNew(false) because this affects the behavior of
1721:             // the getter/setter methods for fkey referrer objects.
1722:             $copyObj->setNew(false);
1723:             // store object hash to prevent cycle
1724:             $this->startCopy = true;
1725: 
1726:             foreach ($this->getFeatureCvterms() as $relObj) {
1727:                 if ($relObj !== $this) {  // ensure that we don't try to copy a reference to ourselves
1728:                     $copyObj->addFeatureCvterm($relObj->copy($deepCopy));
1729:                 }
1730:             }
1731: 
1732:             foreach ($this->getFeatureDbxrefs() as $relObj) {
1733:                 if ($relObj !== $this) {  // ensure that we don't try to copy a reference to ourselves
1734:                     $copyObj->addFeatureDbxref($relObj->copy($deepCopy));
1735:                 }
1736:             }
1737: 
1738:             foreach ($this->getFeaturePubs() as $relObj) {
1739:                 if ($relObj !== $this) {  // ensure that we don't try to copy a reference to ourselves
1740:                     $copyObj->addFeaturePub($relObj->copy($deepCopy));
1741:                 }
1742:             }
1743: 
1744:             foreach ($this->getFeatureSynonyms() as $relObj) {
1745:                 if ($relObj !== $this) {  // ensure that we don't try to copy a reference to ourselves
1746:                     $copyObj->addFeatureSynonym($relObj->copy($deepCopy));
1747:                 }
1748:             }
1749: 
1750:             //unflag object copy
1751:             $this->startCopy = false;
1752:         } // if ($deepCopy)
1753: 
1754:         if ($makeNew) {
1755:             $copyObj->setNew(true);
1756:             $copyObj->setFeatureId(NULL); // this is a auto-increment column, so set to default value
1757:         }
1758:     }
1759: 
1760:     /**
1761:      * Makes a copy of this object that will be inserted as a new row in table when saved.
1762:      * It creates a new object filling in the simple attributes, but skipping any primary
1763:      * keys that are defined for the table.
1764:      *
1765:      * If desired, this method can also make copies of all associated (fkey referrers)
1766:      * objects.
1767:      *
1768:      * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
1769:      * @return Feature Clone of current object.
1770:      * @throws PropelException
1771:      */
1772:     public function copy($deepCopy = false)
1773:     {
1774:         // we use get_class(), because this might be a subclass
1775:         $clazz = get_class($this);
1776:         $copyObj = new $clazz();
1777:         $this->copyInto($copyObj, $deepCopy);
1778: 
1779:         return $copyObj;
1780:     }
1781: 
1782:     /**
1783:      * Returns a peer instance associated with this om.
1784:      *
1785:      * Since Peer classes are not to have any instance attributes, this method returns the
1786:      * same instance for all member of this class. The method could therefore
1787:      * be static, but this would prevent one from overriding the behavior.
1788:      *
1789:      * @return FeaturePeer
1790:      */
1791:     public function getPeer()
1792:     {
1793:         if (self::$peer === null) {
1794:             self::$peer = new FeaturePeer();
1795:         }
1796: 
1797:         return self::$peer;
1798:     }
1799: 
1800:     /**
1801:      * Declares an association between this object and a Dbxref object.
1802:      *
1803:      * @param             Dbxref $v
1804:      * @return Feature The current object (for fluent API support)
1805:      * @throws PropelException
1806:      */
1807:     public function setDbxref(Dbxref $v = null)
1808:     {
1809:         if ($v === null) {
1810:             $this->setDbxrefId(NULL);
1811:         } else {
1812:             $this->setDbxrefId($v->getDbxrefId());
1813:         }
1814: 
1815:         $this->aDbxref = $v;
1816: 
1817:         // Add binding for other direction of this n:n relationship.
1818:         // If this object has already been added to the Dbxref object, it will not be re-added.
1819:         if ($v !== null) {
1820:             $v->addFeature($this);
1821:         }
1822: 
1823: 
1824:         return $this;
1825:     }
1826: 
1827: 
1828:     /**
1829:      * Get the associated Dbxref object
1830:      *
1831:      * @param PropelPDO $con Optional Connection object.
1832:      * @param $doQuery Executes a query to get the object if required
1833:      * @return Dbxref The associated Dbxref object.
1834:      * @throws PropelException
1835:      */
1836:     public function getDbxref(PropelPDO $con = null, $doQuery = true)
1837:     {
1838:         if ($this->aDbxref === null && ($this->dbxref_id !== null) && $doQuery) {
1839:             $this->aDbxref = DbxrefQuery::create()->findPk($this->dbxref_id, $con);
1840:             /* The following can be used additionally to
1841:                 guarantee the related object contains a reference
1842:                 to this object.  This level of coupling may, however, be
1843:                 undesirable since it could result in an only partially populated collection
1844:                 in the referenced object.
1845:                 $this->aDbxref->addFeatures($this);
1846:              */
1847:         }
1848: 
1849:         return $this->aDbxref;
1850:     }
1851: 
1852:     /**
1853:      * Declares an association between this object and a Organism object.
1854:      *
1855:      * @param             Organism $v
1856:      * @return Feature The current object (for fluent API support)
1857:      * @throws PropelException
1858:      */
1859:     public function setOrganism(Organism $v = null)
1860:     {
1861:         if ($v === null) {
1862:             $this->setOrganismId(NULL);
1863:         } else {
1864:             $this->setOrganismId($v->getOrganismId());
1865:         }
1866: 
1867:         $this->aOrganism = $v;
1868: 
1869:         // Add binding for other direction of this n:n relationship.
1870:         // If this object has already been added to the Organism object, it will not be re-added.
1871:         if ($v !== null) {
1872:             $v->addFeature($this);
1873:         }
1874: 
1875: 
1876:         return $this;
1877:     }
1878: 
1879: 
1880:     /**
1881:      * Get the associated Organism object
1882:      *
1883:      * @param PropelPDO $con Optional Connection object.
1884:      * @param $doQuery Executes a query to get the object if required
1885:      * @return Organism The associated Organism object.
1886:      * @throws PropelException
1887:      */
1888:     public function getOrganism(PropelPDO $con = null, $doQuery = true)
1889:     {
1890:         if ($this->aOrganism === null && ($this->organism_id !== null) && $doQuery) {
1891:             $this->aOrganism = OrganismQuery::create()->findPk($this->organism_id, $con);
1892:             /* The following can be used additionally to
1893:                 guarantee the related object contains a reference
1894:                 to this object.  This level of coupling may, however, be
1895:                 undesirable since it could result in an only partially populated collection
1896:                 in the referenced object.
1897:                 $this->aOrganism->addFeatures($this);
1898:              */
1899:         }
1900: 
1901:         return $this->aOrganism;
1902:     }
1903: 
1904:     /**
1905:      * Declares an association between this object and a Cvterm object.
1906:      *
1907:      * @param             Cvterm $v
1908:      * @return Feature The current object (for fluent API support)
1909:      * @throws PropelException
1910:      */
1911:     public function setCvterm(Cvterm $v = null)
1912:     {
1913:         if ($v === null) {
1914:             $this->setTypeId(NULL);
1915:         } else {
1916:             $this->setTypeId($v->getCvtermId());
1917:         }
1918: 
1919:         $this->aCvterm = $v;
1920: 
1921:         // Add binding for other direction of this n:n relationship.
1922:         // If this object has already been added to the Cvterm object, it will not be re-added.
1923:         if ($v !== null) {
1924:             $v->addFeature($this);
1925:         }
1926: 
1927: 
1928:         return $this;
1929:     }
1930: 
1931: 
1932:     /**
1933:      * Get the associated Cvterm object
1934:      *
1935:      * @param PropelPDO $con Optional Connection object.
1936:      * @param $doQuery Executes a query to get the object if required
1937:      * @return Cvterm The associated Cvterm object.
1938:      * @throws PropelException
1939:      */
1940:     public function getCvterm(PropelPDO $con = null, $doQuery = true)
1941:     {
1942:         if ($this->aCvterm === null && ($this->type_id !== null) && $doQuery) {
1943:             $this->aCvterm = CvtermQuery::create()->findPk($this->type_id, $con);
1944:             /* The following can be used additionally to
1945:                 guarantee the related object contains a reference
1946:                 to this object.  This level of coupling may, however, be
1947:                 undesirable since it could result in an only partially populated collection
1948:                 in the referenced object.
1949:                 $this->aCvterm->addFeatures($this);
1950:              */
1951:         }
1952: 
1953:         return $this->aCvterm;
1954:     }
1955: 
1956: 
1957:     /**
1958:      * Initializes a collection based on the name of a relation.
1959:      * Avoids crafting an 'init[$relationName]s' method name
1960:      * that wouldn't work when StandardEnglishPluralizer is used.
1961:      *
1962:      * @param string $relationName The name of the relation to initialize
1963:      * @return void
1964:      */
1965:     public function initRelation($relationName)
1966:     {
1967:         if ('FeatureCvterm' == $relationName) {
1968:             $this->initFeatureCvterms();
1969:         }
1970:         if ('FeatureDbxref' == $relationName) {
1971:             $this->initFeatureDbxrefs();
1972:         }
1973:         if ('FeaturePub' == $relationName) {
1974:             $this->initFeaturePubs();
1975:         }
1976:         if ('FeatureSynonym' == $relationName) {
1977:             $this->initFeatureSynonyms();
1978:         }
1979:     }
1980: 
1981:     /**
1982:      * Clears out the collFeatureCvterms collection
1983:      *
1984:      * This does not modify the database; however, it will remove any associated objects, causing
1985:      * them to be refetched by subsequent calls to accessor method.
1986:      *
1987:      * @return Feature The current object (for fluent API support)
1988:      * @see        addFeatureCvterms()
1989:      */
1990:     public function clearFeatureCvterms()
1991:     {
1992:         $this->collFeatureCvterms = null; // important to set this to null since that means it is uninitialized
1993:         $this->collFeatureCvtermsPartial = null;
1994: 
1995:         return $this;
1996:     }
1997: 
1998:     /**
1999:      * reset is the collFeatureCvterms collection loaded partially
2000:      *
2001:      * @return void
2002:      */
2003:     public function resetPartialFeatureCvterms($v = true)
2004:     {
2005:         $this->collFeatureCvtermsPartial = $v;
2006:     }
2007: 
2008:     /**
2009:      * Initializes the collFeatureCvterms collection.
2010:      *
2011:      * By default this just sets the collFeatureCvterms collection to an empty array (like clearcollFeatureCvterms());
2012:      * however, you may wish to override this method in your stub class to provide setting appropriate
2013:      * to your application -- for example, setting the initial array to the values stored in database.
2014:      *
2015:      * @param boolean $overrideExisting If set to true, the method call initializes
2016:      *                                        the collection even if it is not empty
2017:      *
2018:      * @return void
2019:      */
2020:     public function initFeatureCvterms($overrideExisting = true)
2021:     {
2022:         if (null !== $this->collFeatureCvterms && !$overrideExisting) {
2023:             return;
2024:         }
2025:         $this->collFeatureCvterms = new PropelObjectCollection();
2026:         $this->collFeatureCvterms->setModel('FeatureCvterm');
2027:     }
2028: 
2029:     /**
2030:      * Gets an array of FeatureCvterm objects which contain a foreign key that references this object.
2031:      *
2032:      * If the $criteria is not null, it is used to always fetch the results from the database.
2033:      * Otherwise the results are fetched from the database the first time, then cached.
2034:      * Next time the same method is called without $criteria, the cached collection is returned.
2035:      * If this Feature is new, it will return
2036:      * an empty collection or the current collection; the criteria is ignored on a new object.
2037:      *
2038:      * @param Criteria $criteria optional Criteria object to narrow the query
2039:      * @param PropelPDO $con optional connection object
2040:      * @return PropelObjectCollection|FeatureCvterm[] List of FeatureCvterm objects
2041:      * @throws PropelException
2042:      */
2043:     public function getFeatureCvterms($criteria = null, PropelPDO $con = null)
2044:     {
2045:         $partial = $this->collFeatureCvtermsPartial && !$this->isNew();
2046:         if (null === $this->collFeatureCvterms || null !== $criteria  || $partial) {
2047:             if ($this->isNew() && null === $this->collFeatureCvterms) {
2048:                 // return empty collection
2049:                 $this->initFeatureCvterms();
2050:             } else {
2051:                 $collFeatureCvterms = FeatureCvtermQuery::create(null, $criteria)
2052:                     ->filterByFeature($this)
2053:                     ->find($con);
2054:                 if (null !== $criteria) {
2055:                     if (false !== $this->collFeatureCvtermsPartial && count($collFeatureCvterms)) {
2056:                       $this->initFeatureCvterms(false);
2057: 
2058:                       foreach($collFeatureCvterms as $obj) {
2059:                         if (false == $this->collFeatureCvterms->contains($obj)) {
2060:                           $this->collFeatureCvterms->append($obj);
2061:                         }
2062:                       }
2063: 
2064:                       $this->collFeatureCvtermsPartial = true;
2065:                     }
2066: 
2067:                     $collFeatureCvterms->getInternalIterator()->rewind();
2068:                     return $collFeatureCvterms;
2069:                 }
2070: 
2071:                 if($partial && $this->collFeatureCvterms) {
2072:                     foreach($this->collFeatureCvterms as $obj) {
2073:                         if($obj->isNew()) {
2074:                             $collFeatureCvterms[] = $obj;
2075:                         }
2076:                     }
2077:                 }
2078: 
2079:                 $this->collFeatureCvterms = $collFeatureCvterms;
2080:                 $this->collFeatureCvtermsPartial = false;
2081:             }
2082:         }
2083: 
2084:         return $this->collFeatureCvterms;
2085:     }
2086: 
2087:     /**
2088:      * Sets a collection of FeatureCvterm objects related by a one-to-many relationship
2089:      * to the current object.
2090:      * It will also schedule objects for deletion based on a diff between old objects (aka persisted)
2091:      * and new objects from the given Propel collection.
2092:      *
2093:      * @param PropelCollection $featureCvterms A Propel collection.
2094:      * @param PropelPDO $con Optional connection object
2095:      * @return Feature The current object (for fluent API support)
2096:      */
2097:     public function setFeatureCvterms(PropelCollection $featureCvterms, PropelPDO $con = null)
2098:     {
2099:         $featureCvtermsToDelete = $this->getFeatureCvterms(new Criteria(), $con)->diff($featureCvterms);
2100: 
2101:         $this->featureCvtermsScheduledForDeletion = unserialize(serialize($featureCvtermsToDelete));
2102: 
2103:         foreach ($featureCvtermsToDelete as $featureCvtermRemoved) {
2104:             $featureCvtermRemoved->setFeature(null);
2105:         }
2106: 
2107:         $this->collFeatureCvterms = null;
2108:         foreach ($featureCvterms as $featureCvterm) {
2109:             $this->addFeatureCvterm($featureCvterm);
2110:         }
2111: 
2112:         $this->collFeatureCvterms = $featureCvterms;
2113:         $this->collFeatureCvtermsPartial = false;
2114: 
2115:         return $this;
2116:     }
2117: 
2118:     /**
2119:      * Returns the number of related FeatureCvterm objects.
2120:      *
2121:      * @param Criteria $criteria
2122:      * @param boolean $distinct
2123:      * @param PropelPDO $con
2124:      * @return int             Count of related FeatureCvterm objects.
2125:      * @throws PropelException
2126:      */
2127:     public function countFeatureCvterms(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
2128:     {
2129:         $partial = $this->collFeatureCvtermsPartial && !$this->isNew();
2130:         if (null === $this->collFeatureCvterms || null !== $criteria || $partial) {
2131:             if ($this->isNew() && null === $this->collFeatureCvterms) {
2132:                 return 0;
2133:             }
2134: 
2135:             if($partial && !$criteria) {
2136:                 return count($this->getFeatureCvterms());
2137:             }
2138:             $query = FeatureCvtermQuery::create(null, $criteria);
2139:             if ($distinct) {
2140:                 $query->distinct();
2141:             }
2142: 
2143:             return $query
2144:                 ->filterByFeature($this)
2145:                 ->count($con);
2146:         }
2147: 
2148:         return count($this->collFeatureCvterms);
2149:     }
2150: 
2151:     /**
2152:      * Method called to associate a FeatureCvterm object to this object
2153:      * through the FeatureCvterm foreign key attribute.
2154:      *
2155:      * @param    FeatureCvterm $l FeatureCvterm
2156:      * @return Feature The current object (for fluent API support)
2157:      */
2158:     public function addFeatureCvterm(FeatureCvterm $l)
2159:     {
2160:         if ($this->collFeatureCvterms === null) {
2161:             $this->initFeatureCvterms();
2162:             $this->collFeatureCvtermsPartial = true;
2163:         }
2164:         if (!in_array($l, $this->collFeatureCvterms->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
2165:             $this->doAddFeatureCvterm($l);
2166:         }
2167: 
2168:         return $this;
2169:     }
2170: 
2171:     /**
2172:      * @param   FeatureCvterm $featureCvterm The featureCvterm object to add.
2173:      */
2174:     protected function doAddFeatureCvterm($featureCvterm)
2175:     {
2176:         $this->collFeatureCvterms[]= $featureCvterm;
2177:         $featureCvterm->setFeature($this);
2178:     }
2179: 
2180:     /**
2181:      * @param   FeatureCvterm $featureCvterm The featureCvterm object to remove.
2182:      * @return Feature The current object (for fluent API support)
2183:      */
2184:     public function removeFeatureCvterm($featureCvterm)
2185:     {
2186:         if ($this->getFeatureCvterms()->contains($featureCvterm)) {
2187:             $this->collFeatureCvterms->remove($this->collFeatureCvterms->search($featureCvterm));
2188:             if (null === $this->featureCvtermsScheduledForDeletion) {
2189:                 $this->featureCvtermsScheduledForDeletion = clone $this->collFeatureCvterms;
2190:                 $this->featureCvtermsScheduledForDeletion->clear();
2191:             }
2192:             $this->featureCvtermsScheduledForDeletion[]= clone $featureCvterm;
2193:             $featureCvterm->setFeature(null);
2194:         }
2195: 
2196:         return $this;
2197:     }
2198: 
2199: 
2200:     /**
2201:      * If this collection has already been initialized with
2202:      * an identical criteria, it returns the collection.
2203:      * Otherwise if this Feature is new, it will return
2204:      * an empty collection; or if this Feature has previously
2205:      * been saved, it will retrieve related FeatureCvterms from storage.
2206:      *
2207:      * This method is protected by default in order to keep the public
2208:      * api reasonable.  You can provide public methods for those you
2209:      * actually need in Feature.
2210:      *
2211:      * @param Criteria $criteria optional Criteria object to narrow the query
2212:      * @param PropelPDO $con optional connection object
2213:      * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN)
2214:      * @return PropelObjectCollection|FeatureCvterm[] List of FeatureCvterm objects
2215:      */
2216:     public function getFeatureCvtermsJoinCvterm($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
2217:     {
2218:         $query = FeatureCvtermQuery::create(null, $criteria);
2219:         $query->joinWith('Cvterm', $join_behavior);
2220: 
2221:         return $this->getFeatureCvterms($query, $con);
2222:     }
2223: 
2224: 
2225:     /**
2226:      * If this collection has already been initialized with
2227:      * an identical criteria, it returns the collection.
2228:      * Otherwise if this Feature is new, it will return
2229:      * an empty collection; or if this Feature has previously
2230:      * been saved, it will retrieve related FeatureCvterms from storage.
2231:      *
2232:      * This method is protected by default in order to keep the public
2233:      * api reasonable.  You can provide public methods for those you
2234:      * actually need in Feature.
2235:      *
2236:      * @param Criteria $criteria optional Criteria object to narrow the query
2237:      * @param PropelPDO $con optional connection object
2238:      * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN)
2239:      * @return PropelObjectCollection|FeatureCvterm[] List of FeatureCvterm objects
2240:      */
2241:     public function getFeatureCvtermsJoinPub($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
2242:     {
2243:         $query = FeatureCvtermQuery::create(null, $criteria);
2244:         $query->joinWith('Pub', $join_behavior);
2245: 
2246:         return $this->getFeatureCvterms($query, $con);
2247:     }
2248: 
2249:     /**
2250:      * Clears out the collFeatureDbxrefs collection
2251:      *
2252:      * This does not modify the database; however, it will remove any associated objects, causing
2253:      * them to be refetched by subsequent calls to accessor method.
2254:      *
2255:      * @return Feature The current object (for fluent API support)
2256:      * @see        addFeatureDbxrefs()
2257:      */
2258:     public function clearFeatureDbxrefs()
2259:     {
2260:         $this->collFeatureDbxrefs = null; // important to set this to null since that means it is uninitialized
2261:         $this->collFeatureDbxrefsPartial = null;
2262: 
2263:         return $this;
2264:     }
2265: 
2266:     /**
2267:      * reset is the collFeatureDbxrefs collection loaded partially
2268:      *
2269:      * @return void
2270:      */
2271:     public function resetPartialFeatureDbxrefs($v = true)
2272:     {
2273:         $this->collFeatureDbxrefsPartial = $v;
2274:     }
2275: 
2276:     /**
2277:      * Initializes the collFeatureDbxrefs collection.
2278:      *
2279:      * By default this just sets the collFeatureDbxrefs collection to an empty array (like clearcollFeatureDbxrefs());
2280:      * however, you may wish to override this method in your stub class to provide setting appropriate
2281:      * to your application -- for example, setting the initial array to the values stored in database.
2282:      *
2283:      * @param boolean $overrideExisting If set to true, the method call initializes
2284:      *                                        the collection even if it is not empty
2285:      *
2286:      * @return void
2287:      */
2288:     public function initFeatureDbxrefs($overrideExisting = true)
2289:     {
2290:         if (null !== $this->collFeatureDbxrefs && !$overrideExisting) {
2291:             return;
2292:         }
2293:         $this->collFeatureDbxrefs = new PropelObjectCollection();
2294:         $this->collFeatureDbxrefs->setModel('FeatureDbxref');
2295:     }
2296: 
2297:     /**
2298:      * Gets an array of FeatureDbxref objects which contain a foreign key that references this object.
2299:      *
2300:      * If the $criteria is not null, it is used to always fetch the results from the database.
2301:      * Otherwise the results are fetched from the database the first time, then cached.
2302:      * Next time the same method is called without $criteria, the cached collection is returned.
2303:      * If this Feature is new, it will return
2304:      * an empty collection or the current collection; the criteria is ignored on a new object.
2305:      *
2306:      * @param Criteria $criteria optional Criteria object to narrow the query
2307:      * @param PropelPDO $con optional connection object
2308:      * @return PropelObjectCollection|FeatureDbxref[] List of FeatureDbxref objects
2309:      * @throws PropelException
2310:      */
2311:     public function getFeatureDbxrefs($criteria = null, PropelPDO $con = null)
2312:     {
2313:         $partial = $this->collFeatureDbxrefsPartial && !$this->isNew();
2314:         if (null === $this->collFeatureDbxrefs || null !== $criteria  || $partial) {
2315:             if ($this->isNew() && null === $this->collFeatureDbxrefs) {
2316:                 // return empty collection
2317:                 $this->initFeatureDbxrefs();
2318:             } else {
2319:                 $collFeatureDbxrefs = FeatureDbxrefQuery::create(null, $criteria)
2320:                     ->filterByFeature($this)
2321:                     ->find($con);
2322:                 if (null !== $criteria) {
2323:                     if (false !== $this->collFeatureDbxrefsPartial && count($collFeatureDbxrefs)) {
2324:                       $this->initFeatureDbxrefs(false);
2325: 
2326:                       foreach($collFeatureDbxrefs as $obj) {
2327:                         if (false == $this->collFeatureDbxrefs->contains($obj)) {
2328:                           $this->collFeatureDbxrefs->append($obj);
2329:                         }
2330:                       }
2331: 
2332:                       $this->collFeatureDbxrefsPartial = true;
2333:                     }
2334: 
2335:                     $collFeatureDbxrefs->getInternalIterator()->rewind();
2336:                     return $collFeatureDbxrefs;
2337:                 }
2338: 
2339:                 if($partial && $this->collFeatureDbxrefs) {
2340:                     foreach($this->collFeatureDbxrefs as $obj) {
2341:                         if($obj->isNew()) {
2342:                             $collFeatureDbxrefs[] = $obj;
2343:                         }
2344:                     }
2345:                 }
2346: 
2347:                 $this->collFeatureDbxrefs = $collFeatureDbxrefs;
2348:                 $this->collFeatureDbxrefsPartial = false;
2349:             }
2350:         }
2351: 
2352:         return $this->collFeatureDbxrefs;
2353:     }
2354: 
2355:     /**
2356:      * Sets a collection of FeatureDbxref objects related by a one-to-many relationship
2357:      * to the current object.
2358:      * It will also schedule objects for deletion based on a diff between old objects (aka persisted)
2359:      * and new objects from the given Propel collection.
2360:      *
2361:      * @param PropelCollection $featureDbxrefs A Propel collection.
2362:      * @param PropelPDO $con Optional connection object
2363:      * @return Feature The current object (for fluent API support)
2364:      */
2365:     public function setFeatureDbxrefs(PropelCollection $featureDbxrefs, PropelPDO $con = null)
2366:     {
2367:         $featureDbxrefsToDelete = $this->getFeatureDbxrefs(new Criteria(), $con)->diff($featureDbxrefs);
2368: 
2369:         $this->featureDbxrefsScheduledForDeletion = unserialize(serialize($featureDbxrefsToDelete));
2370: 
2371:         foreach ($featureDbxrefsToDelete as $featureDbxrefRemoved) {
2372:             $featureDbxrefRemoved->setFeature(null);
2373:         }
2374: 
2375:         $this->collFeatureDbxrefs = null;
2376:         foreach ($featureDbxrefs as $featureDbxref) {
2377:             $this->addFeatureDbxref($featureDbxref);
2378:         }
2379: 
2380:         $this->collFeatureDbxrefs = $featureDbxrefs;
2381:         $this->collFeatureDbxrefsPartial = false;
2382: 
2383:         return $this;
2384:     }
2385: 
2386:     /**
2387:      * Returns the number of related FeatureDbxref objects.
2388:      *
2389:      * @param Criteria $criteria
2390:      * @param boolean $distinct
2391:      * @param PropelPDO $con
2392:      * @return int             Count of related FeatureDbxref objects.
2393:      * @throws PropelException
2394:      */
2395:     public function countFeatureDbxrefs(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
2396:     {
2397:         $partial = $this->collFeatureDbxrefsPartial && !$this->isNew();
2398:         if (null === $this->collFeatureDbxrefs || null !== $criteria || $partial) {
2399:             if ($this->isNew() && null === $this->collFeatureDbxrefs) {
2400:                 return 0;
2401:             }
2402: 
2403:             if($partial && !$criteria) {
2404:                 return count($this->getFeatureDbxrefs());
2405:             }
2406:             $query = FeatureDbxrefQuery::create(null, $criteria);
2407:             if ($distinct) {
2408:                 $query->distinct();
2409:             }
2410: 
2411:             return $query
2412:                 ->filterByFeature($this)
2413:                 ->count($con);
2414:         }
2415: 
2416:         return count($this->collFeatureDbxrefs);
2417:     }
2418: 
2419:     /**
2420:      * Method called to associate a FeatureDbxref object to this object
2421:      * through the FeatureDbxref foreign key attribute.
2422:      *
2423:      * @param    FeatureDbxref $l FeatureDbxref
2424:      * @return Feature The current object (for fluent API support)
2425:      */
2426:     public function addFeatureDbxref(FeatureDbxref $l)
2427:     {
2428:         if ($this->collFeatureDbxrefs === null) {
2429:             $this->initFeatureDbxrefs();
2430:             $this->collFeatureDbxrefsPartial = true;
2431:         }
2432:         if (!in_array($l, $this->collFeatureDbxrefs->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
2433:             $this->doAddFeatureDbxref($l);
2434:         }
2435: 
2436:         return $this;
2437:     }
2438: 
2439:     /**
2440:      * @param   FeatureDbxref $featureDbxref The featureDbxref object to add.
2441:      */
2442:     protected function doAddFeatureDbxref($featureDbxref)
2443:     {
2444:         $this->collFeatureDbxrefs[]= $featureDbxref;
2445:         $featureDbxref->setFeature($this);
2446:     }
2447: 
2448:     /**
2449:      * @param   FeatureDbxref $featureDbxref The featureDbxref object to remove.
2450:      * @return Feature The current object (for fluent API support)
2451:      */
2452:     public function removeFeatureDbxref($featureDbxref)
2453:     {
2454:         if ($this->getFeatureDbxrefs()->contains($featureDbxref)) {
2455:             $this->collFeatureDbxrefs->remove($this->collFeatureDbxrefs->search($featureDbxref));
2456:             if (null === $this->featureDbxrefsScheduledForDeletion) {
2457:                 $this->featureDbxrefsScheduledForDeletion = clone $this->collFeatureDbxrefs;
2458:                 $this->featureDbxrefsScheduledForDeletion->clear();
2459:             }
2460:             $this->featureDbxrefsScheduledForDeletion[]= clone $featureDbxref;
2461:             $featureDbxref->setFeature(null);
2462:         }
2463: 
2464:         return $this;
2465:     }
2466: 
2467: 
2468:     /**
2469:      * If this collection has already been initialized with
2470:      * an identical criteria, it returns the collection.
2471:      * Otherwise if this Feature is new, it will return
2472:      * an empty collection; or if this Feature has previously
2473:      * been saved, it will retrieve related FeatureDbxrefs from storage.
2474:      *
2475:      * This method is protected by default in order to keep the public
2476:      * api reasonable.  You can provide public methods for those you
2477:      * actually need in Feature.
2478:      *
2479:      * @param Criteria $criteria optional Criteria object to narrow the query
2480:      * @param PropelPDO $con optional connection object
2481:      * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN)
2482:      * @return PropelObjectCollection|FeatureDbxref[] List of FeatureDbxref objects
2483:      */
2484:     public function getFeatureDbxrefsJoinDbxref($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
2485:     {
2486:         $query = FeatureDbxrefQuery::create(null, $criteria);
2487:         $query->joinWith('Dbxref', $join_behavior);
2488: 
2489:         return $this->getFeatureDbxrefs($query, $con);
2490:     }
2491: 
2492:     /**
2493:      * Clears out the collFeaturePubs collection
2494:      *
2495:      * This does not modify the database; however, it will remove any associated objects, causing
2496:      * them to be refetched by subsequent calls to accessor method.
2497:      *
2498:      * @return Feature The current object (for fluent API support)
2499:      * @see        addFeaturePubs()
2500:      */
2501:     public function clearFeaturePubs()
2502:     {
2503:         $this->collFeaturePubs = null; // important to set this to null since that means it is uninitialized
2504:         $this->collFeaturePubsPartial = null;
2505: 
2506:         return $this;
2507:     }
2508: 
2509:     /**
2510:      * reset is the collFeaturePubs collection loaded partially
2511:      *
2512:      * @return void
2513:      */
2514:     public function resetPartialFeaturePubs($v = true)
2515:     {
2516:         $this->collFeaturePubsPartial = $v;
2517:     }
2518: 
2519:     /**
2520:      * Initializes the collFeaturePubs collection.
2521:      *
2522:      * By default this just sets the collFeaturePubs collection to an empty array (like clearcollFeaturePubs());
2523:      * however, you may wish to override this method in your stub class to provide setting appropriate
2524:      * to your application -- for example, setting the initial array to the values stored in database.
2525:      *
2526:      * @param boolean $overrideExisting If set to true, the method call initializes
2527:      *                                        the collection even if it is not empty
2528:      *
2529:      * @return void
2530:      */
2531:     public function initFeaturePubs($overrideExisting = true)
2532:     {
2533:         if (null !== $this->collFeaturePubs && !$overrideExisting) {
2534:             return;
2535:         }
2536:         $this->collFeaturePubs = new PropelObjectCollection();
2537:         $this->collFeaturePubs->setModel('FeaturePub');
2538:     }
2539: 
2540:     /**
2541:      * Gets an array of FeaturePub objects which contain a foreign key that references this object.
2542:      *
2543:      * If the $criteria is not null, it is used to always fetch the results from the database.
2544:      * Otherwise the results are fetched from the database the first time, then cached.
2545:      * Next time the same method is called without $criteria, the cached collection is returned.
2546:      * If this Feature is new, it will return
2547:      * an empty collection or the current collection; the criteria is ignored on a new object.
2548:      *
2549:      * @param Criteria $criteria optional Criteria object to narrow the query
2550:      * @param PropelPDO $con optional connection object
2551:      * @return PropelObjectCollection|FeaturePub[] List of FeaturePub objects
2552:      * @throws PropelException
2553:      */
2554:     public function getFeaturePubs($criteria = null, PropelPDO $con = null)
2555:     {
2556:         $partial = $this->collFeaturePubsPartial && !$this->isNew();
2557:         if (null === $this->collFeaturePubs || null !== $criteria  || $partial) {
2558:             if ($this->isNew() && null === $this->collFeaturePubs) {
2559:                 // return empty collection
2560:                 $this->initFeaturePubs();
2561:             } else {
2562:                 $collFeaturePubs = FeaturePubQuery::create(null, $criteria)
2563:                     ->filterByFeature($this)
2564:                     ->find($con);
2565:                 if (null !== $criteria) {
2566:                     if (false !== $this->collFeaturePubsPartial && count($collFeaturePubs)) {
2567:                       $this->initFeaturePubs(false);
2568: 
2569:                       foreach($collFeaturePubs as $obj) {
2570:                         if (false == $this->collFeaturePubs->contains($obj)) {
2571:                           $this->collFeaturePubs->append($obj);
2572:                         }
2573:                       }
2574: 
2575:                       $this->collFeaturePubsPartial = true;
2576:                     }
2577: 
2578:                     $collFeaturePubs->getInternalIterator()->rewind();
2579:                     return $collFeaturePubs;
2580:                 }
2581: 
2582:                 if($partial && $this->collFeaturePubs) {
2583:                     foreach($this->collFeaturePubs as $obj) {
2584:                         if($obj->isNew()) {
2585:                             $collFeaturePubs[] = $obj;
2586:                         }
2587:                     }
2588:                 }
2589: 
2590:                 $this->collFeaturePubs = $collFeaturePubs;
2591:                 $this->collFeaturePubsPartial = false;
2592:             }
2593:         }
2594: 
2595:         return $this->collFeaturePubs;
2596:     }
2597: 
2598:     /**
2599:      * Sets a collection of FeaturePub objects related by a one-to-many relationship
2600:      * to the current object.
2601:      * It will also schedule objects for deletion based on a diff between old objects (aka persisted)
2602:      * and new objects from the given Propel collection.
2603:      *
2604:      * @param PropelCollection $featurePubs A Propel collection.
2605:      * @param PropelPDO $con Optional connection object
2606:      * @return Feature The current object (for fluent API support)
2607:      */
2608:     public function setFeaturePubs(PropelCollection $featurePubs, PropelPDO $con = null)
2609:     {
2610:         $featurePubsToDelete = $this->getFeaturePubs(new Criteria(), $con)->diff($featurePubs);
2611: 
2612:         $this->featurePubsScheduledForDeletion = unserialize(serialize($featurePubsToDelete));
2613: 
2614:         foreach ($featurePubsToDelete as $featurePubRemoved) {
2615:             $featurePubRemoved->setFeature(null);
2616:         }
2617: 
2618:         $this->collFeaturePubs = null;
2619:         foreach ($featurePubs as $featurePub) {
2620:             $this->addFeaturePub($featurePub);
2621:         }
2622: 
2623:         $this->collFeaturePubs = $featurePubs;
2624:         $this->collFeaturePubsPartial = false;
2625: 
2626:         return $this;
2627:     }
2628: 
2629:     /**
2630:      * Returns the number of related FeaturePub objects.
2631:      *
2632:      * @param Criteria $criteria
2633:      * @param boolean $distinct
2634:      * @param PropelPDO $con
2635:      * @return int             Count of related FeaturePub objects.
2636:      * @throws PropelException
2637:      */
2638:     public function countFeaturePubs(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
2639:     {
2640:         $partial = $this->collFeaturePubsPartial && !$this->isNew();
2641:         if (null === $this->collFeaturePubs || null !== $criteria || $partial) {
2642:             if ($this->isNew() && null === $this->collFeaturePubs) {
2643:                 return 0;
2644:             }
2645: 
2646:             if($partial && !$criteria) {
2647:                 return count($this->getFeaturePubs());
2648:             }
2649:             $query = FeaturePubQuery::create(null, $criteria);
2650:             if ($distinct) {
2651:                 $query->distinct();
2652:             }
2653: 
2654:             return $query
2655:                 ->filterByFeature($this)
2656:                 ->count($con);
2657:         }
2658: 
2659:         return count($this->collFeaturePubs);
2660:     }
2661: 
2662:     /**
2663:      * Method called to associate a FeaturePub object to this object
2664:      * through the FeaturePub foreign key attribute.
2665:      *
2666:      * @param    FeaturePub $l FeaturePub
2667:      * @return Feature The current object (for fluent API support)
2668:      */
2669:     public function addFeaturePub(FeaturePub $l)
2670:     {
2671:         if ($this->collFeaturePubs === null) {
2672:             $this->initFeaturePubs();
2673:             $this->collFeaturePubsPartial = true;
2674:         }
2675:         if (!in_array($l, $this->collFeaturePubs->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
2676:             $this->doAddFeaturePub($l);
2677:         }
2678: 
2679:         return $this;
2680:     }
2681: 
2682:     /**
2683:      * @param   FeaturePub $featurePub The featurePub object to add.
2684:      */
2685:     protected function doAddFeaturePub($featurePub)
2686:     {
2687:         $this->collFeaturePubs[]= $featurePub;
2688:         $featurePub->setFeature($this);
2689:     }
2690: 
2691:     /**
2692:      * @param   FeaturePub $featurePub The featurePub object to remove.
2693:      * @return Feature The current object (for fluent API support)
2694:      */
2695:     public function removeFeaturePub($featurePub)
2696:     {
2697:         if ($this->getFeaturePubs()->contains($featurePub)) {
2698:             $this->collFeaturePubs->remove($this->collFeaturePubs->search($featurePub));
2699:             if (null === $this->featurePubsScheduledForDeletion) {
2700:                 $this->featurePubsScheduledForDeletion = clone $this->collFeaturePubs;
2701:                 $this->featurePubsScheduledForDeletion->clear();
2702:             }
2703:             $this->featurePubsScheduledForDeletion[]= clone $featurePub;
2704:             $featurePub->setFeature(null);
2705:         }
2706: 
2707:         return $this;
2708:     }
2709: 
2710: 
2711:     /**
2712:      * If this collection has already been initialized with
2713:      * an identical criteria, it returns the collection.
2714:      * Otherwise if this Feature is new, it will return
2715:      * an empty collection; or if this Feature has previously
2716:      * been saved, it will retrieve related FeaturePubs from storage.
2717:      *
2718:      * This method is protected by default in order to keep the public
2719:      * api reasonable.  You can provide public methods for those you
2720:      * actually need in Feature.
2721:      *
2722:      * @param Criteria $criteria optional Criteria object to narrow the query
2723:      * @param PropelPDO $con optional connection object
2724:      * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN)
2725:      * @return PropelObjectCollection|FeaturePub[] List of FeaturePub objects
2726:      */
2727:     public function getFeaturePubsJoinPub($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
2728:     {
2729:         $query = FeaturePubQuery::create(null, $criteria);
2730:         $query->joinWith('Pub', $join_behavior);
2731: 
2732:         return $this->getFeaturePubs($query, $con);
2733:     }
2734: 
2735:     /**
2736:      * Clears out the collFeatureSynonyms collection
2737:      *
2738:      * This does not modify the database; however, it will remove any associated objects, causing
2739:      * them to be refetched by subsequent calls to accessor method.
2740:      *
2741:      * @return Feature The current object (for fluent API support)
2742:      * @see        addFeatureSynonyms()
2743:      */
2744:     public function clearFeatureSynonyms()
2745:     {
2746:         $this->collFeatureSynonyms = null; // important to set this to null since that means it is uninitialized
2747:         $this->collFeatureSynonymsPartial = null;
2748: 
2749:         return $this;
2750:     }
2751: 
2752:     /**
2753:      * reset is the collFeatureSynonyms collection loaded partially
2754:      *
2755:      * @return void
2756:      */
2757:     public function resetPartialFeatureSynonyms($v = true)
2758:     {
2759:         $this->collFeatureSynonymsPartial = $v;
2760:     }
2761: 
2762:     /**
2763:      * Initializes the collFeatureSynonyms collection.
2764:      *
2765:      * By default this just sets the collFeatureSynonyms collection to an empty array (like clearcollFeatureSynonyms());
2766:      * however, you may wish to override this method in your stub class to provide setting appropriate
2767:      * to your application -- for example, setting the initial array to the values stored in database.
2768:      *
2769:      * @param boolean $overrideExisting If set to true, the method call initializes
2770:      *                                        the collection even if it is not empty
2771:      *
2772:      * @return void
2773:      */
2774:     public function initFeatureSynonyms($overrideExisting = true)
2775:     {
2776:         if (null !== $this->collFeatureSynonyms && !$overrideExisting) {
2777:             return;
2778:         }
2779:         $this->collFeatureSynonyms = new PropelObjectCollection();
2780:         $this->collFeatureSynonyms->setModel('FeatureSynonym');
2781:     }
2782: 
2783:     /**
2784:      * Gets an array of FeatureSynonym objects which contain a foreign key that references this object.
2785:      *
2786:      * If the $criteria is not null, it is used to always fetch the results from the database.
2787:      * Otherwise the results are fetched from the database the first time, then cached.
2788:      * Next time the same method is called without $criteria, the cached collection is returned.
2789:      * If this Feature is new, it will return
2790:      * an empty collection or the current collection; the criteria is ignored on a new object.
2791:      *
2792:      * @param Criteria $criteria optional Criteria object to narrow the query
2793:      * @param PropelPDO $con optional connection object
2794:      * @return PropelObjectCollection|FeatureSynonym[] List of FeatureSynonym objects
2795:      * @throws PropelException
2796:      */
2797:     public function getFeatureSynonyms($criteria = null, PropelPDO $con = null)
2798:     {
2799:         $partial = $this->collFeatureSynonymsPartial && !$this->isNew();
2800:         if (null === $this->collFeatureSynonyms || null !== $criteria  || $partial) {
2801:             if ($this->isNew() && null === $this->collFeatureSynonyms) {
2802:                 // return empty collection
2803:                 $this->initFeatureSynonyms();
2804:             } else {
2805:                 $collFeatureSynonyms = FeatureSynonymQuery::create(null, $criteria)
2806:                     ->filterByFeature($this)
2807:                     ->find($con);
2808:                 if (null !== $criteria) {
2809:                     if (false !== $this->collFeatureSynonymsPartial && count($collFeatureSynonyms)) {
2810:                       $this->initFeatureSynonyms(false);
2811: 
2812:                       foreach($collFeatureSynonyms as $obj) {
2813:                         if (false == $this->collFeatureSynonyms->contains($obj)) {
2814:                           $this->collFeatureSynonyms->append($obj);
2815:                         }
2816:                       }
2817: 
2818:                       $this->collFeatureSynonymsPartial = true;
2819:                     }
2820: 
2821:                     $collFeatureSynonyms->getInternalIterator()->rewind();
2822:                     return $collFeatureSynonyms;
2823:                 }
2824: 
2825:                 if($partial && $this->collFeatureSynonyms) {
2826:                     foreach($this->collFeatureSynonyms as $obj) {
2827:                         if($obj->isNew()) {
2828:                             $collFeatureSynonyms[] = $obj;
2829:                         }
2830:                     }
2831:                 }
2832: 
2833:                 $this->collFeatureSynonyms = $collFeatureSynonyms;
2834:                 $this->collFeatureSynonymsPartial = false;
2835:             }
2836:         }
2837: 
2838:         return $this->collFeatureSynonyms;
2839:     }
2840: 
2841:     /**
2842:      * Sets a collection of FeatureSynonym objects related by a one-to-many relationship
2843:      * to the current object.
2844:      * It will also schedule objects for deletion based on a diff between old objects (aka persisted)
2845:      * and new objects from the given Propel collection.
2846:      *
2847:      * @param PropelCollection $featureSynonyms A Propel collection.
2848:      * @param PropelPDO $con Optional connection object
2849:      * @return Feature The current object (for fluent API support)
2850:      */
2851:     public function setFeatureSynonyms(PropelCollection $featureSynonyms, PropelPDO $con = null)
2852:     {
2853:         $featureSynonymsToDelete = $this->getFeatureSynonyms(new Criteria(), $con)->diff($featureSynonyms);
2854: 
2855:         $this->featureSynonymsScheduledForDeletion = unserialize(serialize($featureSynonymsToDelete));
2856: 
2857:         foreach ($featureSynonymsToDelete as $featureSynonymRemoved) {
2858:             $featureSynonymRemoved->setFeature(null);
2859:         }
2860: 
2861:         $this->collFeatureSynonyms = null;
2862:         foreach ($featureSynonyms as $featureSynonym) {
2863:             $this->addFeatureSynonym($featureSynonym);
2864:         }
2865: 
2866:         $this->collFeatureSynonyms = $featureSynonyms;
2867:         $this->collFeatureSynonymsPartial = false;
2868: 
2869:         return $this;
2870:     }
2871: 
2872:     /**
2873:      * Returns the number of related FeatureSynonym objects.
2874:      *
2875:      * @param Criteria $criteria
2876:      * @param boolean $distinct
2877:      * @param PropelPDO $con
2878:      * @return int             Count of related FeatureSynonym objects.
2879:      * @throws PropelException
2880:      */
2881:     public function countFeatureSynonyms(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
2882:     {
2883:         $partial = $this->collFeatureSynonymsPartial && !$this->isNew();
2884:         if (null === $this->collFeatureSynonyms || null !== $criteria || $partial) {
2885:             if ($this->isNew() && null === $this->collFeatureSynonyms) {
2886:                 return 0;
2887:             }
2888: 
2889:             if($partial && !$criteria) {
2890:                 return count($this->getFeatureSynonyms());
2891:             }
2892:             $query = FeatureSynonymQuery::create(null, $criteria);
2893:             if ($distinct) {
2894:                 $query->distinct();
2895:             }
2896: 
2897:             return $query
2898:                 ->filterByFeature($this)
2899:                 ->count($con);
2900:         }
2901: 
2902:         return count($this->collFeatureSynonyms);
2903:     }
2904: 
2905:     /**
2906:      * Method called to associate a FeatureSynonym object to this object
2907:      * through the FeatureSynonym foreign key attribute.
2908:      *
2909:      * @param    FeatureSynonym $l FeatureSynonym
2910:      * @return Feature The current object (for fluent API support)
2911:      */
2912:     public function addFeatureSynonym(FeatureSynonym $l)
2913:     {
2914:         if ($this->collFeatureSynonyms === null) {
2915:             $this->initFeatureSynonyms();
2916:             $this->collFeatureSynonymsPartial = true;
2917:         }
2918:         if (!in_array($l, $this->collFeatureSynonyms->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
2919:             $this->doAddFeatureSynonym($l);
2920:         }
2921: 
2922:         return $this;
2923:     }
2924: 
2925:     /**
2926:      * @param   FeatureSynonym $featureSynonym The featureSynonym object to add.
2927:      */
2928:     protected function doAddFeatureSynonym($featureSynonym)
2929:     {
2930:         $this->collFeatureSynonyms[]= $featureSynonym;
2931:         $featureSynonym->setFeature($this);
2932:     }
2933: 
2934:     /**
2935:      * @param   FeatureSynonym $featureSynonym The featureSynonym object to remove.
2936:      * @return Feature The current object (for fluent API support)
2937:      */
2938:     public function removeFeatureSynonym($featureSynonym)
2939:     {
2940:         if ($this->getFeatureSynonyms()->contains($featureSynonym)) {
2941:             $this->collFeatureSynonyms->remove($this->collFeatureSynonyms->search($featureSynonym));
2942:             if (null === $this->featureSynonymsScheduledForDeletion) {
2943:                 $this->featureSynonymsScheduledForDeletion = clone $this->collFeatureSynonyms;
2944:                 $this->featureSynonymsScheduledForDeletion->clear();
2945:             }
2946:             $this->featureSynonymsScheduledForDeletion[]= clone $featureSynonym;
2947:             $featureSynonym->setFeature(null);
2948:         }
2949: 
2950:         return $this;
2951:     }
2952: 
2953: 
2954:     /**
2955:      * If this collection has already been initialized with
2956:      * an identical criteria, it returns the collection.
2957:      * Otherwise if this Feature is new, it will return
2958:      * an empty collection; or if this Feature has previously
2959:      * been saved, it will retrieve related FeatureSynonyms from storage.
2960:      *
2961:      * This method is protected by default in order to keep the public
2962:      * api reasonable.  You can provide public methods for those you
2963:      * actually need in Feature.
2964:      *
2965:      * @param Criteria $criteria optional Criteria object to narrow the query
2966:      * @param PropelPDO $con optional connection object
2967:      * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN)
2968:      * @return PropelObjectCollection|FeatureSynonym[] List of FeatureSynonym objects
2969:      */
2970:     public function getFeatureSynonymsJoinPub($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
2971:     {
2972:         $query = FeatureSynonymQuery::create(null, $criteria);
2973:         $query->joinWith('Pub', $join_behavior);
2974: 
2975:         return $this->getFeatureSynonyms($query, $con);
2976:     }
2977: 
2978: 
2979:     /**
2980:      * If this collection has already been initialized with
2981:      * an identical criteria, it returns the collection.
2982:      * Otherwise if this Feature is new, it will return
2983:      * an empty collection; or if this Feature has previously
2984:      * been saved, it will retrieve related FeatureSynonyms from storage.
2985:      *
2986:      * This method is protected by default in order to keep the public
2987:      * api reasonable.  You can provide public methods for those you
2988:      * actually need in Feature.
2989:      *
2990:      * @param Criteria $criteria optional Criteria object to narrow the query
2991:      * @param PropelPDO $con optional connection object
2992:      * @param string $join_behavior optional join type to use (defaults to Criteria::LEFT_JOIN)
2993:      * @return PropelObjectCollection|FeatureSynonym[] List of FeatureSynonym objects
2994:      */
2995:     public function getFeatureSynonymsJoinSynonym($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN)
2996:     {
2997:         $query = FeatureSynonymQuery::create(null, $criteria);
2998:         $query->joinWith('Synonym', $join_behavior);
2999: 
3000:         return $this->getFeatureSynonyms($query, $con);
3001:     }
3002: 
3003:     /**
3004:      * Clears the current object and sets all attributes to their default values
3005:      */
3006:     public function clear()
3007:     {
3008:         $this->feature_id = null;
3009:         $this->dbxref_id = null;
3010:         $this->organism_id = null;
3011:         $this->name = null;
3012:         $this->uniquename = null;
3013:         $this->residues = null;
3014:         $this->seqlen = null;
3015:         $this->md5checksum = null;
3016:         $this->type_id = null;
3017:         $this->is_analysis = null;
3018:         $this->is_obsolete = null;
3019:         $this->timeaccessioned = null;
3020:         $this->timelastmodified = null;
3021:         $this->alreadyInSave = false;
3022:         $this->alreadyInValidation = false;
3023:         $this->alreadyInClearAllReferencesDeep = false;
3024:         $this->clearAllReferences();
3025:         $this->applyDefaultValues();
3026:         $this->resetModified();
3027:         $this->setNew(true);
3028:         $this->setDeleted(false);
3029:     }
3030: 
3031:     /**
3032:      * Resets all references to other model objects or collections of model objects.
3033:      *
3034:      * This method is a user-space workaround for PHP's inability to garbage collect
3035:      * objects with circular references (even in PHP 5.3). This is currently necessary
3036:      * when using Propel in certain daemon or large-volumne/high-memory operations.
3037:      *
3038:      * @param boolean $deep Whether to also clear the references on all referrer objects.
3039:      */
3040:     public function clearAllReferences($deep = false)
3041:     {
3042:         if ($deep && !$this->alreadyInClearAllReferencesDeep) {
3043:             $this->alreadyInClearAllReferencesDeep = true;
3044:             if ($this->collFeatureCvterms) {
3045:                 foreach ($this->collFeatureCvterms as $o) {
3046:                     $o->clearAllReferences($deep);
3047:                 }
3048:             }
3049:             if ($this->collFeatureDbxrefs) {
3050:                 foreach ($this->collFeatureDbxrefs as $o) {
3051:                     $o->clearAllReferences($deep);
3052:                 }
3053:             }
3054:             if ($this->collFeaturePubs) {
3055:                 foreach ($this->collFeaturePubs as $o) {
3056:                     $o->clearAllReferences($deep);
3057:                 }
3058:             }
3059:             if ($this->collFeatureSynonyms) {
3060:                 foreach ($this->collFeatureSynonyms as $o) {
3061:                     $o->clearAllReferences($deep);
3062:                 }
3063:             }
3064:             if ($this->aDbxref instanceof Persistent) {
3065:               $this->aDbxref->clearAllReferences($deep);
3066:             }
3067:             if ($this->aOrganism instanceof Persistent) {
3068:               $this->aOrganism->clearAllReferences($deep);
3069:             }
3070:             if ($this->aCvterm instanceof Persistent) {
3071:               $this->aCvterm->clearAllReferences($deep);
3072:             }
3073: 
3074:             $this->alreadyInClearAllReferencesDeep = false;
3075:         } // if ($deep)
3076: 
3077:         if ($this->collFeatureCvterms instanceof PropelCollection) {
3078:             $this->collFeatureCvterms->clearIterator();
3079:         }
3080:         $this->collFeatureCvterms = null;
3081:         if ($this->collFeatureDbxrefs instanceof PropelCollection) {
3082:             $this->collFeatureDbxrefs->clearIterator();
3083:         }
3084:         $this->collFeatureDbxrefs = null;
3085:         if ($this->collFeaturePubs instanceof PropelCollection) {
3086:             $this->collFeaturePubs->clearIterator();
3087:         }
3088:         $this->collFeaturePubs = null;
3089:         if ($this->collFeatureSynonyms instanceof PropelCollection) {
3090:             $this->collFeatureSynonyms->clearIterator();
3091:         }
3092:         $this->collFeatureSynonyms = null;
3093:         $this->aDbxref = null;
3094:         $this->aOrganism = null;
3095:         $this->aCvterm = null;
3096:     }
3097: 
3098:     /**
3099:      * return the string representation of this object
3100:      *
3101:      * @return string
3102:      */
3103:     public function __toString()
3104:     {
3105:         return (string) $this->exportTo(FeaturePeer::DEFAULT_STRING_FORMAT);
3106:     }
3107: 
3108:     /**
3109:      * return true is the object is in saving state
3110:      *
3111:      * @return boolean
3112:      */
3113:     public function isAlreadyInSave()
3114:     {
3115:         return $this->alreadyInSave;
3116:     }
3117: 
3118: }
3119: 
tbro API documentation generated by ApiGen 2.8.0