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 \PropelDateTime;
  14: use \PropelException;
  15: use \PropelPDO;
  16: use cli_db\propel\Acquisition;
  17: use cli_db\propel\AcquisitionQuery;
  18: use cli_db\propel\Analysis;
  19: use cli_db\propel\AnalysisQuery;
  20: use cli_db\propel\Contact;
  21: use cli_db\propel\ContactQuery;
  22: use cli_db\propel\Protocol;
  23: use cli_db\propel\ProtocolQuery;
  24: use cli_db\propel\Quantification;
  25: use cli_db\propel\QuantificationPeer;
  26: use cli_db\propel\QuantificationQuery;
  27: 
  28: /**
  29:  * Base class that represents a row from the 'quantification' table.
  30:  *
  31:  *
  32:  *
  33:  * @package    propel.generator.cli_db.om
  34:  */
  35: abstract class BaseQuantification extends BaseObject implements Persistent
  36: {
  37:     /**
  38:      * Peer class name
  39:      */
  40:     const PEER = 'cli_db\\propel\\QuantificationPeer';
  41: 
  42:     /**
  43:      * The Peer class.
  44:      * Instance provides a convenient way of calling static methods on a class
  45:      * that calling code may not be able to identify.
  46:      * @var        QuantificationPeer
  47:      */
  48:     protected static $peer;
  49: 
  50:     /**
  51:      * The flag var to prevent infinit loop in deep copy
  52:      * @var       boolean
  53:      */
  54:     protected $startCopy = false;
  55: 
  56:     /**
  57:      * The value for the quantification_id field.
  58:      * @var        int
  59:      */
  60:     protected $quantification_id;
  61: 
  62:     /**
  63:      * The value for the acquisition_id field.
  64:      * @var        int
  65:      */
  66:     protected $acquisition_id;
  67: 
  68:     /**
  69:      * The value for the operator_id field.
  70:      * @var        int
  71:      */
  72:     protected $operator_id;
  73: 
  74:     /**
  75:      * The value for the protocol_id field.
  76:      * @var        int
  77:      */
  78:     protected $protocol_id;
  79: 
  80:     /**
  81:      * The value for the analysis_id field.
  82:      * @var        int
  83:      */
  84:     protected $analysis_id;
  85: 
  86:     /**
  87:      * The value for the quantificationdate field.
  88:      * Note: this column has a database default value of: (expression) now()
  89:      * @var        string
  90:      */
  91:     protected $quantificationdate;
  92: 
  93:     /**
  94:      * The value for the name field.
  95:      * @var        string
  96:      */
  97:     protected $name;
  98: 
  99:     /**
 100:      * The value for the uri field.
 101:      * @var        string
 102:      */
 103:     protected $uri;
 104: 
 105:     /**
 106:      * @var        Acquisition
 107:      */
 108:     protected $aAcquisition;
 109: 
 110:     /**
 111:      * @var        Analysis
 112:      */
 113:     protected $aAnalysis;
 114: 
 115:     /**
 116:      * @var        Contact
 117:      */
 118:     protected $aContact;
 119: 
 120:     /**
 121:      * @var        Protocol
 122:      */
 123:     protected $aProtocol;
 124: 
 125:     /**
 126:      * Flag to prevent endless save loop, if this object is referenced
 127:      * by another object which falls in this transaction.
 128:      * @var        boolean
 129:      */
 130:     protected $alreadyInSave = false;
 131: 
 132:     /**
 133:      * Flag to prevent endless validation loop, if this object is referenced
 134:      * by another object which falls in this transaction.
 135:      * @var        boolean
 136:      */
 137:     protected $alreadyInValidation = false;
 138: 
 139:     /**
 140:      * Flag to prevent endless clearAllReferences($deep=true) loop, if this object is referenced
 141:      * @var        boolean
 142:      */
 143:     protected $alreadyInClearAllReferencesDeep = false;
 144: 
 145:     /**
 146:      * Applies default values to this object.
 147:      * This method should be called from the object's constructor (or
 148:      * equivalent initialization method).
 149:      * @see        __construct()
 150:      */
 151:     public function applyDefaultValues()
 152:     {
 153:     }
 154: 
 155:     /**
 156:      * Initializes internal state of BaseQuantification object.
 157:      * @see        applyDefaults()
 158:      */
 159:     public function __construct()
 160:     {
 161:         parent::__construct();
 162:         $this->applyDefaultValues();
 163:     }
 164: 
 165:     /**
 166:      * Get the [quantification_id] column value.
 167:      *
 168:      * @return int
 169:      */
 170:     public function getQuantificationId()
 171:     {
 172:         return $this->quantification_id;
 173:     }
 174: 
 175:     /**
 176:      * Get the [acquisition_id] column value.
 177:      *
 178:      * @return int
 179:      */
 180:     public function getAcquisitionId()
 181:     {
 182:         return $this->acquisition_id;
 183:     }
 184: 
 185:     /**
 186:      * Get the [operator_id] column value.
 187:      *
 188:      * @return int
 189:      */
 190:     public function getOperatorId()
 191:     {
 192:         return $this->operator_id;
 193:     }
 194: 
 195:     /**
 196:      * Get the [protocol_id] column value.
 197:      *
 198:      * @return int
 199:      */
 200:     public function getProtocolId()
 201:     {
 202:         return $this->protocol_id;
 203:     }
 204: 
 205:     /**
 206:      * Get the [analysis_id] column value.
 207:      *
 208:      * @return int
 209:      */
 210:     public function getAnalysisId()
 211:     {
 212:         return $this->analysis_id;
 213:     }
 214: 
 215:     /**
 216:      * Get the [optionally formatted] temporal [quantificationdate] column value.
 217:      *
 218:      *
 219:      * @param string $format The date/time format string (either date()-style or strftime()-style).
 220:      *               If format is null, then the raw DateTime object will be returned.
 221:      * @return mixed Formatted date/time value as string or DateTime object (if format is null), null if column is null
 222:      * @throws PropelException - if unable to parse/validate the date/time value.
 223:      */
 224:     public function getQuantificationdate($format = 'Y-m-d H:i:s')
 225:     {
 226:         if ($this->quantificationdate === null) {
 227:             return null;
 228:         }
 229: 
 230: 
 231:         try {
 232:             $dt = new DateTime($this->quantificationdate);
 233:         } catch (Exception $x) {
 234:             throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->quantificationdate, true), $x);
 235:         }
 236: 
 237:         if ($format === null) {
 238:             // Because propel.useDateTimeClass is true, we return a DateTime object.
 239:             return $dt;
 240:         }
 241: 
 242:         if (strpos($format, '%') !== false) {
 243:             return strftime($format, $dt->format('U'));
 244:         }
 245: 
 246:         return $dt->format($format);
 247: 
 248:     }
 249: 
 250:     /**
 251:      * Get the [name] column value.
 252:      *
 253:      * @return string
 254:      */
 255:     public function getName()
 256:     {
 257:         return $this->name;
 258:     }
 259: 
 260:     /**
 261:      * Get the [uri] column value.
 262:      *
 263:      * @return string
 264:      */
 265:     public function getUri()
 266:     {
 267:         return $this->uri;
 268:     }
 269: 
 270:     /**
 271:      * Set the value of [quantification_id] column.
 272:      *
 273:      * @param int $v new value
 274:      * @return Quantification The current object (for fluent API support)
 275:      */
 276:     public function setQuantificationId($v)
 277:     {
 278:         if ($v !== null && is_numeric($v)) {
 279:             $v = (int) $v;
 280:         }
 281: 
 282:         if ($this->quantification_id !== $v) {
 283:             $this->quantification_id = $v;
 284:             $this->modifiedColumns[] = QuantificationPeer::QUANTIFICATION_ID;
 285:         }
 286: 
 287: 
 288:         return $this;
 289:     } // setQuantificationId()
 290: 
 291:     /**
 292:      * Set the value of [acquisition_id] column.
 293:      *
 294:      * @param int $v new value
 295:      * @return Quantification The current object (for fluent API support)
 296:      */
 297:     public function setAcquisitionId($v)
 298:     {
 299:         if ($v !== null && is_numeric($v)) {
 300:             $v = (int) $v;
 301:         }
 302: 
 303:         if ($this->acquisition_id !== $v) {
 304:             $this->acquisition_id = $v;
 305:             $this->modifiedColumns[] = QuantificationPeer::ACQUISITION_ID;
 306:         }
 307: 
 308:         if ($this->aAcquisition !== null && $this->aAcquisition->getAcquisitionId() !== $v) {
 309:             $this->aAcquisition = null;
 310:         }
 311: 
 312: 
 313:         return $this;
 314:     } // setAcquisitionId()
 315: 
 316:     /**
 317:      * Set the value of [operator_id] column.
 318:      *
 319:      * @param int $v new value
 320:      * @return Quantification The current object (for fluent API support)
 321:      */
 322:     public function setOperatorId($v)
 323:     {
 324:         if ($v !== null && is_numeric($v)) {
 325:             $v = (int) $v;
 326:         }
 327: 
 328:         if ($this->operator_id !== $v) {
 329:             $this->operator_id = $v;
 330:             $this->modifiedColumns[] = QuantificationPeer::OPERATOR_ID;
 331:         }
 332: 
 333:         if ($this->aContact !== null && $this->aContact->getContactId() !== $v) {
 334:             $this->aContact = null;
 335:         }
 336: 
 337: 
 338:         return $this;
 339:     } // setOperatorId()
 340: 
 341:     /**
 342:      * Set the value of [protocol_id] column.
 343:      *
 344:      * @param int $v new value
 345:      * @return Quantification The current object (for fluent API support)
 346:      */
 347:     public function setProtocolId($v)
 348:     {
 349:         if ($v !== null && is_numeric($v)) {
 350:             $v = (int) $v;
 351:         }
 352: 
 353:         if ($this->protocol_id !== $v) {
 354:             $this->protocol_id = $v;
 355:             $this->modifiedColumns[] = QuantificationPeer::PROTOCOL_ID;
 356:         }
 357: 
 358:         if ($this->aProtocol !== null && $this->aProtocol->getProtocolId() !== $v) {
 359:             $this->aProtocol = null;
 360:         }
 361: 
 362: 
 363:         return $this;
 364:     } // setProtocolId()
 365: 
 366:     /**
 367:      * Set the value of [analysis_id] column.
 368:      *
 369:      * @param int $v new value
 370:      * @return Quantification The current object (for fluent API support)
 371:      */
 372:     public function setAnalysisId($v)
 373:     {
 374:         if ($v !== null && is_numeric($v)) {
 375:             $v = (int) $v;
 376:         }
 377: 
 378:         if ($this->analysis_id !== $v) {
 379:             $this->analysis_id = $v;
 380:             $this->modifiedColumns[] = QuantificationPeer::ANALYSIS_ID;
 381:         }
 382: 
 383:         if ($this->aAnalysis !== null && $this->aAnalysis->getAnalysisId() !== $v) {
 384:             $this->aAnalysis = null;
 385:         }
 386: 
 387: 
 388:         return $this;
 389:     } // setAnalysisId()
 390: 
 391:     /**
 392:      * Sets the value of [quantificationdate] column to a normalized version of the date/time value specified.
 393:      *
 394:      * @param mixed $v string, integer (timestamp), or DateTime value.
 395:      *               Empty strings are treated as null.
 396:      * @return Quantification The current object (for fluent API support)
 397:      */
 398:     public function setQuantificationdate($v)
 399:     {
 400:         $dt = PropelDateTime::newInstance($v, null, 'DateTime');
 401:         if ($this->quantificationdate !== null || $dt !== null) {
 402:             $currentDateAsString = ($this->quantificationdate !== null && $tmpDt = new DateTime($this->quantificationdate)) ? $tmpDt->format('Y-m-d H:i:s') : null;
 403:             $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null;
 404:             if ($currentDateAsString !== $newDateAsString) {
 405:                 $this->quantificationdate = $newDateAsString;
 406:                 $this->modifiedColumns[] = QuantificationPeer::QUANTIFICATIONDATE;
 407:             }
 408:         } // if either are not null
 409: 
 410: 
 411:         return $this;
 412:     } // setQuantificationdate()
 413: 
 414:     /**
 415:      * Set the value of [name] column.
 416:      *
 417:      * @param string $v new value
 418:      * @return Quantification The current object (for fluent API support)
 419:      */
 420:     public function setName($v)
 421:     {
 422:         if ($v !== null && is_numeric($v)) {
 423:             $v = (string) $v;
 424:         }
 425: 
 426:         if ($this->name !== $v) {
 427:             $this->name = $v;
 428:             $this->modifiedColumns[] = QuantificationPeer::NAME;
 429:         }
 430: 
 431: 
 432:         return $this;
 433:     } // setName()
 434: 
 435:     /**
 436:      * Set the value of [uri] column.
 437:      *
 438:      * @param string $v new value
 439:      * @return Quantification The current object (for fluent API support)
 440:      */
 441:     public function setUri($v)
 442:     {
 443:         if ($v !== null && is_numeric($v)) {
 444:             $v = (string) $v;
 445:         }
 446: 
 447:         if ($this->uri !== $v) {
 448:             $this->uri = $v;
 449:             $this->modifiedColumns[] = QuantificationPeer::URI;
 450:         }
 451: 
 452: 
 453:         return $this;
 454:     } // setUri()
 455: 
 456:     /**
 457:      * Indicates whether the columns in this object are only set to default values.
 458:      *
 459:      * This method can be used in conjunction with isModified() to indicate whether an object is both
 460:      * modified _and_ has some values set which are non-default.
 461:      *
 462:      * @return boolean Whether the columns in this object are only been set with default values.
 463:      */
 464:     public function hasOnlyDefaultValues()
 465:     {
 466:         // otherwise, everything was equal, so return true
 467:         return true;
 468:     } // hasOnlyDefaultValues()
 469: 
 470:     /**
 471:      * Hydrates (populates) the object variables with values from the database resultset.
 472:      *
 473:      * An offset (0-based "start column") is specified so that objects can be hydrated
 474:      * with a subset of the columns in the resultset rows.  This is needed, for example,
 475:      * for results of JOIN queries where the resultset row includes columns from two or
 476:      * more tables.
 477:      *
 478:      * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM)
 479:      * @param int $startcol 0-based offset column which indicates which restultset column to start with.
 480:      * @param boolean $rehydrate Whether this object is being re-hydrated from the database.
 481:      * @return int             next starting column
 482:      * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
 483:      */
 484:     public function hydrate($row, $startcol = 0, $rehydrate = false)
 485:     {
 486:         try {
 487: 
 488:             $this->quantification_id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null;
 489:             $this->acquisition_id = ($row[$startcol + 1] !== null) ? (int) $row[$startcol + 1] : null;
 490:             $this->operator_id = ($row[$startcol + 2] !== null) ? (int) $row[$startcol + 2] : null;
 491:             $this->protocol_id = ($row[$startcol + 3] !== null) ? (int) $row[$startcol + 3] : null;
 492:             $this->analysis_id = ($row[$startcol + 4] !== null) ? (int) $row[$startcol + 4] : null;
 493:             $this->quantificationdate = ($row[$startcol + 5] !== null) ? (string) $row[$startcol + 5] : null;
 494:             $this->name = ($row[$startcol + 6] !== null) ? (string) $row[$startcol + 6] : null;
 495:             $this->uri = ($row[$startcol + 7] !== null) ? (string) $row[$startcol + 7] : null;
 496:             $this->resetModified();
 497: 
 498:             $this->setNew(false);
 499: 
 500:             if ($rehydrate) {
 501:                 $this->ensureConsistency();
 502:             }
 503:             $this->postHydrate($row, $startcol, $rehydrate);
 504:             return $startcol + 8; // 8 = QuantificationPeer::NUM_HYDRATE_COLUMNS.
 505: 
 506:         } catch (Exception $e) {
 507:             throw new PropelException("Error populating Quantification object", $e);
 508:         }
 509:     }
 510: 
 511:     /**
 512:      * Checks and repairs the internal consistency of the object.
 513:      *
 514:      * This method is executed after an already-instantiated object is re-hydrated
 515:      * from the database.  It exists to check any foreign keys to make sure that
 516:      * the objects related to the current object are correct based on foreign key.
 517:      *
 518:      * You can override this method in the stub class, but you should always invoke
 519:      * the base method from the overridden method (i.e. parent::ensureConsistency()),
 520:      * in case your model changes.
 521:      *
 522:      * @throws PropelException
 523:      */
 524:     public function ensureConsistency()
 525:     {
 526: 
 527:         if ($this->aAcquisition !== null && $this->acquisition_id !== $this->aAcquisition->getAcquisitionId()) {
 528:             $this->aAcquisition = null;
 529:         }
 530:         if ($this->aContact !== null && $this->operator_id !== $this->aContact->getContactId()) {
 531:             $this->aContact = null;
 532:         }
 533:         if ($this->aProtocol !== null && $this->protocol_id !== $this->aProtocol->getProtocolId()) {
 534:             $this->aProtocol = null;
 535:         }
 536:         if ($this->aAnalysis !== null && $this->analysis_id !== $this->aAnalysis->getAnalysisId()) {
 537:             $this->aAnalysis = null;
 538:         }
 539:     } // ensureConsistency
 540: 
 541:     /**
 542:      * Reloads this object from datastore based on primary key and (optionally) resets all associated objects.
 543:      *
 544:      * This will only work if the object has been saved and has a valid primary key set.
 545:      *
 546:      * @param boolean $deep (optional) Whether to also de-associated any related objects.
 547:      * @param PropelPDO $con (optional) The PropelPDO connection to use.
 548:      * @return void
 549:      * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db
 550:      */
 551:     public function reload($deep = false, PropelPDO $con = null)
 552:     {
 553:         if ($this->isDeleted()) {
 554:             throw new PropelException("Cannot reload a deleted object.");
 555:         }
 556: 
 557:         if ($this->isNew()) {
 558:             throw new PropelException("Cannot reload an unsaved object.");
 559:         }
 560: 
 561:         if ($con === null) {
 562:             $con = Propel::getConnection(QuantificationPeer::DATABASE_NAME, Propel::CONNECTION_READ);
 563:         }
 564: 
 565:         // We don't need to alter the object instance pool; we're just modifying this instance
 566:         // already in the pool.
 567: 
 568:         $stmt = QuantificationPeer::doSelectStmt($this->buildPkeyCriteria(), $con);
 569:         $row = $stmt->fetch(PDO::FETCH_NUM);
 570:         $stmt->closeCursor();
 571:         if (!$row) {
 572:             throw new PropelException('Cannot find matching row in the database to reload object values.');
 573:         }
 574:         $this->hydrate($row, 0, true); // rehydrate
 575: 
 576:         if ($deep) {  // also de-associate any related objects?
 577: 
 578:             $this->aAcquisition = null;
 579:             $this->aAnalysis = null;
 580:             $this->aContact = null;
 581:             $this->aProtocol = null;
 582:         } // if (deep)
 583:     }
 584: 
 585:     /**
 586:      * Removes this object from datastore and sets delete attribute.
 587:      *
 588:      * @param PropelPDO $con
 589:      * @return void
 590:      * @throws PropelException
 591:      * @throws Exception
 592:      * @see        BaseObject::setDeleted()
 593:      * @see        BaseObject::isDeleted()
 594:      */
 595:     public function delete(PropelPDO $con = null)
 596:     {
 597:         if ($this->isDeleted()) {
 598:             throw new PropelException("This object has already been deleted.");
 599:         }
 600: 
 601:         if ($con === null) {
 602:             $con = Propel::getConnection(QuantificationPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
 603:         }
 604: 
 605:         $con->beginTransaction();
 606:         try {
 607:             $deleteQuery = QuantificationQuery::create()
 608:                 ->filterByPrimaryKey($this->getPrimaryKey());
 609:             $ret = $this->preDelete($con);
 610:             if ($ret) {
 611:                 $deleteQuery->delete($con);
 612:                 $this->postDelete($con);
 613:                 $con->commit();
 614:                 $this->setDeleted(true);
 615:             } else {
 616:                 $con->commit();
 617:             }
 618:         } catch (Exception $e) {
 619:             $con->rollBack();
 620:             throw $e;
 621:         }
 622:     }
 623: 
 624:     /**
 625:      * Persists this object to the database.
 626:      *
 627:      * If the object is new, it inserts it; otherwise an update is performed.
 628:      * All modified related objects will also be persisted in the doSave()
 629:      * method.  This method wraps all precipitate database operations in a
 630:      * single transaction.
 631:      *
 632:      * @param PropelPDO $con
 633:      * @return int             The number of rows affected by this insert/update and any referring fk objects' save() operations.
 634:      * @throws PropelException
 635:      * @throws Exception
 636:      * @see        doSave()
 637:      */
 638:     public function save(PropelPDO $con = null)
 639:     {
 640:         if ($this->isDeleted()) {
 641:             throw new PropelException("You cannot save an object that has been deleted.");
 642:         }
 643: 
 644:         if ($con === null) {
 645:             $con = Propel::getConnection(QuantificationPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
 646:         }
 647: 
 648:         $con->beginTransaction();
 649:         $isInsert = $this->isNew();
 650:         try {
 651:             $ret = $this->preSave($con);
 652:             if ($isInsert) {
 653:                 $ret = $ret && $this->preInsert($con);
 654:             } else {
 655:                 $ret = $ret && $this->preUpdate($con);
 656:             }
 657:             if ($ret) {
 658:                 $affectedRows = $this->doSave($con);
 659:                 if ($isInsert) {
 660:                     $this->postInsert($con);
 661:                 } else {
 662:                     $this->postUpdate($con);
 663:                 }
 664:                 $this->postSave($con);
 665:                 QuantificationPeer::addInstanceToPool($this);
 666:             } else {
 667:                 $affectedRows = 0;
 668:             }
 669:             $con->commit();
 670: 
 671:             return $affectedRows;
 672:         } catch (Exception $e) {
 673:             $con->rollBack();
 674:             throw $e;
 675:         }
 676:     }
 677: 
 678:     /**
 679:      * Performs the work of inserting or updating the row in the database.
 680:      *
 681:      * If the object is new, it inserts it; otherwise an update is performed.
 682:      * All related objects are also updated in this method.
 683:      *
 684:      * @param PropelPDO $con
 685:      * @return int             The number of rows affected by this insert/update and any referring fk objects' save() operations.
 686:      * @throws PropelException
 687:      * @see        save()
 688:      */
 689:     protected function doSave(PropelPDO $con)
 690:     {
 691:         $affectedRows = 0; // initialize var to track total num of affected rows
 692:         if (!$this->alreadyInSave) {
 693:             $this->alreadyInSave = true;
 694: 
 695:             // We call the save method on the following object(s) if they
 696:             // were passed to this object by their coresponding set
 697:             // method.  This object relates to these object(s) by a
 698:             // foreign key reference.
 699: 
 700:             if ($this->aAcquisition !== null) {
 701:                 if ($this->aAcquisition->isModified() || $this->aAcquisition->isNew()) {
 702:                     $affectedRows += $this->aAcquisition->save($con);
 703:                 }
 704:                 $this->setAcquisition($this->aAcquisition);
 705:             }
 706: 
 707:             if ($this->aAnalysis !== null) {
 708:                 if ($this->aAnalysis->isModified() || $this->aAnalysis->isNew()) {
 709:                     $affectedRows += $this->aAnalysis->save($con);
 710:                 }
 711:                 $this->setAnalysis($this->aAnalysis);
 712:             }
 713: 
 714:             if ($this->aContact !== null) {
 715:                 if ($this->aContact->isModified() || $this->aContact->isNew()) {
 716:                     $affectedRows += $this->aContact->save($con);
 717:                 }
 718:                 $this->setContact($this->aContact);
 719:             }
 720: 
 721:             if ($this->aProtocol !== null) {
 722:                 if ($this->aProtocol->isModified() || $this->aProtocol->isNew()) {
 723:                     $affectedRows += $this->aProtocol->save($con);
 724:                 }
 725:                 $this->setProtocol($this->aProtocol);
 726:             }
 727: 
 728:             if ($this->isNew() || $this->isModified()) {
 729:                 // persist changes
 730:                 if ($this->isNew()) {
 731:                     $this->doInsert($con);
 732:                 } else {
 733:                     $this->doUpdate($con);
 734:                 }
 735:                 $affectedRows += 1;
 736:                 $this->resetModified();
 737:             }
 738: 
 739:             $this->alreadyInSave = false;
 740: 
 741:         }
 742: 
 743:         return $affectedRows;
 744:     } // doSave()
 745: 
 746:     /**
 747:      * Insert the row in the database.
 748:      *
 749:      * @param PropelPDO $con
 750:      *
 751:      * @throws PropelException
 752:      * @see        doSave()
 753:      */
 754:     protected function doInsert(PropelPDO $con)
 755:     {
 756:         $modifiedColumns = array();
 757:         $index = 0;
 758: 
 759:         $this->modifiedColumns[] = QuantificationPeer::QUANTIFICATION_ID;
 760:         if (null !== $this->quantification_id) {
 761:             throw new PropelException('Cannot insert a value for auto-increment primary key (' . QuantificationPeer::QUANTIFICATION_ID . ')');
 762:         }
 763:         if (null === $this->quantification_id) {
 764:             try {
 765:                 $stmt = $con->query("SELECT nextval('quantification_quantification_id_seq')");
 766:                 $row = $stmt->fetch(PDO::FETCH_NUM);
 767:                 $this->quantification_id = $row[0];
 768:             } catch (Exception $e) {
 769:                 throw new PropelException('Unable to get sequence id.', $e);
 770:             }
 771:         }
 772: 
 773: 
 774:          // check the columns in natural order for more readable SQL queries
 775:         if ($this->isColumnModified(QuantificationPeer::QUANTIFICATION_ID)) {
 776:             $modifiedColumns[':p' . $index++]  = '"quantification_id"';
 777:         }
 778:         if ($this->isColumnModified(QuantificationPeer::ACQUISITION_ID)) {
 779:             $modifiedColumns[':p' . $index++]  = '"acquisition_id"';
 780:         }
 781:         if ($this->isColumnModified(QuantificationPeer::OPERATOR_ID)) {
 782:             $modifiedColumns[':p' . $index++]  = '"operator_id"';
 783:         }
 784:         if ($this->isColumnModified(QuantificationPeer::PROTOCOL_ID)) {
 785:             $modifiedColumns[':p' . $index++]  = '"protocol_id"';
 786:         }
 787:         if ($this->isColumnModified(QuantificationPeer::ANALYSIS_ID)) {
 788:             $modifiedColumns[':p' . $index++]  = '"analysis_id"';
 789:         }
 790:         if ($this->isColumnModified(QuantificationPeer::QUANTIFICATIONDATE)) {
 791:             $modifiedColumns[':p' . $index++]  = '"quantificationdate"';
 792:         }
 793:         if ($this->isColumnModified(QuantificationPeer::NAME)) {
 794:             $modifiedColumns[':p' . $index++]  = '"name"';
 795:         }
 796:         if ($this->isColumnModified(QuantificationPeer::URI)) {
 797:             $modifiedColumns[':p' . $index++]  = '"uri"';
 798:         }
 799: 
 800:         $sql = sprintf(
 801:             'INSERT INTO "quantification" (%s) VALUES (%s)',
 802:             implode(', ', $modifiedColumns),
 803:             implode(', ', array_keys($modifiedColumns))
 804:         );
 805: 
 806:         try {
 807:             $stmt = $con->prepare($sql);
 808:             foreach ($modifiedColumns as $identifier => $columnName) {
 809:                 switch ($columnName) {
 810:                     case '"quantification_id"':
 811:                         $stmt->bindValue($identifier, $this->quantification_id, PDO::PARAM_INT);
 812:                         break;
 813:                     case '"acquisition_id"':
 814:                         $stmt->bindValue($identifier, $this->acquisition_id, PDO::PARAM_INT);
 815:                         break;
 816:                     case '"operator_id"':
 817:                         $stmt->bindValue($identifier, $this->operator_id, PDO::PARAM_INT);
 818:                         break;
 819:                     case '"protocol_id"':
 820:                         $stmt->bindValue($identifier, $this->protocol_id, PDO::PARAM_INT);
 821:                         break;
 822:                     case '"analysis_id"':
 823:                         $stmt->bindValue($identifier, $this->analysis_id, PDO::PARAM_INT);
 824:                         break;
 825:                     case '"quantificationdate"':
 826:                         $stmt->bindValue($identifier, $this->quantificationdate, PDO::PARAM_STR);
 827:                         break;
 828:                     case '"name"':
 829:                         $stmt->bindValue($identifier, $this->name, PDO::PARAM_STR);
 830:                         break;
 831:                     case '"uri"':
 832:                         $stmt->bindValue($identifier, $this->uri, PDO::PARAM_STR);
 833:                         break;
 834:                 }
 835:             }
 836:             $stmt->execute();
 837:         } catch (Exception $e) {
 838:             Propel::log($e->getMessage(), Propel::LOG_ERR);
 839:             throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), $e);
 840:         }
 841: 
 842:         $this->setNew(false);
 843:     }
 844: 
 845:     /**
 846:      * Update the row in the database.
 847:      *
 848:      * @param PropelPDO $con
 849:      *
 850:      * @see        doSave()
 851:      */
 852:     protected function doUpdate(PropelPDO $con)
 853:     {
 854:         $selectCriteria = $this->buildPkeyCriteria();
 855:         $valuesCriteria = $this->buildCriteria();
 856:         BasePeer::doUpdate($selectCriteria, $valuesCriteria, $con);
 857:     }
 858: 
 859:     /**
 860:      * Array of ValidationFailed objects.
 861:      * @var        array ValidationFailed[]
 862:      */
 863:     protected $validationFailures = array();
 864: 
 865:     /**
 866:      * Gets any ValidationFailed objects that resulted from last call to validate().
 867:      *
 868:      *
 869:      * @return array ValidationFailed[]
 870:      * @see        validate()
 871:      */
 872:     public function getValidationFailures()
 873:     {
 874:         return $this->validationFailures;
 875:     }
 876: 
 877:     /**
 878:      * Validates the objects modified field values and all objects related to this table.
 879:      *
 880:      * If $columns is either a column name or an array of column names
 881:      * only those columns are validated.
 882:      *
 883:      * @param mixed $columns Column name or an array of column names.
 884:      * @return boolean Whether all columns pass validation.
 885:      * @see        doValidate()
 886:      * @see        getValidationFailures()
 887:      */
 888:     public function validate($columns = null)
 889:     {
 890:         $res = $this->doValidate($columns);
 891:         if ($res === true) {
 892:             $this->validationFailures = array();
 893: 
 894:             return true;
 895:         }
 896: 
 897:         $this->validationFailures = $res;
 898: 
 899:         return false;
 900:     }
 901: 
 902:     /**
 903:      * This function performs the validation work for complex object models.
 904:      *
 905:      * In addition to checking the current object, all related objects will
 906:      * also be validated.  If all pass then <code>true</code> is returned; otherwise
 907:      * an aggreagated array of ValidationFailed objects will be returned.
 908:      *
 909:      * @param array $columns Array of column names to validate.
 910:      * @return mixed <code>true</code> if all validations pass; array of <code>ValidationFailed</code> objets otherwise.
 911:      */
 912:     protected function doValidate($columns = null)
 913:     {
 914:         if (!$this->alreadyInValidation) {
 915:             $this->alreadyInValidation = true;
 916:             $retval = null;
 917: 
 918:             $failureMap = array();
 919: 
 920: 
 921:             // We call the validate method on the following object(s) if they
 922:             // were passed to this object by their coresponding set
 923:             // method.  This object relates to these object(s) by a
 924:             // foreign key reference.
 925: 
 926:             if ($this->aAcquisition !== null) {
 927:                 if (!$this->aAcquisition->validate($columns)) {
 928:                     $failureMap = array_merge($failureMap, $this->aAcquisition->getValidationFailures());
 929:                 }
 930:             }
 931: 
 932:             if ($this->aAnalysis !== null) {
 933:                 if (!$this->aAnalysis->validate($columns)) {
 934:                     $failureMap = array_merge($failureMap, $this->aAnalysis->getValidationFailures());
 935:                 }
 936:             }
 937: 
 938:             if ($this->aContact !== null) {
 939:                 if (!$this->aContact->validate($columns)) {
 940:                     $failureMap = array_merge($failureMap, $this->aContact->getValidationFailures());
 941:                 }
 942:             }
 943: 
 944:             if ($this->aProtocol !== null) {
 945:                 if (!$this->aProtocol->validate($columns)) {
 946:                     $failureMap = array_merge($failureMap, $this->aProtocol->getValidationFailures());
 947:                 }
 948:             }
 949: 
 950: 
 951:             if (($retval = QuantificationPeer::doValidate($this, $columns)) !== true) {
 952:                 $failureMap = array_merge($failureMap, $retval);
 953:             }
 954: 
 955: 
 956: 
 957:             $this->alreadyInValidation = false;
 958:         }
 959: 
 960:         return (!empty($failureMap) ? $failureMap : true);
 961:     }
 962: 
 963:     /**
 964:      * Retrieves a field from the object by name passed in as a string.
 965:      *
 966:      * @param string $name name
 967:      * @param string $type The type of fieldname the $name is of:
 968:      *               one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
 969:      *               BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
 970:      *               Defaults to BasePeer::TYPE_PHPNAME
 971:      * @return mixed Value of field.
 972:      */
 973:     public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
 974:     {
 975:         $pos = QuantificationPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
 976:         $field = $this->getByPosition($pos);
 977: 
 978:         return $field;
 979:     }
 980: 
 981:     /**
 982:      * Retrieves a field from the object by Position as specified in the xml schema.
 983:      * Zero-based.
 984:      *
 985:      * @param int $pos position in xml schema
 986:      * @return mixed Value of field at $pos
 987:      */
 988:     public function getByPosition($pos)
 989:     {
 990:         switch ($pos) {
 991:             case 0:
 992:                 return $this->getQuantificationId();
 993:                 break;
 994:             case 1:
 995:                 return $this->getAcquisitionId();
 996:                 break;
 997:             case 2:
 998:                 return $this->getOperatorId();
 999:                 break;
1000:             case 3:
1001:                 return $this->getProtocolId();
1002:                 break;
1003:             case 4:
1004:                 return $this->getAnalysisId();
1005:                 break;
1006:             case 5:
1007:                 return $this->getQuantificationdate();
1008:                 break;
1009:             case 6:
1010:                 return $this->getName();
1011:                 break;
1012:             case 7:
1013:                 return $this->getUri();
1014:                 break;
1015:             default:
1016:                 return null;
1017:                 break;
1018:         } // switch()
1019:     }
1020: 
1021:     /**
1022:      * Exports the object as an array.
1023:      *
1024:      * You can specify the key type of the array by passing one of the class
1025:      * type constants.
1026:      *
1027:      * @param     string  $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME,
1028:      *                    BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
1029:      *                    Defaults to BasePeer::TYPE_PHPNAME.
1030:      * @param     boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to true.
1031:      * @param     array $alreadyDumpedObjects List of objects to skip to avoid recursion
1032:      * @param     boolean $includeForeignObjects (optional) Whether to include hydrated related objects. Default to FALSE.
1033:      *
1034:      * @return array an associative array containing the field names (as keys) and field values
1035:      */
1036:     public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
1037:     {
1038:         if (isset($alreadyDumpedObjects['Quantification'][$this->getPrimaryKey()])) {
1039:             return '*RECURSION*';
1040:         }
1041:         $alreadyDumpedObjects['Quantification'][$this->getPrimaryKey()] = true;
1042:         $keys = QuantificationPeer::getFieldNames($keyType);
1043:         $result = array(
1044:             $keys[0] => $this->getQuantificationId(),
1045:             $keys[1] => $this->getAcquisitionId(),
1046:             $keys[2] => $this->getOperatorId(),
1047:             $keys[3] => $this->getProtocolId(),
1048:             $keys[4] => $this->getAnalysisId(),
1049:             $keys[5] => $this->getQuantificationdate(),
1050:             $keys[6] => $this->getName(),
1051:             $keys[7] => $this->getUri(),
1052:         );
1053:         if ($includeForeignObjects) {
1054:             if (null !== $this->aAcquisition) {
1055:                 $result['Acquisition'] = $this->aAcquisition->toArray($keyType, $includeLazyLoadColumns,  $alreadyDumpedObjects, true);
1056:             }
1057:             if (null !== $this->aAnalysis) {
1058:                 $result['Analysis'] = $this->aAnalysis->toArray($keyType, $includeLazyLoadColumns,  $alreadyDumpedObjects, true);
1059:             }
1060:             if (null !== $this->aContact) {
1061:                 $result['Contact'] = $this->aContact->toArray($keyType, $includeLazyLoadColumns,  $alreadyDumpedObjects, true);
1062:             }
1063:             if (null !== $this->aProtocol) {
1064:                 $result['Protocol'] = $this->aProtocol->toArray($keyType, $includeLazyLoadColumns,  $alreadyDumpedObjects, true);
1065:             }
1066:         }
1067: 
1068:         return $result;
1069:     }
1070: 
1071:     /**
1072:      * Sets a field from the object by name passed in as a string.
1073:      *
1074:      * @param string $name peer name
1075:      * @param mixed $value field value
1076:      * @param string $type The type of fieldname the $name is of:
1077:      *                     one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
1078:      *                     BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
1079:      *                     Defaults to BasePeer::TYPE_PHPNAME
1080:      * @return void
1081:      */
1082:     public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
1083:     {
1084:         $pos = QuantificationPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
1085: 
1086:         $this->setByPosition($pos, $value);
1087:     }
1088: 
1089:     /**
1090:      * Sets a field from the object by Position as specified in the xml schema.
1091:      * Zero-based.
1092:      *
1093:      * @param int $pos position in xml schema
1094:      * @param mixed $value field value
1095:      * @return void
1096:      */
1097:     public function setByPosition($pos, $value)
1098:     {
1099:         switch ($pos) {
1100:             case 0:
1101:                 $this->setQuantificationId($value);
1102:                 break;
1103:             case 1:
1104:                 $this->setAcquisitionId($value);
1105:                 break;
1106:             case 2:
1107:                 $this->setOperatorId($value);
1108:                 break;
1109:             case 3:
1110:                 $this->setProtocolId($value);
1111:                 break;
1112:             case 4:
1113:                 $this->setAnalysisId($value);
1114:                 break;
1115:             case 5:
1116:                 $this->setQuantificationdate($value);
1117:                 break;
1118:             case 6:
1119:                 $this->setName($value);
1120:                 break;
1121:             case 7:
1122:                 $this->setUri($value);
1123:                 break;
1124:         } // switch()
1125:     }
1126: 
1127:     /**
1128:      * Populates the object using an array.
1129:      *
1130:      * This is particularly useful when populating an object from one of the
1131:      * request arrays (e.g. $_POST).  This method goes through the column
1132:      * names, checking to see whether a matching key exists in populated
1133:      * array. If so the setByName() method is called for that column.
1134:      *
1135:      * You can specify the key type of the array by additionally passing one
1136:      * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME,
1137:      * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
1138:      * The default key type is the column's BasePeer::TYPE_PHPNAME
1139:      *
1140:      * @param array  $arr     An array to populate the object from.
1141:      * @param string $keyType The type of keys the array uses.
1142:      * @return void
1143:      */
1144:     public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
1145:     {
1146:         $keys = QuantificationPeer::getFieldNames($keyType);
1147: 
1148:         if (array_key_exists($keys[0], $arr)) $this->setQuantificationId($arr[$keys[0]]);
1149:         if (array_key_exists($keys[1], $arr)) $this->setAcquisitionId($arr[$keys[1]]);
1150:         if (array_key_exists($keys[2], $arr)) $this->setOperatorId($arr[$keys[2]]);
1151:         if (array_key_exists($keys[3], $arr)) $this->setProtocolId($arr[$keys[3]]);
1152:         if (array_key_exists($keys[4], $arr)) $this->setAnalysisId($arr[$keys[4]]);
1153:         if (array_key_exists($keys[5], $arr)) $this->setQuantificationdate($arr[$keys[5]]);
1154:         if (array_key_exists($keys[6], $arr)) $this->setName($arr[$keys[6]]);
1155:         if (array_key_exists($keys[7], $arr)) $this->setUri($arr[$keys[7]]);
1156:     }
1157: 
1158:     /**
1159:      * Build a Criteria object containing the values of all modified columns in this object.
1160:      *
1161:      * @return Criteria The Criteria object containing all modified values.
1162:      */
1163:     public function buildCriteria()
1164:     {
1165:         $criteria = new Criteria(QuantificationPeer::DATABASE_NAME);
1166: 
1167:         if ($this->isColumnModified(QuantificationPeer::QUANTIFICATION_ID)) $criteria->add(QuantificationPeer::QUANTIFICATION_ID, $this->quantification_id);
1168:         if ($this->isColumnModified(QuantificationPeer::ACQUISITION_ID)) $criteria->add(QuantificationPeer::ACQUISITION_ID, $this->acquisition_id);
1169:         if ($this->isColumnModified(QuantificationPeer::OPERATOR_ID)) $criteria->add(QuantificationPeer::OPERATOR_ID, $this->operator_id);
1170:         if ($this->isColumnModified(QuantificationPeer::PROTOCOL_ID)) $criteria->add(QuantificationPeer::PROTOCOL_ID, $this->protocol_id);
1171:         if ($this->isColumnModified(QuantificationPeer::ANALYSIS_ID)) $criteria->add(QuantificationPeer::ANALYSIS_ID, $this->analysis_id);
1172:         if ($this->isColumnModified(QuantificationPeer::QUANTIFICATIONDATE)) $criteria->add(QuantificationPeer::QUANTIFICATIONDATE, $this->quantificationdate);
1173:         if ($this->isColumnModified(QuantificationPeer::NAME)) $criteria->add(QuantificationPeer::NAME, $this->name);
1174:         if ($this->isColumnModified(QuantificationPeer::URI)) $criteria->add(QuantificationPeer::URI, $this->uri);
1175: 
1176:         return $criteria;
1177:     }
1178: 
1179:     /**
1180:      * Builds a Criteria object containing the primary key for this object.
1181:      *
1182:      * Unlike buildCriteria() this method includes the primary key values regardless
1183:      * of whether or not they have been modified.
1184:      *
1185:      * @return Criteria The Criteria object containing value(s) for primary key(s).
1186:      */
1187:     public function buildPkeyCriteria()
1188:     {
1189:         $criteria = new Criteria(QuantificationPeer::DATABASE_NAME);
1190:         $criteria->add(QuantificationPeer::QUANTIFICATION_ID, $this->quantification_id);
1191: 
1192:         return $criteria;
1193:     }
1194: 
1195:     /**
1196:      * Returns the primary key for this object (row).
1197:      * @return int
1198:      */
1199:     public function getPrimaryKey()
1200:     {
1201:         return $this->getQuantificationId();
1202:     }
1203: 
1204:     /**
1205:      * Generic method to set the primary key (quantification_id column).
1206:      *
1207:      * @param  int $key Primary key.
1208:      * @return void
1209:      */
1210:     public function setPrimaryKey($key)
1211:     {
1212:         $this->setQuantificationId($key);
1213:     }
1214: 
1215:     /**
1216:      * Returns true if the primary key for this object is null.
1217:      * @return boolean
1218:      */
1219:     public function isPrimaryKeyNull()
1220:     {
1221: 
1222:         return null === $this->getQuantificationId();
1223:     }
1224: 
1225:     /**
1226:      * Sets contents of passed object to values from current object.
1227:      *
1228:      * If desired, this method can also make copies of all associated (fkey referrers)
1229:      * objects.
1230:      *
1231:      * @param object $copyObj An object of Quantification (or compatible) type.
1232:      * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
1233:      * @param boolean $makeNew Whether to reset autoincrement PKs and make the object new.
1234:      * @throws PropelException
1235:      */
1236:     public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
1237:     {
1238:         $copyObj->setAcquisitionId($this->getAcquisitionId());
1239:         $copyObj->setOperatorId($this->getOperatorId());
1240:         $copyObj->setProtocolId($this->getProtocolId());
1241:         $copyObj->setAnalysisId($this->getAnalysisId());
1242:         $copyObj->setQuantificationdate($this->getQuantificationdate());
1243:         $copyObj->setName($this->getName());
1244:         $copyObj->setUri($this->getUri());
1245: 
1246:         if ($deepCopy && !$this->startCopy) {
1247:             // important: temporarily setNew(false) because this affects the behavior of
1248:             // the getter/setter methods for fkey referrer objects.
1249:             $copyObj->setNew(false);
1250:             // store object hash to prevent cycle
1251:             $this->startCopy = true;
1252: 
1253:             //unflag object copy
1254:             $this->startCopy = false;
1255:         } // if ($deepCopy)
1256: 
1257:         if ($makeNew) {
1258:             $copyObj->setNew(true);
1259:             $copyObj->setQuantificationId(NULL); // this is a auto-increment column, so set to default value
1260:         }
1261:     }
1262: 
1263:     /**
1264:      * Makes a copy of this object that will be inserted as a new row in table when saved.
1265:      * It creates a new object filling in the simple attributes, but skipping any primary
1266:      * keys that are defined for the table.
1267:      *
1268:      * If desired, this method can also make copies of all associated (fkey referrers)
1269:      * objects.
1270:      *
1271:      * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
1272:      * @return Quantification Clone of current object.
1273:      * @throws PropelException
1274:      */
1275:     public function copy($deepCopy = false)
1276:     {
1277:         // we use get_class(), because this might be a subclass
1278:         $clazz = get_class($this);
1279:         $copyObj = new $clazz();
1280:         $this->copyInto($copyObj, $deepCopy);
1281: 
1282:         return $copyObj;
1283:     }
1284: 
1285:     /**
1286:      * Returns a peer instance associated with this om.
1287:      *
1288:      * Since Peer classes are not to have any instance attributes, this method returns the
1289:      * same instance for all member of this class. The method could therefore
1290:      * be static, but this would prevent one from overriding the behavior.
1291:      *
1292:      * @return QuantificationPeer
1293:      */
1294:     public function getPeer()
1295:     {
1296:         if (self::$peer === null) {
1297:             self::$peer = new QuantificationPeer();
1298:         }
1299: 
1300:         return self::$peer;
1301:     }
1302: 
1303:     /**
1304:      * Declares an association between this object and a Acquisition object.
1305:      *
1306:      * @param             Acquisition $v
1307:      * @return Quantification The current object (for fluent API support)
1308:      * @throws PropelException
1309:      */
1310:     public function setAcquisition(Acquisition $v = null)
1311:     {
1312:         if ($v === null) {
1313:             $this->setAcquisitionId(NULL);
1314:         } else {
1315:             $this->setAcquisitionId($v->getAcquisitionId());
1316:         }
1317: 
1318:         $this->aAcquisition = $v;
1319: 
1320:         // Add binding for other direction of this n:n relationship.
1321:         // If this object has already been added to the Acquisition object, it will not be re-added.
1322:         if ($v !== null) {
1323:             $v->addQuantification($this);
1324:         }
1325: 
1326: 
1327:         return $this;
1328:     }
1329: 
1330: 
1331:     /**
1332:      * Get the associated Acquisition object
1333:      *
1334:      * @param PropelPDO $con Optional Connection object.
1335:      * @param $doQuery Executes a query to get the object if required
1336:      * @return Acquisition The associated Acquisition object.
1337:      * @throws PropelException
1338:      */
1339:     public function getAcquisition(PropelPDO $con = null, $doQuery = true)
1340:     {
1341:         if ($this->aAcquisition === null && ($this->acquisition_id !== null) && $doQuery) {
1342:             $this->aAcquisition = AcquisitionQuery::create()->findPk($this->acquisition_id, $con);
1343:             /* The following can be used additionally to
1344:                 guarantee the related object contains a reference
1345:                 to this object.  This level of coupling may, however, be
1346:                 undesirable since it could result in an only partially populated collection
1347:                 in the referenced object.
1348:                 $this->aAcquisition->addQuantifications($this);
1349:              */
1350:         }
1351: 
1352:         return $this->aAcquisition;
1353:     }
1354: 
1355:     /**
1356:      * Declares an association between this object and a Analysis object.
1357:      *
1358:      * @param             Analysis $v
1359:      * @return Quantification The current object (for fluent API support)
1360:      * @throws PropelException
1361:      */
1362:     public function setAnalysis(Analysis $v = null)
1363:     {
1364:         if ($v === null) {
1365:             $this->setAnalysisId(NULL);
1366:         } else {
1367:             $this->setAnalysisId($v->getAnalysisId());
1368:         }
1369: 
1370:         $this->aAnalysis = $v;
1371: 
1372:         // Add binding for other direction of this n:n relationship.
1373:         // If this object has already been added to the Analysis object, it will not be re-added.
1374:         if ($v !== null) {
1375:             $v->addQuantification($this);
1376:         }
1377: 
1378: 
1379:         return $this;
1380:     }
1381: 
1382: 
1383:     /**
1384:      * Get the associated Analysis object
1385:      *
1386:      * @param PropelPDO $con Optional Connection object.
1387:      * @param $doQuery Executes a query to get the object if required
1388:      * @return Analysis The associated Analysis object.
1389:      * @throws PropelException
1390:      */
1391:     public function getAnalysis(PropelPDO $con = null, $doQuery = true)
1392:     {
1393:         if ($this->aAnalysis === null && ($this->analysis_id !== null) && $doQuery) {
1394:             $this->aAnalysis = AnalysisQuery::create()->findPk($this->analysis_id, $con);
1395:             /* The following can be used additionally to
1396:                 guarantee the related object contains a reference
1397:                 to this object.  This level of coupling may, however, be
1398:                 undesirable since it could result in an only partially populated collection
1399:                 in the referenced object.
1400:                 $this->aAnalysis->addQuantifications($this);
1401:              */
1402:         }
1403: 
1404:         return $this->aAnalysis;
1405:     }
1406: 
1407:     /**
1408:      * Declares an association between this object and a Contact object.
1409:      *
1410:      * @param             Contact $v
1411:      * @return Quantification The current object (for fluent API support)
1412:      * @throws PropelException
1413:      */
1414:     public function setContact(Contact $v = null)
1415:     {
1416:         if ($v === null) {
1417:             $this->setOperatorId(NULL);
1418:         } else {
1419:             $this->setOperatorId($v->getContactId());
1420:         }
1421: 
1422:         $this->aContact = $v;
1423: 
1424:         // Add binding for other direction of this n:n relationship.
1425:         // If this object has already been added to the Contact object, it will not be re-added.
1426:         if ($v !== null) {
1427:             $v->addQuantification($this);
1428:         }
1429: 
1430: 
1431:         return $this;
1432:     }
1433: 
1434: 
1435:     /**
1436:      * Get the associated Contact object
1437:      *
1438:      * @param PropelPDO $con Optional Connection object.
1439:      * @param $doQuery Executes a query to get the object if required
1440:      * @return Contact The associated Contact object.
1441:      * @throws PropelException
1442:      */
1443:     public function getContact(PropelPDO $con = null, $doQuery = true)
1444:     {
1445:         if ($this->aContact === null && ($this->operator_id !== null) && $doQuery) {
1446:             $this->aContact = ContactQuery::create()->findPk($this->operator_id, $con);
1447:             /* The following can be used additionally to
1448:                 guarantee the related object contains a reference
1449:                 to this object.  This level of coupling may, however, be
1450:                 undesirable since it could result in an only partially populated collection
1451:                 in the referenced object.
1452:                 $this->aContact->addQuantifications($this);
1453:              */
1454:         }
1455: 
1456:         return $this->aContact;
1457:     }
1458: 
1459:     /**
1460:      * Declares an association between this object and a Protocol object.
1461:      *
1462:      * @param             Protocol $v
1463:      * @return Quantification The current object (for fluent API support)
1464:      * @throws PropelException
1465:      */
1466:     public function setProtocol(Protocol $v = null)
1467:     {
1468:         if ($v === null) {
1469:             $this->setProtocolId(NULL);
1470:         } else {
1471:             $this->setProtocolId($v->getProtocolId());
1472:         }
1473: 
1474:         $this->aProtocol = $v;
1475: 
1476:         // Add binding for other direction of this n:n relationship.
1477:         // If this object has already been added to the Protocol object, it will not be re-added.
1478:         if ($v !== null) {
1479:             $v->addQuantification($this);
1480:         }
1481: 
1482: 
1483:         return $this;
1484:     }
1485: 
1486: 
1487:     /**
1488:      * Get the associated Protocol object
1489:      *
1490:      * @param PropelPDO $con Optional Connection object.
1491:      * @param $doQuery Executes a query to get the object if required
1492:      * @return Protocol The associated Protocol object.
1493:      * @throws PropelException
1494:      */
1495:     public function getProtocol(PropelPDO $con = null, $doQuery = true)
1496:     {
1497:         if ($this->aProtocol === null && ($this->protocol_id !== null) && $doQuery) {
1498:             $this->aProtocol = ProtocolQuery::create()->findPk($this->protocol_id, $con);
1499:             /* The following can be used additionally to
1500:                 guarantee the related object contains a reference
1501:                 to this object.  This level of coupling may, however, be
1502:                 undesirable since it could result in an only partially populated collection
1503:                 in the referenced object.
1504:                 $this->aProtocol->addQuantifications($this);
1505:              */
1506:         }
1507: 
1508:         return $this->aProtocol;
1509:     }
1510: 
1511:     /**
1512:      * Clears the current object and sets all attributes to their default values
1513:      */
1514:     public function clear()
1515:     {
1516:         $this->quantification_id = null;
1517:         $this->acquisition_id = null;
1518:         $this->operator_id = null;
1519:         $this->protocol_id = null;
1520:         $this->analysis_id = null;
1521:         $this->quantificationdate = null;
1522:         $this->name = null;
1523:         $this->uri = null;
1524:         $this->alreadyInSave = false;
1525:         $this->alreadyInValidation = false;
1526:         $this->alreadyInClearAllReferencesDeep = false;
1527:         $this->clearAllReferences();
1528:         $this->applyDefaultValues();
1529:         $this->resetModified();
1530:         $this->setNew(true);
1531:         $this->setDeleted(false);
1532:     }
1533: 
1534:     /**
1535:      * Resets all references to other model objects or collections of model objects.
1536:      *
1537:      * This method is a user-space workaround for PHP's inability to garbage collect
1538:      * objects with circular references (even in PHP 5.3). This is currently necessary
1539:      * when using Propel in certain daemon or large-volumne/high-memory operations.
1540:      *
1541:      * @param boolean $deep Whether to also clear the references on all referrer objects.
1542:      */
1543:     public function clearAllReferences($deep = false)
1544:     {
1545:         if ($deep && !$this->alreadyInClearAllReferencesDeep) {
1546:             $this->alreadyInClearAllReferencesDeep = true;
1547:             if ($this->aAcquisition instanceof Persistent) {
1548:               $this->aAcquisition->clearAllReferences($deep);
1549:             }
1550:             if ($this->aAnalysis instanceof Persistent) {
1551:               $this->aAnalysis->clearAllReferences($deep);
1552:             }
1553:             if ($this->aContact instanceof Persistent) {
1554:               $this->aContact->clearAllReferences($deep);
1555:             }
1556:             if ($this->aProtocol instanceof Persistent) {
1557:               $this->aProtocol->clearAllReferences($deep);
1558:             }
1559: 
1560:             $this->alreadyInClearAllReferencesDeep = false;
1561:         } // if ($deep)
1562: 
1563:         $this->aAcquisition = null;
1564:         $this->aAnalysis = null;
1565:         $this->aContact = null;
1566:         $this->aProtocol = null;
1567:     }
1568: 
1569:     /**
1570:      * return the string representation of this object
1571:      *
1572:      * @return string
1573:      */
1574:     public function __toString()
1575:     {
1576:         return (string) $this->exportTo(QuantificationPeer::DEFAULT_STRING_FORMAT);
1577:     }
1578: 
1579:     /**
1580:      * return true is the object is in saving state
1581:      *
1582:      * @return boolean
1583:      */
1584:     public function isAlreadyInSave()
1585:     {
1586:         return $this->alreadyInSave;
1587:     }
1588: 
1589: }
1590: 
tbro API documentation generated by ApiGen 2.8.0