lib-model-om
[ class tree: lib-model-om ] [ index: lib-model-om ] [ all elements ]

Source for file BaseEtvaVolumegroup.php

Documentation is available at BaseEtvaVolumegroup.php

  1. <?php
  2.  
  3. /**
  4.  * Base class that represents a row from the 'volumegroup' table.
  5.  *
  6.  * 
  7.  *
  8.  * This class was autogenerated by Propel 1.3.0-dev on:
  9.  *
  10.  * Thu Jun 18 14:28:38 2009
  11.  *
  12.  * @package    lib.model.om
  13.  */
  14. abstract class BaseEtvaVolumegroup extends BaseObject  implements Persistent {
  15.  
  16.  
  17.   const PEER = 'EtvaVolumegroupPeer';
  18.  
  19.     /**
  20.      * The Peer class.
  21.      * Instance provides a convenient way of calling static methods on a class
  22.      * that calling code may not be able to identify.
  23.      * @var        EtvaVolumegroupPeer 
  24.      */
  25.     protected static $peer;
  26.  
  27.     /**
  28.      * The value for the id field.
  29.      * @var        int 
  30.      */
  31.     protected $id;
  32.  
  33.     /**
  34.      * The value for the node_id field.
  35.      * @var        int 
  36.      */
  37.     protected $node_id;
  38.  
  39.     /**
  40.      * The value for the vg field.
  41.      * @var        string 
  42.      */
  43.     protected $vg;
  44.  
  45.     /**
  46.      * The value for the size field.
  47.      * @var        string 
  48.      */
  49.     protected $size;
  50.  
  51.     /**
  52.      * The value for the freesize field.
  53.      * @var        string 
  54.      */
  55.     protected $freesize;
  56.  
  57.     /**
  58.      * @var        EtvaNode 
  59.      */
  60.     protected $aEtvaNode;
  61.  
  62.     /**
  63.      * @var        array EtvaLogicalvolume[] Collection to store aggregation of EtvaLogicalvolume objects.
  64.      */
  65.     protected $collEtvaLogicalvolumes;
  66.  
  67.     /**
  68.      * @var        Criteria The criteria used to select the current contents of collEtvaLogicalvolumes.
  69.      */
  70.     private $lastEtvaLogicalvolumeCriteria null;
  71.  
  72.     /**
  73.      * @var        array EtvaVolumePhysical[] Collection to store aggregation of EtvaVolumePhysical objects.
  74.      */
  75.     protected $collEtvaVolumePhysicals;
  76.  
  77.     /**
  78.      * @var        Criteria The criteria used to select the current contents of collEtvaVolumePhysicals.
  79.      */
  80.     private $lastEtvaVolumePhysicalCriteria null;
  81.  
  82.     /**
  83.      * Flag to prevent endless save loop, if this object is referenced
  84.      * by another object which falls in this transaction.
  85.      * @var        boolean 
  86.      */
  87.     protected $alreadyInSave = false;
  88.  
  89.     /**
  90.      * Flag to prevent endless validation loop, if this object is referenced
  91.      * by another object which falls in this transaction.
  92.      * @var        boolean 
  93.      */
  94.     protected $alreadyInValidation = false;
  95.  
  96.     /**
  97.      * Initializes internal state of BaseEtvaVolumegroup object.
  98.      * @see        applyDefaults()
  99.      */
  100.     public function __construct()
  101.     {
  102.         parent::__construct();
  103.         $this->applyDefaultValues();
  104.     }
  105.  
  106.     /**
  107.      * Applies default values to this object.
  108.      * This method should be called from the object's constructor (or
  109.      * equivalent initialization method).
  110.      * @see        __construct()
  111.      */
  112.     public function applyDefaultValues()
  113.     {
  114.     }
  115.  
  116.     /**
  117.      * Get the [id] column value.
  118.      * 
  119.      * @return     int 
  120.      */
  121.     public function getId()
  122.     {
  123.         return $this->id;
  124.     }
  125.  
  126.     /**
  127.      * Get the [node_id] column value.
  128.      * 
  129.      * @return     int 
  130.      */
  131.     public function getNodeId()
  132.     {
  133.         return $this->node_id;
  134.     }
  135.  
  136.     /**
  137.      * Get the [vg] column value.
  138.      * 
  139.      * @return     string 
  140.      */
  141.     public function getVg()
  142.     {
  143.         return $this->vg;
  144.     }
  145.  
  146.     /**
  147.      * Get the [size] column value.
  148.      * 
  149.      * @return     string 
  150.      */
  151.     public function getSize()
  152.     {
  153.         return $this->size;
  154.     }
  155.  
  156.     /**
  157.      * Get the [freesize] column value.
  158.      * 
  159.      * @return     string 
  160.      */
  161.     public function getFreesize()
  162.     {
  163.         return $this->freesize;
  164.     }
  165.  
  166.     /**
  167.      * Set the value of [id] column.
  168.      * 
  169.      * @param      int $v new value
  170.      * @return     EtvaVolumegroup The current object (for fluent API support)
  171.      */
  172.     public function setId($v)
  173.     {
  174.         if ($v !== null{
  175.             $v = (int) $v;
  176.         }
  177.  
  178.         if ($this->id !== $v{
  179.             $this->id = $v;
  180.             $this->modifiedColumns[EtvaVolumegroupPeer::ID;
  181.         }
  182.  
  183.         return $this;
  184.     // setId()
  185.  
  186.     /**
  187.      * Set the value of [node_id] column.
  188.      * 
  189.      * @param      int $v new value
  190.      * @return     EtvaVolumegroup The current object (for fluent API support)
  191.      */
  192.     public function setNodeId($v)
  193.     {
  194.         if ($v !== null{
  195.             $v = (int) $v;
  196.         }
  197.  
  198.         if ($this->node_id !== $v{
  199.             $this->node_id = $v;
  200.             $this->modifiedColumns[EtvaVolumegroupPeer::NODE_ID;
  201.         }
  202.  
  203.         if ($this->aEtvaNode !== null && $this->aEtvaNode->getId(!== $v{
  204.             $this->aEtvaNode = null;
  205.         }
  206.  
  207.         return $this;
  208.     // setNodeId()
  209.  
  210.     /**
  211.      * Set the value of [vg] column.
  212.      * 
  213.      * @param      string $v new value
  214.      * @return     EtvaVolumegroup The current object (for fluent API support)
  215.      */
  216.     public function setVg($v)
  217.     {
  218.         if ($v !== null{
  219.             $v = (string) $v;
  220.         }
  221.  
  222.         if ($this->vg !== $v{
  223.             $this->vg = $v;
  224.             $this->modifiedColumns[EtvaVolumegroupPeer::VG;
  225.         }
  226.  
  227.         return $this;
  228.     // setVg()
  229.  
  230.     /**
  231.      * Set the value of [size] column.
  232.      * 
  233.      * @param      string $v new value
  234.      * @return     EtvaVolumegroup The current object (for fluent API support)
  235.      */
  236.     public function setSize($v)
  237.     {
  238.         if ($v !== null{
  239.             $v = (string) $v;
  240.         }
  241.  
  242.         if ($this->size !== $v{
  243.             $this->size = $v;
  244.             $this->modifiedColumns[EtvaVolumegroupPeer::SIZE;
  245.         }
  246.  
  247.         return $this;
  248.     // setSize()
  249.  
  250.     /**
  251.      * Set the value of [freesize] column.
  252.      * 
  253.      * @param      string $v new value
  254.      * @return     EtvaVolumegroup The current object (for fluent API support)
  255.      */
  256.     public function setFreesize($v)
  257.     {
  258.         if ($v !== null{
  259.             $v = (string) $v;
  260.         }
  261.  
  262.         if ($this->freesize !== $v{
  263.             $this->freesize = $v;
  264.             $this->modifiedColumns[EtvaVolumegroupPeer::FREESIZE;
  265.         }
  266.  
  267.         return $this;
  268.     // setFreesize()
  269.  
  270.     /**
  271.      * Indicates whether the columns in this object are only set to default values.
  272.      *
  273.      * This method can be used in conjunction with isModified() to indicate whether an object is both
  274.      * modified _and_ has some values set which are non-default.
  275.      *
  276.      * @return     boolean Whether the columns in this object are only been set with default values.
  277.      */
  278.     public function hasOnlyDefaultValues()
  279.     {
  280.             // First, ensure that we don't have any columns that have been modified which aren't default columns.
  281.             if (array_diff($this->modifiedColumnsarray())) {
  282.                 return false;
  283.             }
  284.  
  285.         // otherwise, everything was equal, so return TRUE
  286.         return true;
  287.     // hasOnlyDefaultValues()
  288.  
  289.     /**
  290.      * Hydrates (populates) the object variables with values from the database resultset.
  291.      *
  292.      * An offset (0-based "start column") is specified so that objects can be hydrated
  293.      * with a subset of the columns in the resultset rows.  This is needed, for example,
  294.      * for results of JOIN queries where the resultset row includes columns from two or
  295.      * more tables.
  296.      *
  297.      * @param      array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM)
  298.      * @param      int $startcol 0-based offset column which indicates which restultset column to start with.
  299.      * @param      boolean $rehydrate Whether this object is being re-hydrated from the database.
  300.      * @return     int next starting column
  301.      * @throws     PropelException  - Any caught Exception will be rewrapped as a PropelException.
  302.      */
  303.     public function hydrate($row$startcol 0$rehydrate false)
  304.     {
  305.         try {
  306.  
  307.             $this->id = ($row[$startcol 0!== null? (int) $row[$startcol 0null;
  308.             $this->node_id = ($row[$startcol 1!== null? (int) $row[$startcol 1null;
  309.             $this->vg = ($row[$startcol 2!== null? (string) $row[$startcol 2null;
  310.             $this->size = ($row[$startcol 3!== null? (string) $row[$startcol 3null;
  311.             $this->freesize = ($row[$startcol 4!== null? (string) $row[$startcol 4null;
  312.             $this->resetModified();
  313.  
  314.             $this->setNew(false);
  315.  
  316.             if ($rehydrate{
  317.                 $this->ensureConsistency();
  318.             }
  319.  
  320.             // FIXME - using NUM_COLUMNS may be clearer.
  321.             return $startcol 5// 5 = EtvaVolumegroupPeer::NUM_COLUMNS - EtvaVolumegroupPeer::NUM_LAZY_LOAD_COLUMNS).
  322.  
  323.         catch (Exception $e{
  324.             throw new PropelException("Error populating EtvaVolumegroup object"$e);
  325.         }
  326.     }
  327.  
  328.     /**
  329.      * Checks and repairs the internal consistency of the object.
  330.      *
  331.      * This method is executed after an already-instantiated object is re-hydrated
  332.      * from the database.  It exists to check any foreign keys to make sure that
  333.      * the objects related to the current object are correct based on foreign key.
  334.      *
  335.      * You can override this method in the stub class, but you should always invoke
  336.      * the base method from the overridden method (i.e. parent::ensureConsistency()),
  337.      * in case your model changes.
  338.      *
  339.      * @throws     PropelException
  340.      */
  341.     public function ensureConsistency()
  342.     {
  343.  
  344.         if ($this->aEtvaNode !== null && $this->node_id !== $this->aEtvaNode->getId()) {
  345.             $this->aEtvaNode = null;
  346.         }
  347.     // ensureConsistency
  348.  
  349.     /**
  350.      * Reloads this object from datastore based on primary key and (optionally) resets all associated objects.
  351.      *
  352.      * This will only work if the object has been saved and has a valid primary key set.
  353.      *
  354.      * @param      boolean $deep (optional) Whether to also de-associated any related objects.
  355.      * @param      PropelPDO $con (optional) The PropelPDO connection to use.
  356.      * @return     void 
  357.      * @throws     PropelException - if this object is deleted, unsaved or doesn't have pk match in db
  358.      */
  359.     public function reload($deep falsePropelPDO $con null)
  360.     {
  361.         if ($this->isDeleted()) {
  362.             throw new PropelException("Cannot reload a deleted object.");
  363.         }
  364.  
  365.         if ($this->isNew()) {
  366.             throw new PropelException("Cannot reload an unsaved object.");
  367.         }
  368.  
  369.         if ($con === null{
  370.             $con Propel::getConnection(EtvaVolumegroupPeer::DATABASE_NAMEPropel::CONNECTION_READ);
  371.         }
  372.  
  373.         // We don't need to alter the object instance pool; we're just modifying this instance
  374.         // already in the pool.
  375.  
  376.         $stmt EtvaVolumegroupPeer::doSelectStmt($this->buildPkeyCriteria()$con);
  377.         $row $stmt->fetch(PDO::FETCH_NUM);
  378.         $stmt->closeCursor();
  379.         if (!$row{
  380.             throw new PropelException('Cannot find matching row in the database to reload object values.');
  381.         }
  382.         $this->hydrate($row0true)// rehydrate
  383.  
  384.         if ($deep{  // also de-associate any related objects?
  385.  
  386.             $this->aEtvaNode = null;
  387.             $this->collEtvaLogicalvolumes = null;
  388.             $this->lastEtvaLogicalvolumeCriteria null;
  389.  
  390.             $this->collEtvaVolumePhysicals = null;
  391.             $this->lastEtvaVolumePhysicalCriteria null;
  392.  
  393.         // if (deep)
  394.     }
  395.  
  396.     /**
  397.      * Removes this object from datastore and sets delete attribute.
  398.      *
  399.      * @param      PropelPDO $con 
  400.      * @return     void 
  401.      * @throws     PropelException
  402.      * @see        BaseObject::setDeleted()
  403.      * @see        BaseObject::isDeleted()
  404.      */
  405.     public function delete(PropelPDO $con null)
  406.     {
  407.  
  408.     foreach (sfMixer::getCallables('BaseEtvaVolumegroup:delete:pre'as $callable)
  409.     {
  410.       $ret call_user_func($callable$this$con);
  411.       if ($ret)
  412.       {
  413.         return;
  414.       }
  415.     }
  416.  
  417.  
  418.         if ($this->isDeleted()) {
  419.             throw new PropelException("This object has already been deleted.");
  420.         }
  421.  
  422.         if ($con === null{
  423.             $con Propel::getConnection(EtvaVolumegroupPeer::DATABASE_NAMEPropel::CONNECTION_WRITE);
  424.         }
  425.         
  426.         $con->beginTransaction();
  427.         try {
  428.             EtvaVolumegroupPeer::doDelete($this$con);
  429.             $this->setDeleted(true);
  430.             $con->commit();
  431.         catch (PropelException $e{
  432.             $con->rollBack();
  433.             throw $e;
  434.         }
  435.     
  436.  
  437.     foreach (sfMixer::getCallables('BaseEtvaVolumegroup:delete:post'as $callable)
  438.     {
  439.       call_user_func($callable$this$con);
  440.     }
  441.  
  442.   }
  443.     /**
  444.      * Persists this object to the database.
  445.      *
  446.      * If the object is new, it inserts it; otherwise an update is performed.
  447.      * All modified related objects will also be persisted in the doSave()
  448.      * method.  This method wraps all precipitate database operations in a
  449.      * single transaction.
  450.      *
  451.      * @param      PropelPDO $con 
  452.      * @return     int The number of rows affected by this insert/update and any referring fk objects' save() operations.
  453.      * @throws     PropelException
  454.      * @see        doSave()
  455.      */
  456.     public function save(PropelPDO $con null)
  457.     {
  458.  
  459.     foreach (sfMixer::getCallables('BaseEtvaVolumegroup:save:pre'as $callable)
  460.     {
  461.       $affectedRows call_user_func($callable$this$con);
  462.       if (is_int($affectedRows))
  463.       {
  464.         return $affectedRows;
  465.       }
  466.     }
  467.  
  468.  
  469.         if ($this->isDeleted()) {
  470.             throw new PropelException("You cannot save an object that has been deleted.");
  471.         }
  472.  
  473.         if ($con === null{
  474.             $con Propel::getConnection(EtvaVolumegroupPeer::DATABASE_NAMEPropel::CONNECTION_WRITE);
  475.         }
  476.         
  477.         $con->beginTransaction();
  478.         try {
  479.             $affectedRows $this->doSave($con);
  480.             $con->commit();
  481.     foreach (sfMixer::getCallables('BaseEtvaVolumegroup:save:post'as $callable)
  482.     {
  483.       call_user_func($callable$this$con$affectedRows);
  484.     }
  485.  
  486.             EtvaVolumegroupPeer::addInstanceToPool($this);
  487.             return $affectedRows;
  488.         catch (PropelException $e{
  489.             $con->rollBack();
  490.             throw $e;
  491.         }
  492.     }
  493.  
  494.     /**
  495.      * Performs the work of inserting or updating the row in the database.
  496.      *
  497.      * If the object is new, it inserts it; otherwise an update is performed.
  498.      * All related objects are also updated in this method.
  499.      *
  500.      * @param      PropelPDO $con 
  501.      * @return     int The number of rows affected by this insert/update and any referring fk objects' save() operations.
  502.      * @throws     PropelException
  503.      * @see        save()
  504.      */
  505.     protected function doSave(PropelPDO $con)
  506.     {
  507.         $affectedRows 0// initialize var to track total num of affected rows
  508.         if (!$this->alreadyInSave{
  509.             $this->alreadyInSave = true;
  510.  
  511.             // We call the save method on the following object(s) if they
  512.             // were passed to this object by their coresponding set
  513.             // method.  This object relates to these object(s) by a
  514.             // foreign key reference.
  515.  
  516.             if ($this->aEtvaNode !== null{
  517.                 if ($this->aEtvaNode->isModified(|| $this->aEtvaNode->isNew()) {
  518.                     $affectedRows += $this->aEtvaNode->save($con);
  519.                 }
  520.                 $this->setEtvaNode($this->aEtvaNode);
  521.             }
  522.  
  523.             if ($this->isNew() ) {
  524.                 $this->modifiedColumns[EtvaVolumegroupPeer::ID;
  525.             }
  526.  
  527.             // If this object has been modified, then save it to the database.
  528.             if ($this->isModified()) {
  529.                 if ($this->isNew()) {
  530.                     $pk EtvaVolumegroupPeer::doInsert($this$con);
  531.                     $affectedRows += 1// we are assuming that there is only 1 row per doInsert() which
  532.                                          // should always be true here (even though technically
  533.                                          // BasePeer::doInsert() can insert multiple rows).
  534.  
  535.                     $this->setId($pk);  //[IMV] update autoincrement primary key
  536.  
  537.                     $this->setNew(false);
  538.                 else {
  539.                     $affectedRows += EtvaVolumegroupPeer::doUpdate($this$con);
  540.                 }
  541.  
  542.                 $this->resetModified()// [HL] After being saved an object is no longer 'modified'
  543.             }
  544.  
  545.             if ($this->collEtvaLogicalvolumes !== null{
  546.                 foreach ($this->collEtvaLogicalvolumes as $referrerFK{
  547.                     if (!$referrerFK->isDeleted()) {
  548.                         $affectedRows += $referrerFK->save($con);
  549.                     }
  550.                 }
  551.             }
  552.  
  553.             if ($this->collEtvaVolumePhysicals !== null{
  554.                 foreach ($this->collEtvaVolumePhysicals as $referrerFK{
  555.                     if (!$referrerFK->isDeleted()) {
  556.                         $affectedRows += $referrerFK->save($con);
  557.                     }
  558.                 }
  559.             }
  560.  
  561.             $this->alreadyInSave = false;
  562.  
  563.         }
  564.         return $affectedRows;
  565.     // doSave()
  566.  
  567.     /**
  568.      * Array of ValidationFailed objects.
  569.      * @var        array ValidationFailed[]
  570.      */
  571.     protected $validationFailures = array();
  572.  
  573.     /**
  574.      * Gets any ValidationFailed objects that resulted from last call to validate().
  575.      *
  576.      *
  577.      * @return     array ValidationFailed[]
  578.      * @see        validate()
  579.      */
  580.     public function getValidationFailures()
  581.     {
  582.         return $this->validationFailures;
  583.     }
  584.  
  585.     /**
  586.      * Validates the objects modified field values and all objects related to this table.
  587.      *
  588.      * If $columns is either a column name or an array of column names
  589.      * only those columns are validated.
  590.      *
  591.      * @param      mixed $columns Column name or an array of column names.
  592.      * @return     boolean Whether all columns pass validation.
  593.      * @see        doValidate()
  594.      * @see        getValidationFailures()
  595.      */
  596.     public function validate($columns null)
  597.     {
  598.         $res $this->doValidate($columns);
  599.         if ($res === true{
  600.             $this->validationFailures = array();
  601.             return true;
  602.         else {
  603.             $this->validationFailures = $res;
  604.             return false;
  605.         }
  606.     }
  607.  
  608.     /**
  609.      * This function performs the validation work for complex object models.
  610.      *
  611.      * In addition to checking the current object, all related objects will
  612.      * also be validated.  If all pass then <code>true</code> is returned; otherwise
  613.      * an aggreagated array of ValidationFailed objects will be returned.
  614.      *
  615.      * @param      array $columns Array of column names to validate.
  616.      * @return     mixed <code>true</code> if all validations pass; array of <code>ValidationFailed</code> objets otherwise.
  617.      */
  618.     protected function doValidate($columns null)
  619.     {
  620.         if (!$this->alreadyInValidation{
  621.             $this->alreadyInValidation = true;
  622.             $retval null;
  623.  
  624.             $failureMap array();
  625.  
  626.  
  627.             // We call the validate method on the following object(s) if they
  628.             // were passed to this object by their coresponding set
  629.             // method.  This object relates to these object(s) by a
  630.             // foreign key reference.
  631.  
  632.             if ($this->aEtvaNode !== null{
  633.                 if (!$this->aEtvaNode->validate($columns)) {
  634.                     $failureMap array_merge($failureMap$this->aEtvaNode->getValidationFailures());
  635.                 }
  636.             }
  637.  
  638.  
  639.             if (($retval EtvaVolumegroupPeer::doValidate($this$columns)) !== true{
  640.                 $failureMap array_merge($failureMap$retval);
  641.             }
  642.  
  643.  
  644.                 if ($this->collEtvaLogicalvolumes !== null{
  645.                     foreach ($this->collEtvaLogicalvolumes as $referrerFK{
  646.                         if (!$referrerFK->validate($columns)) {
  647.                             $failureMap array_merge($failureMap$referrerFK->getValidationFailures());
  648.                         }
  649.                     }
  650.                 }
  651.  
  652.                 if ($this->collEtvaVolumePhysicals !== null{
  653.                     foreach ($this->collEtvaVolumePhysicals as $referrerFK{
  654.                         if (!$referrerFK->validate($columns)) {
  655.                             $failureMap array_merge($failureMap$referrerFK->getValidationFailures());
  656.                         }
  657.                     }
  658.                 }
  659.  
  660.  
  661.             $this->alreadyInValidation = false;
  662.         }
  663.  
  664.         return (!empty($failureMap$failureMap true);
  665.     }
  666.  
  667.     /**
  668.      * Retrieves a field from the object by name passed in as a string.
  669.      *
  670.      * @param      string $name name
  671.      * @param      string $type The type of fieldname the $name is of:
  672.      *                      one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
  673.      *                      BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
  674.      * @return     mixed Value of field.
  675.      */
  676.     public function getByName($name$type BasePeer::TYPE_PHPNAME)
  677.     {
  678.         $pos EtvaVolumegroupPeer::translateFieldName($name$typeBasePeer::TYPE_NUM);
  679.         $field $this->getByPosition($pos);
  680.         return $field;
  681.     }
  682.  
  683.     /**
  684.      * Retrieves a field from the object by Position as specified in the xml schema.
  685.      * Zero-based.
  686.      *
  687.      * @param      int $pos position in xml schema
  688.      * @return     mixed Value of field at $pos
  689.      */
  690.     public function getByPosition($pos)
  691.     {
  692.         switch($pos{
  693.             case 0:
  694.                 return $this->getId();
  695.                 break;
  696.             case 1:
  697.                 return $this->getNodeId();
  698.                 break;
  699.             case 2:
  700.                 return $this->getVg();
  701.                 break;
  702.             case 3:
  703.                 return $this->getSize();
  704.                 break;
  705.             case 4:
  706.                 return $this->getFreesize();
  707.                 break;
  708.             default:
  709.                 return null;
  710.                 break;
  711.         // switch()
  712.     }
  713.  
  714.     /**
  715.      * Exports the object as an array.
  716.      *
  717.      * You can specify the key type of the array by passing one of the class
  718.      * type constants.
  719.      *
  720.      * @param      string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
  721.      *                         BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. Defaults to BasePeer::TYPE_PHPNAME.
  722.      * @param      boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns.  Defaults to TRUE.
  723.      * @return     an associative array containing the field names (as keys) and field values
  724.      */
  725.     public function toArray($keyType BasePeer::TYPE_PHPNAME$includeLazyLoadColumns true)
  726.     {
  727.         $keys EtvaVolumegroupPeer::getFieldNames($keyType);
  728.         $result array(
  729.             $keys[0=> $this->getId(),
  730.             $keys[1=> $this->getNodeId(),
  731.             $keys[2=> $this->getVg(),
  732.             $keys[3=> $this->getSize(),
  733.             $keys[4=> $this->getFreesize(),
  734.         );
  735.         return $result;
  736.     }
  737.  
  738.     /**
  739.      * Sets a field from the object by name passed in as a string.
  740.      *
  741.      * @param      string $name peer name
  742.      * @param      mixed $value field value
  743.      * @param      string $type The type of fieldname the $name is of:
  744.      *                      one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
  745.      *                      BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
  746.      * @return     void 
  747.      */
  748.     public function setByName($name$value$type BasePeer::TYPE_PHPNAME)
  749.     {
  750.         $pos EtvaVolumegroupPeer::translateFieldName($name$typeBasePeer::TYPE_NUM);
  751.         return $this->setByPosition($pos$value);
  752.     }
  753.  
  754.     /**
  755.      * Sets a field from the object by Position as specified in the xml schema.
  756.      * Zero-based.
  757.      *
  758.      * @param      int $pos position in xml schema
  759.      * @param      mixed $value field value
  760.      * @return     void 
  761.      */
  762.     public function setByPosition($pos$value)
  763.     {
  764.         switch($pos{
  765.             case 0:
  766.                 $this->setId($value);
  767.                 break;
  768.             case 1:
  769.                 $this->setNodeId($value);
  770.                 break;
  771.             case 2:
  772.                 $this->setVg($value);
  773.                 break;
  774.             case 3:
  775.                 $this->setSize($value);
  776.                 break;
  777.             case 4:
  778.                 $this->setFreesize($value);
  779.                 break;
  780.         // switch()
  781.     }
  782.  
  783.     /**
  784.      * Populates the object using an array.
  785.      *
  786.      * This is particularly useful when populating an object from one of the
  787.      * request arrays (e.g. $_POST).  This method goes through the column
  788.      * names, checking to see whether a matching key exists in populated
  789.      * array. If so the setByName() method is called for that column.
  790.      *
  791.      * You can specify the key type of the array by additionally passing one
  792.      * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME,
  793.      * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
  794.      * The default key type is the column's phpname (e.g. 'AuthorId')
  795.      *
  796.      * @param      array  $arr     An array to populate the object from.
  797.      * @param      string $keyType The type of keys the array uses.
  798.      * @return     void 
  799.      */
  800.     public function fromArray($arr$keyType BasePeer::TYPE_PHPNAME)
  801.     {
  802.         $keys EtvaVolumegroupPeer::getFieldNames($keyType);
  803.  
  804.         if (array_key_exists($keys[0]$arr)) $this->setId($arr[$keys[0]]);
  805.         if (array_key_exists($keys[1]$arr)) $this->setNodeId($arr[$keys[1]]);
  806.         if (array_key_exists($keys[2]$arr)) $this->setVg($arr[$keys[2]]);
  807.         if (array_key_exists($keys[3]$arr)) $this->setSize($arr[$keys[3]]);
  808.         if (array_key_exists($keys[4]$arr)) $this->setFreesize($arr[$keys[4]]);
  809.     }
  810.  
  811.     /**
  812.      * Build a Criteria object containing the values of all modified columns in this object.
  813.      *
  814.      * @return     Criteria The Criteria object containing all modified values.
  815.      */
  816.     public function buildCriteria()
  817.     {
  818.         $criteria new Criteria(EtvaVolumegroupPeer::DATABASE_NAME);
  819.  
  820.         if ($this->isColumnModified(EtvaVolumegroupPeer::ID)) $criteria->add(EtvaVolumegroupPeer::ID$this->id);
  821.         if ($this->isColumnModified(EtvaVolumegroupPeer::NODE_ID)) $criteria->add(EtvaVolumegroupPeer::NODE_ID$this->node_id);
  822.         if ($this->isColumnModified(EtvaVolumegroupPeer::VG)) $criteria->add(EtvaVolumegroupPeer::VG$this->vg);
  823.         if ($this->isColumnModified(EtvaVolumegroupPeer::SIZE)) $criteria->add(EtvaVolumegroupPeer::SIZE$this->size);
  824.         if ($this->isColumnModified(EtvaVolumegroupPeer::FREESIZE)) $criteria->add(EtvaVolumegroupPeer::FREESIZE$this->freesize);
  825.  
  826.         return $criteria;
  827.     }
  828.  
  829.     /**
  830.      * Builds a Criteria object containing the primary key for this object.
  831.      *
  832.      * Unlike buildCriteria() this method includes the primary key values regardless
  833.      * of whether or not they have been modified.
  834.      *
  835.      * @return     Criteria The Criteria object containing value(s) for primary key(s).
  836.      */
  837.     public function buildPkeyCriteria()
  838.     {
  839.         $criteria new Criteria(EtvaVolumegroupPeer::DATABASE_NAME);
  840.  
  841.         $criteria->add(EtvaVolumegroupPeer::ID$this->id);
  842.  
  843.         return $criteria;
  844.     }
  845.  
  846.     /**
  847.      * Returns the primary key for this object (row).
  848.      * @return     int 
  849.      */
  850.     public function getPrimaryKey()
  851.     {
  852.         return $this->getId();
  853.     }
  854.  
  855.     /**
  856.      * Generic method to set the primary key (id column).
  857.      *
  858.      * @param      int $key Primary key.
  859.      * @return     void 
  860.      */
  861.     public function setPrimaryKey($key)
  862.     {
  863.         $this->setId($key);
  864.     }
  865.  
  866.     /**
  867.      * Sets contents of passed object to values from current object.
  868.      *
  869.      * If desired, this method can also make copies of all associated (fkey referrers)
  870.      * objects.
  871.      *
  872.      * @param      object $copyObj An object of EtvaVolumegroup (or compatible) type.
  873.      * @param      boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
  874.      * @throws     PropelException
  875.      */
  876.     public function copyInto($copyObj$deepCopy false)
  877.     {
  878.  
  879.         $copyObj->setNodeId($this->node_id);
  880.  
  881.         $copyObj->setVg($this->vg);
  882.  
  883.         $copyObj->setSize($this->size);
  884.  
  885.         $copyObj->setFreesize($this->freesize);
  886.  
  887.  
  888.         if ($deepCopy{
  889.             // important: temporarily setNew(false) because this affects the behavior of
  890.             // the getter/setter methods for fkey referrer objects.
  891.             $copyObj->setNew(false);
  892.  
  893.             foreach ($this->getEtvaLogicalvolumes(as $relObj{
  894.                 if ($relObj !== $this{  // ensure that we don't try to copy a reference to ourselves
  895.                     $copyObj->addEtvaLogicalvolume($relObj->copy($deepCopy));
  896.                 }
  897.             }
  898.  
  899.             foreach ($this->getEtvaVolumePhysicals(as $relObj{
  900.                 if ($relObj !== $this{  // ensure that we don't try to copy a reference to ourselves
  901.                     $copyObj->addEtvaVolumePhysical($relObj->copy($deepCopy));
  902.                 }
  903.             }
  904.  
  905.         // if ($deepCopy)
  906.  
  907.  
  908.         $copyObj->setNew(true);
  909.  
  910.         $copyObj->setId(NULL)// this is a auto-increment column, so set to default value
  911.  
  912.     }
  913.  
  914.     /**
  915.      * Makes a copy of this object that will be inserted as a new row in table when saved.
  916.      * It creates a new object filling in the simple attributes, but skipping any primary
  917.      * keys that are defined for the table.
  918.      *
  919.      * If desired, this method can also make copies of all associated (fkey referrers)
  920.      * objects.
  921.      *
  922.      * @param      boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
  923.      * @return     EtvaVolumegroup Clone of current object.
  924.      * @throws     PropelException
  925.      */
  926.     public function copy($deepCopy false)
  927.     {
  928.         // we use get_class(), because this might be a subclass
  929.         $clazz get_class($this);
  930.         $copyObj new $clazz();
  931.         $this->copyInto($copyObj$deepCopy);
  932.         return $copyObj;
  933.     }
  934.  
  935.     /**
  936.      * Returns a peer instance associated with this om.
  937.      *
  938.      * Since Peer classes are not to have any instance attributes, this method returns the
  939.      * same instance for all member of this class. The method could therefore
  940.      * be static, but this would prevent one from overriding the behavior.
  941.      *
  942.      * @return     EtvaVolumegroupPeer 
  943.      */
  944.     public function getPeer()
  945.     {
  946.         if (self::$peer === null{
  947.             self::$peer new EtvaVolumegroupPeer();
  948.         }
  949.         return self::$peer;
  950.     }
  951.  
  952.     /**
  953.      * Declares an association between this object and a EtvaNode object.
  954.      *
  955.      * @param      EtvaNode $v 
  956.      * @return     EtvaVolumegroup The current object (for fluent API support)
  957.      * @throws     PropelException
  958.      */
  959.     public function setEtvaNode(EtvaNode $v null)
  960.     {
  961.         if ($v === null{
  962.             $this->setNodeId(NULL);
  963.         else {
  964.             $this->setNodeId($v->getId());
  965.         }
  966.  
  967.         $this->aEtvaNode = $v;
  968.  
  969.         // Add binding for other direction of this n:n relationship.
  970.         // If this object has already been added to the EtvaNode object, it will not be re-added.
  971.         if ($v !== null{
  972.             $v->addEtvaVolumegroup($this);
  973.         }
  974.  
  975.         return $this;
  976.     }
  977.  
  978.  
  979.     /**
  980.      * Get the associated EtvaNode object
  981.      *
  982.      * @param      PropelPDO Optional Connection object.
  983.      * @return     EtvaNode The associated EtvaNode object.
  984.      * @throws     PropelException
  985.      */
  986.     public function getEtvaNode(PropelPDO $con null)
  987.     {
  988.         if ($this->aEtvaNode === null && ($this->node_id !== null)) {
  989.             $c new Criteria(EtvaNodePeer::DATABASE_NAME);
  990.             $c->add(EtvaNodePeer::ID$this->node_id);
  991.             $this->aEtvaNode = EtvaNodePeer::doSelectOne($c$con);
  992.             /* The following can be used additionally to
  993.                guarantee the related object contains a reference
  994.                to this object.  This level of coupling may, however, be
  995.                undesirable since it could result in an only partially populated collection
  996.                in the referenced object.
  997.                $this->aEtvaNode->addEtvaVolumegroups($this);
  998.              */
  999.         }
  1000.         return $this->aEtvaNode;
  1001.     }
  1002.  
  1003.     /**
  1004.      * Clears out the collEtvaLogicalvolumes collection (array).
  1005.      *
  1006.      * This does not modify the database; however, it will remove any associated objects, causing
  1007.      * them to be refetched by subsequent calls to accessor method.
  1008.      *
  1009.      * @return     void 
  1010.      * @see        addEtvaLogicalvolumes()
  1011.      */
  1012.     public function clearEtvaLogicalvolumes()
  1013.     {
  1014.         $this->collEtvaLogicalvolumes = null// important to set this to NULL since that means it is uninitialized
  1015.     }
  1016.  
  1017.     /**
  1018.      * Initializes the collEtvaLogicalvolumes collection (array).
  1019.      *
  1020.      * By default this just sets the collEtvaLogicalvolumes collection to an empty array (like clearcollEtvaLogicalvolumes());
  1021.      * however, you may wish to override this method in your stub class to provide setting appropriate
  1022.      * to your application -- for example, setting the initial array to the values stored in database.
  1023.      *
  1024.      * @return     void 
  1025.      */
  1026.     public function initEtvaLogicalvolumes()
  1027.     {
  1028.         $this->collEtvaLogicalvolumes = array();
  1029.     }
  1030.  
  1031.     /**
  1032.      * Gets an array of EtvaLogicalvolume objects which contain a foreign key that references this object.
  1033.      *
  1034.      * If this collection has already been initialized with an identical Criteria, it returns the collection.
  1035.      * Otherwise if this EtvaVolumegroup has previously been saved, it will retrieve
  1036.      * related EtvaLogicalvolumes from storage. If this EtvaVolumegroup is new, it will return
  1037.      * an empty collection or the current collection, the criteria is ignored on a new object.
  1038.      *
  1039.      * @param      PropelPDO $con 
  1040.      * @param      Criteria $criteria 
  1041.      * @return     array EtvaLogicalvolume[]
  1042.      * @throws     PropelException
  1043.      */
  1044.     public function getEtvaLogicalvolumes($criteria nullPropelPDO $con null)
  1045.     {
  1046.         if ($criteria === null{
  1047.             $criteria new Criteria(EtvaVolumegroupPeer::DATABASE_NAME);
  1048.         }
  1049.         elseif ($criteria instanceof Criteria)
  1050.         {
  1051.             $criteria clone $criteria;
  1052.         }
  1053.  
  1054.         if ($this->collEtvaLogicalvolumes === null{
  1055.             if ($this->isNew()) {
  1056.                $this->collEtvaLogicalvolumes = array();
  1057.             else {
  1058.  
  1059.                 $criteria->add(EtvaLogicalvolumePeer::VOLUMEGROUP_ID$this->id);
  1060.  
  1061.                 EtvaLogicalvolumePeer::addSelectColumns($criteria);
  1062.                 $this->collEtvaLogicalvolumes = EtvaLogicalvolumePeer::doSelect($criteria$con);
  1063.             }
  1064.         else {
  1065.             // criteria has no effect for a new object
  1066.             if (!$this->isNew()) {
  1067.                 // the following code is to determine if a new query is
  1068.                 // called for.  If the criteria is the same as the last
  1069.                 // one, just return the collection.
  1070.  
  1071.  
  1072.                 $criteria->add(EtvaLogicalvolumePeer::VOLUMEGROUP_ID$this->id);
  1073.  
  1074.                 EtvaLogicalvolumePeer::addSelectColumns($criteria);
  1075.                 if (!isset($this->lastEtvaLogicalvolumeCriteria|| !$this->lastEtvaLogicalvolumeCriteria->equals($criteria)) {
  1076.                     $this->collEtvaLogicalvolumes = EtvaLogicalvolumePeer::doSelect($criteria$con);
  1077.                 }
  1078.             }
  1079.         }
  1080.         $this->lastEtvaLogicalvolumeCriteria $criteria;
  1081.         return $this->collEtvaLogicalvolumes;
  1082.     }
  1083.  
  1084.     /**
  1085.      * Returns the number of related EtvaLogicalvolume objects.
  1086.      *
  1087.      * @param      Criteria $criteria 
  1088.      * @param      boolean $distinct 
  1089.      * @param      PropelPDO $con 
  1090.      * @return     int Count of related EtvaLogicalvolume objects.
  1091.      * @throws     PropelException
  1092.      */
  1093.     public function countEtvaLogicalvolumes(Criteria $criteria null$distinct falsePropelPDO $con null)
  1094.     {
  1095.         if ($criteria === null{
  1096.             $criteria new Criteria(EtvaVolumegroupPeer::DATABASE_NAME);
  1097.         else {
  1098.             $criteria clone $criteria;
  1099.         }
  1100.  
  1101.         if ($distinct{
  1102.             $criteria->setDistinct();
  1103.         }
  1104.  
  1105.         $count null;
  1106.  
  1107.         if ($this->collEtvaLogicalvolumes === null{
  1108.             if ($this->isNew()) {
  1109.                 $count 0;
  1110.             else {
  1111.  
  1112.                 $criteria->add(EtvaLogicalvolumePeer::VOLUMEGROUP_ID$this->id);
  1113.  
  1114.                 $count EtvaLogicalvolumePeer::doCount($criteria$con);
  1115.             }
  1116.         else {
  1117.             // criteria has no effect for a new object
  1118.             if (!$this->isNew()) {
  1119.                 // the following code is to determine if a new query is
  1120.                 // called for.  If the criteria is the same as the last
  1121.                 // one, just return count of the collection.
  1122.  
  1123.  
  1124.                 $criteria->add(EtvaLogicalvolumePeer::VOLUMEGROUP_ID$this->id);
  1125.  
  1126.                 if (!isset($this->lastEtvaLogicalvolumeCriteria|| !$this->lastEtvaLogicalvolumeCriteria->equals($criteria)) {
  1127.                     $count EtvaLogicalvolumePeer::doCount($criteria$con);
  1128.                 else {
  1129.                     $count count($this->collEtvaLogicalvolumes);
  1130.                 }
  1131.             else {
  1132.                 $count count($this->collEtvaLogicalvolumes);
  1133.             }
  1134.         }
  1135.         $this->lastEtvaLogicalvolumeCriteria $criteria;
  1136.         return $count;
  1137.     }
  1138.  
  1139.     /**
  1140.      * Method called to associate a EtvaLogicalvolume object to this object
  1141.      * through the EtvaLogicalvolume foreign key attribute.
  1142.      *
  1143.      * @param      EtvaLogicalvolume $l EtvaLogicalvolume
  1144.      * @return     void 
  1145.      * @throws     PropelException
  1146.      */
  1147.     public function addEtvaLogicalvolume(EtvaLogicalvolume $l)
  1148.     {
  1149.         if ($this->collEtvaLogicalvolumes === null{
  1150.             $this->initEtvaLogicalvolumes();
  1151.         }
  1152.         if (!in_array($l$this->collEtvaLogicalvolumestrue)) // only add it if the **same** object is not already associated
  1153.             array_push($this->collEtvaLogicalvolumes$l);
  1154.             $l->setEtvaVolumegroup($this);
  1155.         }
  1156.     }
  1157.  
  1158.  
  1159.     /**
  1160.      * If this collection has already been initialized with
  1161.      * an identical criteria, it returns the collection.
  1162.      * Otherwise if this EtvaVolumegroup is new, it will return
  1163.      * an empty collection; or if this EtvaVolumegroup has previously
  1164.      * been saved, it will retrieve related EtvaLogicalvolumes from storage.
  1165.      *
  1166.      * This method is protected by default in order to keep the public
  1167.      * api reasonable.  You can provide public methods for those you
  1168.      * actually need in EtvaVolumegroup.
  1169.      */
  1170.     public function getEtvaLogicalvolumesJoinEtvaNode($criteria null$con null$join_behavior Criteria::LEFT_JOIN)
  1171.     {
  1172.         if ($criteria === null{
  1173.             $criteria new Criteria(EtvaVolumegroupPeer::DATABASE_NAME);
  1174.         }
  1175.         elseif ($criteria instanceof Criteria)
  1176.         {
  1177.             $criteria clone $criteria;
  1178.         }
  1179.  
  1180.         if ($this->collEtvaLogicalvolumes === null{
  1181.             if ($this->isNew()) {
  1182.                 $this->collEtvaLogicalvolumes = array();
  1183.             else {
  1184.  
  1185.                 $criteria->add(EtvaLogicalvolumePeer::VOLUMEGROUP_ID$this->id);
  1186.  
  1187.                 $this->collEtvaLogicalvolumes = EtvaLogicalvolumePeer::doSelectJoinEtvaNode($criteria$con$join_behavior);
  1188.             }
  1189.         else {
  1190.             // the following code is to determine if a new query is
  1191.             // called for.  If the criteria is the same as the last
  1192.             // one, just return the collection.
  1193.  
  1194.             $criteria->add(EtvaLogicalvolumePeer::VOLUMEGROUP_ID$this->id);
  1195.  
  1196.             if (!isset($this->lastEtvaLogicalvolumeCriteria|| !$this->lastEtvaLogicalvolumeCriteria->equals($criteria)) {
  1197.                 $this->collEtvaLogicalvolumes = EtvaLogicalvolumePeer::doSelectJoinEtvaNode($criteria$con$join_behavior);
  1198.             }
  1199.         }
  1200.         $this->lastEtvaLogicalvolumeCriteria $criteria;
  1201.  
  1202.         return $this->collEtvaLogicalvolumes;
  1203.     }
  1204.  
  1205.     /**
  1206.      * Clears out the collEtvaVolumePhysicals collection (array).
  1207.      *
  1208.      * This does not modify the database; however, it will remove any associated objects, causing
  1209.      * them to be refetched by subsequent calls to accessor method.
  1210.      *
  1211.      * @return     void 
  1212.      * @see        addEtvaVolumePhysicals()
  1213.      */
  1214.     public function clearEtvaVolumePhysicals()
  1215.     {
  1216.         $this->collEtvaVolumePhysicals = null// important to set this to NULL since that means it is uninitialized
  1217.     }
  1218.  
  1219.     /**
  1220.      * Initializes the collEtvaVolumePhysicals collection (array).
  1221.      *
  1222.      * By default this just sets the collEtvaVolumePhysicals collection to an empty array (like clearcollEtvaVolumePhysicals());
  1223.      * however, you may wish to override this method in your stub class to provide setting appropriate
  1224.      * to your application -- for example, setting the initial array to the values stored in database.
  1225.      *
  1226.      * @return     void 
  1227.      */
  1228.     public function initEtvaVolumePhysicals()
  1229.     {
  1230.         $this->collEtvaVolumePhysicals = array();
  1231.     }
  1232.  
  1233.     /**
  1234.      * Gets an array of EtvaVolumePhysical objects which contain a foreign key that references this object.
  1235.      *
  1236.      * If this collection has already been initialized with an identical Criteria, it returns the collection.
  1237.      * Otherwise if this EtvaVolumegroup has previously been saved, it will retrieve
  1238.      * related EtvaVolumePhysicals from storage. If this EtvaVolumegroup is new, it will return
  1239.      * an empty collection or the current collection, the criteria is ignored on a new object.
  1240.      *
  1241.      * @param      PropelPDO $con 
  1242.      * @param      Criteria $criteria 
  1243.      * @return     array EtvaVolumePhysical[]
  1244.      * @throws     PropelException
  1245.      */
  1246.     public function getEtvaVolumePhysicals($criteria nullPropelPDO $con null)
  1247.     {
  1248.         if ($criteria === null{
  1249.             $criteria new Criteria(EtvaVolumegroupPeer::DATABASE_NAME);
  1250.         }
  1251.         elseif ($criteria instanceof Criteria)
  1252.         {
  1253.             $criteria clone $criteria;
  1254.         }
  1255.  
  1256.         if ($this->collEtvaVolumePhysicals === null{
  1257.             if ($this->isNew()) {
  1258.                $this->collEtvaVolumePhysicals = array();
  1259.             else {
  1260.  
  1261.                 $criteria->add(EtvaVolumePhysicalPeer::VOLUMEGROUP_ID$this->id);
  1262.  
  1263.                 EtvaVolumePhysicalPeer::addSelectColumns($criteria);
  1264.                 $this->collEtvaVolumePhysicals = EtvaVolumePhysicalPeer::doSelect($criteria$con);
  1265.             }
  1266.         else {
  1267.             // criteria has no effect for a new object
  1268.             if (!$this->isNew()) {
  1269.                 // the following code is to determine if a new query is
  1270.                 // called for.  If the criteria is the same as the last
  1271.                 // one, just return the collection.
  1272.  
  1273.  
  1274.                 $criteria->add(EtvaVolumePhysicalPeer::VOLUMEGROUP_ID$this->id);
  1275.  
  1276.                 EtvaVolumePhysicalPeer::addSelectColumns($criteria);
  1277.                 if (!isset($this->lastEtvaVolumePhysicalCriteria|| !$this->lastEtvaVolumePhysicalCriteria->equals($criteria)) {
  1278.                     $this->collEtvaVolumePhysicals = EtvaVolumePhysicalPeer::doSelect($criteria$con);
  1279.                 }
  1280.             }
  1281.         }
  1282.         $this->lastEtvaVolumePhysicalCriteria $criteria;
  1283.         return $this->collEtvaVolumePhysicals;
  1284.     }
  1285.  
  1286.     /**
  1287.      * Returns the number of related EtvaVolumePhysical objects.
  1288.      *
  1289.      * @param      Criteria $criteria 
  1290.      * @param      boolean $distinct 
  1291.      * @param      PropelPDO $con 
  1292.      * @return     int Count of related EtvaVolumePhysical objects.
  1293.      * @throws     PropelException
  1294.      */
  1295.     public function countEtvaVolumePhysicals(Criteria $criteria null$distinct falsePropelPDO $con null)
  1296.     {
  1297.         if ($criteria === null{
  1298.             $criteria new Criteria(EtvaVolumegroupPeer::DATABASE_NAME);
  1299.         else {
  1300.             $criteria clone $criteria;
  1301.         }
  1302.  
  1303.         if ($distinct{
  1304.             $criteria->setDistinct();
  1305.         }
  1306.  
  1307.         $count null;
  1308.  
  1309.         if ($this->collEtvaVolumePhysicals === null{
  1310.             if ($this->isNew()) {
  1311.                 $count 0;
  1312.             else {
  1313.  
  1314.                 $criteria->add(EtvaVolumePhysicalPeer::VOLUMEGROUP_ID$this->id);
  1315.  
  1316.                 $count EtvaVolumePhysicalPeer::doCount($criteria$con);
  1317.             }
  1318.         else {
  1319.             // criteria has no effect for a new object
  1320.             if (!$this->isNew()) {
  1321.                 // the following code is to determine if a new query is
  1322.                 // called for.  If the criteria is the same as the last
  1323.                 // one, just return count of the collection.
  1324.  
  1325.  
  1326.                 $criteria->add(EtvaVolumePhysicalPeer::VOLUMEGROUP_ID$this->id);
  1327.  
  1328.                 if (!isset($this->lastEtvaVolumePhysicalCriteria|| !$this->lastEtvaVolumePhysicalCriteria->equals($criteria)) {
  1329.                     $count EtvaVolumePhysicalPeer::doCount($criteria$con);
  1330.                 else {
  1331.                     $count count($this->collEtvaVolumePhysicals);
  1332.                 }
  1333.             else {
  1334.                 $count count($this->collEtvaVolumePhysicals);
  1335.             }
  1336.         }
  1337.         $this->lastEtvaVolumePhysicalCriteria $criteria;
  1338.         return $count;
  1339.     }
  1340.  
  1341.     /**
  1342.      * Method called to associate a EtvaVolumePhysical object to this object
  1343.      * through the EtvaVolumePhysical foreign key attribute.
  1344.      *
  1345.      * @param      EtvaVolumePhysical $l EtvaVolumePhysical
  1346.      * @return     void 
  1347.      * @throws     PropelException
  1348.      */
  1349.     public function addEtvaVolumePhysical(EtvaVolumePhysical $l)
  1350.     {
  1351.         if ($this->collEtvaVolumePhysicals === null{
  1352.             $this->initEtvaVolumePhysicals();
  1353.         }
  1354.         if (!in_array($l$this->collEtvaVolumePhysicalstrue)) // only add it if the **same** object is not already associated
  1355.             array_push($this->collEtvaVolumePhysicals$l);
  1356.             $l->setEtvaVolumegroup($this);
  1357.         }
  1358.     }
  1359.  
  1360.  
  1361.     /**
  1362.      * If this collection has already been initialized with
  1363.      * an identical criteria, it returns the collection.
  1364.      * Otherwise if this EtvaVolumegroup is new, it will return
  1365.      * an empty collection; or if this EtvaVolumegroup has previously
  1366.      * been saved, it will retrieve related EtvaVolumePhysicals from storage.
  1367.      *
  1368.      * This method is protected by default in order to keep the public
  1369.      * api reasonable.  You can provide public methods for those you
  1370.      * actually need in EtvaVolumegroup.
  1371.      */
  1372.     public function getEtvaVolumePhysicalsJoinEtvaPhysicalvolume($criteria null$con null$join_behavior Criteria::LEFT_JOIN)
  1373.     {
  1374.         if ($criteria === null{
  1375.             $criteria new Criteria(EtvaVolumegroupPeer::DATABASE_NAME);
  1376.         }
  1377.         elseif ($criteria instanceof Criteria)
  1378.         {
  1379.             $criteria clone $criteria;
  1380.         }
  1381.  
  1382.         if ($this->collEtvaVolumePhysicals === null{
  1383.             if ($this->isNew()) {
  1384.                 $this->collEtvaVolumePhysicals = array();
  1385.             else {
  1386.  
  1387.                 $criteria->add(EtvaVolumePhysicalPeer::VOLUMEGROUP_ID$this->id);
  1388.  
  1389.                 $this->collEtvaVolumePhysicals = EtvaVolumePhysicalPeer::doSelectJoinEtvaPhysicalvolume($criteria$con$join_behavior);
  1390.             }
  1391.         else {
  1392.             // the following code is to determine if a new query is
  1393.             // called for.  If the criteria is the same as the last
  1394.             // one, just return the collection.
  1395.  
  1396.             $criteria->add(EtvaVolumePhysicalPeer::VOLUMEGROUP_ID$this->id);
  1397.  
  1398.             if (!isset($this->lastEtvaVolumePhysicalCriteria|| !$this->lastEtvaVolumePhysicalCriteria->equals($criteria)) {
  1399.                 $this->collEtvaVolumePhysicals = EtvaVolumePhysicalPeer::doSelectJoinEtvaPhysicalvolume($criteria$con$join_behavior);
  1400.             }
  1401.         }
  1402.         $this->lastEtvaVolumePhysicalCriteria $criteria;
  1403.  
  1404.         return $this->collEtvaVolumePhysicals;
  1405.     }
  1406.  
  1407.     /**
  1408.      * Resets all collections of referencing foreign keys.
  1409.      *
  1410.      * This method is a user-space workaround for PHP's inability to garbage collect objects
  1411.      * with circular references.  This is currently necessary when using Propel in certain
  1412.      * daemon or large-volumne/high-memory operations.
  1413.      *
  1414.      * @param      boolean $deep Whether to also clear the references on all associated objects.
  1415.      */
  1416.     public function clearAllReferences($deep false)
  1417.     {
  1418.         if ($deep{
  1419.             if ($this->collEtvaLogicalvolumes{
  1420.                 foreach ((array) $this->collEtvaLogicalvolumes as $o{
  1421.                     $o->clearAllReferences($deep);
  1422.                 }
  1423.             }
  1424.             if ($this->collEtvaVolumePhysicals{
  1425.                 foreach ((array) $this->collEtvaVolumePhysicals as $o{
  1426.                     $o->clearAllReferences($deep);
  1427.                 }
  1428.             }
  1429.         // if ($deep)
  1430.  
  1431.         $this->collEtvaLogicalvolumes = null;
  1432.         $this->collEtvaVolumePhysicals = null;
  1433.             $this->aEtvaNode = null;
  1434.     }
  1435.  
  1436.  
  1437.   public function __call($method$arguments)
  1438.   {
  1439.     if (!$callable sfMixer::getCallable('BaseEtvaVolumegroup:'.$method))
  1440.     {
  1441.       throw new sfException(sprintf('Call to undefined method BaseEtvaVolumegroup::%s'$method));
  1442.     }
  1443.  
  1444.     array_unshift($arguments$this);
  1445.  
  1446.     return call_user_func_array($callable$arguments);
  1447.   }
  1448.  
  1449.  
  1450. // BaseEtvaVolumegroup

Documentation generated on Fri, 19 Jun 2009 10:48:44 +0100 by phpDocumentor 1.4.2