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

Source for file BaseEtvaPhysicalvolume.php

Documentation is available at BaseEtvaPhysicalvolume.php

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

Documentation generated on Fri, 19 Jun 2009 10:47:37 +0100 by phpDocumentor 1.4.2