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

Source for file BaseEtvaNode.php

Documentation is available at BaseEtvaNode.php

  1. <?php
  2.  
  3. /**
  4.  * Base class that represents a row from the 'node' table.
  5.  *
  6.  * 
  7.  *
  8.  * This class was autogenerated by Propel 1.3.0-dev on:
  9.  *
  10.  * Thu Jun 18 14:28:37 2009
  11.  *
  12.  * @package    lib.model.om
  13.  */
  14. abstract class BaseEtvaNode extends BaseObject  implements Persistent {
  15.  
  16.  
  17.   const PEER = 'EtvaNodePeer';
  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        EtvaNodePeer 
  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 name field.
  35.      * @var        string 
  36.      */
  37.     protected $name;
  38.  
  39.     /**
  40.      * The value for the memtotal field.
  41.      * @var        int 
  42.      */
  43.     protected $memtotal;
  44.  
  45.     /**
  46.      * The value for the memfree field.
  47.      * @var        int 
  48.      */
  49.     protected $memfree;
  50.  
  51.     /**
  52.      * The value for the cputotal field.
  53.      * @var        int 
  54.      */
  55.     protected $cputotal;
  56.  
  57.     /**
  58.      * The value for the ip field.
  59.      * @var        string 
  60.      */
  61.     protected $ip;
  62.  
  63.     /**
  64.      * The value for the port field.
  65.      * @var        int 
  66.      */
  67.     protected $port;
  68.  
  69.     /**
  70.      * The value for the uid field.
  71.      * @var        string 
  72.      */
  73.     protected $uid;
  74.  
  75.     /**
  76.      * The value for the network_cards field.
  77.      * @var        int 
  78.      */
  79.     protected $network_cards;
  80.  
  81.     /**
  82.      * The value for the state field.
  83.      * Note: this column has a database default value of: 1
  84.      * @var        int 
  85.      */
  86.     protected $state;
  87.  
  88.     /**
  89.      * The value for the created_at field.
  90.      * @var        string 
  91.      */
  92.     protected $created_at;
  93.  
  94.     /**
  95.      * @var        array EtvaServer[] Collection to store aggregation of EtvaServer objects.
  96.      */
  97.     protected $collEtvaServers;
  98.  
  99.     /**
  100.      * @var        Criteria The criteria used to select the current contents of collEtvaServers.
  101.      */
  102.     private $lastEtvaServerCriteria null;
  103.  
  104.     /**
  105.      * @var        array EtvaPhysicalvolume[] Collection to store aggregation of EtvaPhysicalvolume objects.
  106.      */
  107.     protected $collEtvaPhysicalvolumes;
  108.  
  109.     /**
  110.      * @var        Criteria The criteria used to select the current contents of collEtvaPhysicalvolumes.
  111.      */
  112.     private $lastEtvaPhysicalvolumeCriteria null;
  113.  
  114.     /**
  115.      * @var        array EtvaVolumegroup[] Collection to store aggregation of EtvaVolumegroup objects.
  116.      */
  117.     protected $collEtvaVolumegroups;
  118.  
  119.     /**
  120.      * @var        Criteria The criteria used to select the current contents of collEtvaVolumegroups.
  121.      */
  122.     private $lastEtvaVolumegroupCriteria null;
  123.  
  124.     /**
  125.      * @var        array EtvaLogicalvolume[] Collection to store aggregation of EtvaLogicalvolume objects.
  126.      */
  127.     protected $collEtvaLogicalvolumes;
  128.  
  129.     /**
  130.      * @var        Criteria The criteria used to select the current contents of collEtvaLogicalvolumes.
  131.      */
  132.     private $lastEtvaLogicalvolumeCriteria null;
  133.  
  134.     /**
  135.      * Flag to prevent endless save loop, if this object is referenced
  136.      * by another object which falls in this transaction.
  137.      * @var        boolean 
  138.      */
  139.     protected $alreadyInSave = false;
  140.  
  141.     /**
  142.      * Flag to prevent endless validation loop, if this object is referenced
  143.      * by another object which falls in this transaction.
  144.      * @var        boolean 
  145.      */
  146.     protected $alreadyInValidation = false;
  147.  
  148.     /**
  149.      * Initializes internal state of BaseEtvaNode object.
  150.      * @see        applyDefaults()
  151.      */
  152.     public function __construct()
  153.     {
  154.         parent::__construct();
  155.         $this->applyDefaultValues();
  156.     }
  157.  
  158.     /**
  159.      * Applies default values to this object.
  160.      * This method should be called from the object's constructor (or
  161.      * equivalent initialization method).
  162.      * @see        __construct()
  163.      */
  164.     public function applyDefaultValues()
  165.     {
  166.         $this->state = 1;
  167.     }
  168.  
  169.     /**
  170.      * Get the [id] column value.
  171.      * 
  172.      * @return     int 
  173.      */
  174.     public function getId()
  175.     {
  176.         return $this->id;
  177.     }
  178.  
  179.     /**
  180.      * Get the [name] column value.
  181.      * 
  182.      * @return     string 
  183.      */
  184.     public function getName()
  185.     {
  186.         return $this->name;
  187.     }
  188.  
  189.     /**
  190.      * Get the [memtotal] column value.
  191.      * 
  192.      * @return     int 
  193.      */
  194.     public function getMemtotal()
  195.     {
  196.         return $this->memtotal;
  197.     }
  198.  
  199.     /**
  200.      * Get the [memfree] column value.
  201.      * 
  202.      * @return     int 
  203.      */
  204.     public function getMemfree()
  205.     {
  206.         return $this->memfree;
  207.     }
  208.  
  209.     /**
  210.      * Get the [cputotal] column value.
  211.      * 
  212.      * @return     int 
  213.      */
  214.     public function getCputotal()
  215.     {
  216.         return $this->cputotal;
  217.     }
  218.  
  219.     /**
  220.      * Get the [ip] column value.
  221.      * 
  222.      * @return     string 
  223.      */
  224.     public function getIp()
  225.     {
  226.         return $this->ip;
  227.     }
  228.  
  229.     /**
  230.      * Get the [port] column value.
  231.      * 
  232.      * @return     int 
  233.      */
  234.     public function getPort()
  235.     {
  236.         return $this->port;
  237.     }
  238.  
  239.     /**
  240.      * Get the [uid] column value.
  241.      * 
  242.      * @return     string 
  243.      */
  244.     public function getUid()
  245.     {
  246.         return $this->uid;
  247.     }
  248.  
  249.     /**
  250.      * Get the [network_cards] column value.
  251.      * 
  252.      * @return     int 
  253.      */
  254.     public function getNetworkCards()
  255.     {
  256.         return $this->network_cards;
  257.     }
  258.  
  259.     /**
  260.      * Get the [state] column value.
  261.      * 
  262.      * @return     int 
  263.      */
  264.     public function getState()
  265.     {
  266.         return $this->state;
  267.     }
  268.  
  269.     /**
  270.      * Get the [optionally formatted] temporal [created_at] column value.
  271.      * 
  272.      *
  273.      * @param      string $format The date/time format string (either date()-style or strftime()-style).
  274.      *                             If format is NULL, then the raw DateTime object will be returned.
  275.      * @return     mixed Formatted date/time value as string or DateTime object (if format is NULL), NULL if column is NULL
  276.      * @throws     PropelException - if unable to parse/validate the date/time value.
  277.      */
  278.     public function getCreatedAt($format 'Y-m-d H:i:s')
  279.     {
  280.         if ($this->created_at === null{
  281.             return null;
  282.         }
  283.  
  284.  
  285.  
  286.         try {
  287.             $dt new DateTime($this->created_at);
  288.         catch (Exception $x{
  289.             throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " var_export($this->created_attrue)$x);
  290.         }
  291.  
  292.         if ($format === null{
  293.             // Because propel.useDateTimeClass is TRUE, we return a DateTime object.
  294.             return $dt;
  295.         elseif (strpos($format'%'!== false{
  296.             return strftime($format$dt->format('U'));
  297.         else {
  298.             return $dt->format($format);
  299.         }
  300.     }
  301.  
  302.     /**
  303.      * Set the value of [id] column.
  304.      * 
  305.      * @param      int $v new value
  306.      * @return     EtvaNode The current object (for fluent API support)
  307.      */
  308.     public function setId($v)
  309.     {
  310.         if ($v !== null{
  311.             $v = (int) $v;
  312.         }
  313.  
  314.         if ($this->id !== $v{
  315.             $this->id = $v;
  316.             $this->modifiedColumns[EtvaNodePeer::ID;
  317.         }
  318.  
  319.         return $this;
  320.     // setId()
  321.  
  322.     /**
  323.      * Set the value of [name] column.
  324.      * 
  325.      * @param      string $v new value
  326.      * @return     EtvaNode The current object (for fluent API support)
  327.      */
  328.     public function setName($v)
  329.     {
  330.         if ($v !== null{
  331.             $v = (string) $v;
  332.         }
  333.  
  334.         if ($this->name !== $v{
  335.             $this->name = $v;
  336.             $this->modifiedColumns[EtvaNodePeer::NAME;
  337.         }
  338.  
  339.         return $this;
  340.     // setName()
  341.  
  342.     /**
  343.      * Set the value of [memtotal] column.
  344.      * 
  345.      * @param      int $v new value
  346.      * @return     EtvaNode The current object (for fluent API support)
  347.      */
  348.     public function setMemtotal($v)
  349.     {
  350.         if ($v !== null{
  351.             $v = (int) $v;
  352.         }
  353.  
  354.         if ($this->memtotal !== $v{
  355.             $this->memtotal = $v;
  356.             $this->modifiedColumns[EtvaNodePeer::MEMTOTAL;
  357.         }
  358.  
  359.         return $this;
  360.     // setMemtotal()
  361.  
  362.     /**
  363.      * Set the value of [memfree] column.
  364.      * 
  365.      * @param      int $v new value
  366.      * @return     EtvaNode The current object (for fluent API support)
  367.      */
  368.     public function setMemfree($v)
  369.     {
  370.         if ($v !== null{
  371.             $v = (int) $v;
  372.         }
  373.  
  374.         if ($this->memfree !== $v{
  375.             $this->memfree = $v;
  376.             $this->modifiedColumns[EtvaNodePeer::MEMFREE;
  377.         }
  378.  
  379.         return $this;
  380.     // setMemfree()
  381.  
  382.     /**
  383.      * Set the value of [cputotal] column.
  384.      * 
  385.      * @param      int $v new value
  386.      * @return     EtvaNode The current object (for fluent API support)
  387.      */
  388.     public function setCputotal($v)
  389.     {
  390.         if ($v !== null{
  391.             $v = (int) $v;
  392.         }
  393.  
  394.         if ($this->cputotal !== $v{
  395.             $this->cputotal = $v;
  396.             $this->modifiedColumns[EtvaNodePeer::CPUTOTAL;
  397.         }
  398.  
  399.         return $this;
  400.     // setCputotal()
  401.  
  402.     /**
  403.      * Set the value of [ip] column.
  404.      * 
  405.      * @param      string $v new value
  406.      * @return     EtvaNode The current object (for fluent API support)
  407.      */
  408.     public function setIp($v)
  409.     {
  410.         if ($v !== null{
  411.             $v = (string) $v;
  412.         }
  413.  
  414.         if ($this->ip !== $v{
  415.             $this->ip = $v;
  416.             $this->modifiedColumns[EtvaNodePeer::IP;
  417.         }
  418.  
  419.         return $this;
  420.     // setIp()
  421.  
  422.     /**
  423.      * Set the value of [port] column.
  424.      * 
  425.      * @param      int $v new value
  426.      * @return     EtvaNode The current object (for fluent API support)
  427.      */
  428.     public function setPort($v)
  429.     {
  430.         if ($v !== null{
  431.             $v = (int) $v;
  432.         }
  433.  
  434.         if ($this->port !== $v{
  435.             $this->port = $v;
  436.             $this->modifiedColumns[EtvaNodePeer::PORT;
  437.         }
  438.  
  439.         return $this;
  440.     // setPort()
  441.  
  442.     /**
  443.      * Set the value of [uid] column.
  444.      * 
  445.      * @param      string $v new value
  446.      * @return     EtvaNode The current object (for fluent API support)
  447.      */
  448.     public function setUid($v)
  449.     {
  450.         if ($v !== null{
  451.             $v = (string) $v;
  452.         }
  453.  
  454.         if ($this->uid !== $v{
  455.             $this->uid = $v;
  456.             $this->modifiedColumns[EtvaNodePeer::UID;
  457.         }
  458.  
  459.         return $this;
  460.     // setUid()
  461.  
  462.     /**
  463.      * Set the value of [network_cards] column.
  464.      * 
  465.      * @param      int $v new value
  466.      * @return     EtvaNode The current object (for fluent API support)
  467.      */
  468.     public function setNetworkCards($v)
  469.     {
  470.         if ($v !== null{
  471.             $v = (int) $v;
  472.         }
  473.  
  474.         if ($this->network_cards !== $v{
  475.             $this->network_cards = $v;
  476.             $this->modifiedColumns[EtvaNodePeer::NETWORK_CARDS;
  477.         }
  478.  
  479.         return $this;
  480.     // setNetworkCards()
  481.  
  482.     /**
  483.      * Set the value of [state] column.
  484.      * 
  485.      * @param      int $v new value
  486.      * @return     EtvaNode The current object (for fluent API support)
  487.      */
  488.     public function setState($v)
  489.     {
  490.         if ($v !== null{
  491.             $v = (int) $v;
  492.         }
  493.  
  494.         if ($this->state !== $v || $v === 1{
  495.             $this->state = $v;
  496.             $this->modifiedColumns[EtvaNodePeer::STATE;
  497.         }
  498.  
  499.         return $this;
  500.     // setState()
  501.  
  502.     /**
  503.      * Sets the value of [created_at] column to a normalized version of the date/time value specified.
  504.      * 
  505.      * @param      mixed $v string, integer (timestamp), or DateTime value.  Empty string will
  506.      *                         be treated as NULL for temporal objects.
  507.      * @return     EtvaNode The current object (for fluent API support)
  508.      */
  509.     public function setCreatedAt($v)
  510.     {
  511.         // we treat '' as NULL for temporal objects because DateTime('') == DateTime('now')
  512.         // -- which is unexpected, to say the least.
  513.         if ($v === null || $v === ''{
  514.             $dt null;
  515.         elseif ($v instanceof DateTime{
  516.             $dt $v;
  517.         else {
  518.             // some string/numeric value passed; we normalize that so that we can
  519.             // validate it.
  520.             try {
  521.                 if (is_numeric($v)) // if it's a unix timestamp
  522.                     $dt new DateTime('@'.$vnew DateTimeZone('UTC'));
  523.                     // We have to explicitly specify and then change the time zone because of a
  524.                     // DateTime bug: http://bugs.php.net/bug.php?id=43003
  525.                     $dt->setTimeZone(new DateTimeZone(date_default_timezone_get()));
  526.                 else {
  527.                     $dt new DateTime($v);
  528.                 }
  529.             catch (Exception $x{
  530.                 throw new PropelException('Error parsing date/time value: ' var_export($vtrue)$x);
  531.             }
  532.         }
  533.  
  534.         if $this->created_at !== null || $dt !== null {
  535.             // (nested ifs are a little easier to read in this case)
  536.  
  537.             $currNorm ($this->created_at !== null && $tmpDt new DateTime($this->created_at)) $tmpDt->format('Y-m-d\\TH:i:sO'null;
  538.             $newNorm ($dt !== null$dt->format('Y-m-d\\TH:i:sO'null;
  539.  
  540.             if ( ($currNorm !== $newNorm// normalized values don't match 
  541.                     )
  542.             {
  543.                 $this->created_at = ($dt $dt->format('Y-m-d\\TH:i:sO'null);
  544.                 $this->modifiedColumns[EtvaNodePeer::CREATED_AT;
  545.             }
  546.         // if either are not null
  547.  
  548.         return $this;
  549.     // setCreatedAt()
  550.  
  551.     /**
  552.      * Indicates whether the columns in this object are only set to default values.
  553.      *
  554.      * This method can be used in conjunction with isModified() to indicate whether an object is both
  555.      * modified _and_ has some values set which are non-default.
  556.      *
  557.      * @return     boolean Whether the columns in this object are only been set with default values.
  558.      */
  559.     public function hasOnlyDefaultValues()
  560.     {
  561.             // First, ensure that we don't have any columns that have been modified which aren't default columns.
  562.             if (array_diff($this->modifiedColumnsarray(EtvaNodePeer::STATE))) {
  563.                 return false;
  564.             }
  565.  
  566.             if ($this->state !== 1{
  567.                 return false;
  568.             }
  569.  
  570.         // otherwise, everything was equal, so return TRUE
  571.         return true;
  572.     // hasOnlyDefaultValues()
  573.  
  574.     /**
  575.      * Hydrates (populates) the object variables with values from the database resultset.
  576.      *
  577.      * An offset (0-based "start column") is specified so that objects can be hydrated
  578.      * with a subset of the columns in the resultset rows.  This is needed, for example,
  579.      * for results of JOIN queries where the resultset row includes columns from two or
  580.      * more tables.
  581.      *
  582.      * @param      array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM)
  583.      * @param      int $startcol 0-based offset column which indicates which restultset column to start with.
  584.      * @param      boolean $rehydrate Whether this object is being re-hydrated from the database.
  585.      * @return     int next starting column
  586.      * @throws     PropelException  - Any caught Exception will be rewrapped as a PropelException.
  587.      */
  588.     public function hydrate($row$startcol 0$rehydrate false)
  589.     {
  590.         try {
  591.  
  592.             $this->id = ($row[$startcol 0!== null? (int) $row[$startcol 0null;
  593.             $this->name = ($row[$startcol 1!== null? (string) $row[$startcol 1null;
  594.             $this->memtotal = ($row[$startcol 2!== null? (int) $row[$startcol 2null;
  595.             $this->memfree = ($row[$startcol 3!== null? (int) $row[$startcol 3null;
  596.             $this->cputotal = ($row[$startcol 4!== null? (int) $row[$startcol 4null;
  597.             $this->ip = ($row[$startcol 5!== null? (string) $row[$startcol 5null;
  598.             $this->port = ($row[$startcol 6!== null? (int) $row[$startcol 6null;
  599.             $this->uid = ($row[$startcol 7!== null? (string) $row[$startcol 7null;
  600.             $this->network_cards = ($row[$startcol 8!== null? (int) $row[$startcol 8null;
  601.             $this->state = ($row[$startcol 9!== null? (int) $row[$startcol 9null;
  602.             $this->created_at = ($row[$startcol 10!== null? (string) $row[$startcol 10null;
  603.             $this->resetModified();
  604.  
  605.             $this->setNew(false);
  606.  
  607.             if ($rehydrate{
  608.                 $this->ensureConsistency();
  609.             }
  610.  
  611.             // FIXME - using NUM_COLUMNS may be clearer.
  612.             return $startcol 11// 11 = EtvaNodePeer::NUM_COLUMNS - EtvaNodePeer::NUM_LAZY_LOAD_COLUMNS).
  613.  
  614.         catch (Exception $e{
  615.             throw new PropelException("Error populating EtvaNode object"$e);
  616.         }
  617.     }
  618.  
  619.     /**
  620.      * Checks and repairs the internal consistency of the object.
  621.      *
  622.      * This method is executed after an already-instantiated object is re-hydrated
  623.      * from the database.  It exists to check any foreign keys to make sure that
  624.      * the objects related to the current object are correct based on foreign key.
  625.      *
  626.      * You can override this method in the stub class, but you should always invoke
  627.      * the base method from the overridden method (i.e. parent::ensureConsistency()),
  628.      * in case your model changes.
  629.      *
  630.      * @throws     PropelException
  631.      */
  632.     public function ensureConsistency()
  633.     {
  634.  
  635.     // ensureConsistency
  636.  
  637.     /**
  638.      * Reloads this object from datastore based on primary key and (optionally) resets all associated objects.
  639.      *
  640.      * This will only work if the object has been saved and has a valid primary key set.
  641.      *
  642.      * @param      boolean $deep (optional) Whether to also de-associated any related objects.
  643.      * @param      PropelPDO $con (optional) The PropelPDO connection to use.
  644.      * @return     void 
  645.      * @throws     PropelException - if this object is deleted, unsaved or doesn't have pk match in db
  646.      */
  647.     public function reload($deep falsePropelPDO $con null)
  648.     {
  649.         if ($this->isDeleted()) {
  650.             throw new PropelException("Cannot reload a deleted object.");
  651.         }
  652.  
  653.         if ($this->isNew()) {
  654.             throw new PropelException("Cannot reload an unsaved object.");
  655.         }
  656.  
  657.         if ($con === null{
  658.             $con Propel::getConnection(EtvaNodePeer::DATABASE_NAMEPropel::CONNECTION_READ);
  659.         }
  660.  
  661.         // We don't need to alter the object instance pool; we're just modifying this instance
  662.         // already in the pool.
  663.  
  664.         $stmt EtvaNodePeer::doSelectStmt($this->buildPkeyCriteria()$con);
  665.         $row $stmt->fetch(PDO::FETCH_NUM);
  666.         $stmt->closeCursor();
  667.         if (!$row{
  668.             throw new PropelException('Cannot find matching row in the database to reload object values.');
  669.         }
  670.         $this->hydrate($row0true)// rehydrate
  671.  
  672.         if ($deep{  // also de-associate any related objects?
  673.  
  674.             $this->collEtvaServers = null;
  675.             $this->lastEtvaServerCriteria null;
  676.  
  677.             $this->collEtvaPhysicalvolumes = null;
  678.             $this->lastEtvaPhysicalvolumeCriteria null;
  679.  
  680.             $this->collEtvaVolumegroups = null;
  681.             $this->lastEtvaVolumegroupCriteria null;
  682.  
  683.             $this->collEtvaLogicalvolumes = null;
  684.             $this->lastEtvaLogicalvolumeCriteria null;
  685.  
  686.         // if (deep)
  687.     }
  688.  
  689.     /**
  690.      * Removes this object from datastore and sets delete attribute.
  691.      *
  692.      * @param      PropelPDO $con 
  693.      * @return     void 
  694.      * @throws     PropelException
  695.      * @see        BaseObject::setDeleted()
  696.      * @see        BaseObject::isDeleted()
  697.      */
  698.     public function delete(PropelPDO $con null)
  699.     {
  700.  
  701.     foreach (sfMixer::getCallables('BaseEtvaNode:delete:pre'as $callable)
  702.     {
  703.       $ret call_user_func($callable$this$con);
  704.       if ($ret)
  705.       {
  706.         return;
  707.       }
  708.     }
  709.  
  710.  
  711.         if ($this->isDeleted()) {
  712.             throw new PropelException("This object has already been deleted.");
  713.         }
  714.  
  715.         if ($con === null{
  716.             $con Propel::getConnection(EtvaNodePeer::DATABASE_NAMEPropel::CONNECTION_WRITE);
  717.         }
  718.         
  719.         $con->beginTransaction();
  720.         try {
  721.             EtvaNodePeer::doDelete($this$con);
  722.             $this->setDeleted(true);
  723.             $con->commit();
  724.         catch (PropelException $e{
  725.             $con->rollBack();
  726.             throw $e;
  727.         }
  728.     
  729.  
  730.     foreach (sfMixer::getCallables('BaseEtvaNode:delete:post'as $callable)
  731.     {
  732.       call_user_func($callable$this$con);
  733.     }
  734.  
  735.   }
  736.     /**
  737.      * Persists this object to the database.
  738.      *
  739.      * If the object is new, it inserts it; otherwise an update is performed.
  740.      * All modified related objects will also be persisted in the doSave()
  741.      * method.  This method wraps all precipitate database operations in a
  742.      * single transaction.
  743.      *
  744.      * @param      PropelPDO $con 
  745.      * @return     int The number of rows affected by this insert/update and any referring fk objects' save() operations.
  746.      * @throws     PropelException
  747.      * @see        doSave()
  748.      */
  749.     public function save(PropelPDO $con null)
  750.     {
  751.  
  752.     foreach (sfMixer::getCallables('BaseEtvaNode:save:pre'as $callable)
  753.     {
  754.       $affectedRows call_user_func($callable$this$con);
  755.       if (is_int($affectedRows))
  756.       {
  757.         return $affectedRows;
  758.       }
  759.     }
  760.  
  761.  
  762.     if ($this->isNew(&& !$this->isColumnModified(EtvaNodePeer::CREATED_AT))
  763.     {
  764.       $this->setCreatedAt(time());
  765.     }
  766.  
  767.         if ($this->isDeleted()) {
  768.             throw new PropelException("You cannot save an object that has been deleted.");
  769.         }
  770.  
  771.         if ($con === null{
  772.             $con Propel::getConnection(EtvaNodePeer::DATABASE_NAMEPropel::CONNECTION_WRITE);
  773.         }
  774.         
  775.         $con->beginTransaction();
  776.         try {
  777.             $affectedRows $this->doSave($con);
  778.             $con->commit();
  779.     foreach (sfMixer::getCallables('BaseEtvaNode:save:post'as $callable)
  780.     {
  781.       call_user_func($callable$this$con$affectedRows);
  782.     }
  783.  
  784.             EtvaNodePeer::addInstanceToPool($this);
  785.             return $affectedRows;
  786.         catch (PropelException $e{
  787.             $con->rollBack();
  788.             throw $e;
  789.         }
  790.     }
  791.  
  792.     /**
  793.      * Performs the work of inserting or updating the row in the database.
  794.      *
  795.      * If the object is new, it inserts it; otherwise an update is performed.
  796.      * All related objects are also updated in this method.
  797.      *
  798.      * @param      PropelPDO $con 
  799.      * @return     int The number of rows affected by this insert/update and any referring fk objects' save() operations.
  800.      * @throws     PropelException
  801.      * @see        save()
  802.      */
  803.     protected function doSave(PropelPDO $con)
  804.     {
  805.         $affectedRows 0// initialize var to track total num of affected rows
  806.         if (!$this->alreadyInSave{
  807.             $this->alreadyInSave = true;
  808.  
  809.             if ($this->isNew() ) {
  810.                 $this->modifiedColumns[EtvaNodePeer::ID;
  811.             }
  812.  
  813.             // If this object has been modified, then save it to the database.
  814.             if ($this->isModified()) {
  815.                 if ($this->isNew()) {
  816.                     $pk EtvaNodePeer::doInsert($this$con);
  817.                     $affectedRows += 1// we are assuming that there is only 1 row per doInsert() which
  818.                                          // should always be true here (even though technically
  819.                                          // BasePeer::doInsert() can insert multiple rows).
  820.  
  821.                     $this->setId($pk);  //[IMV] update autoincrement primary key
  822.  
  823.                     $this->setNew(false);
  824.                 else {
  825.                     $affectedRows += EtvaNodePeer::doUpdate($this$con);
  826.                 }
  827.  
  828.                 $this->resetModified()// [HL] After being saved an object is no longer 'modified'
  829.             }
  830.  
  831.             if ($this->collEtvaServers !== null{
  832.                 foreach ($this->collEtvaServers as $referrerFK{
  833.                     if (!$referrerFK->isDeleted()) {
  834.                         $affectedRows += $referrerFK->save($con);
  835.                     }
  836.                 }
  837.             }
  838.  
  839.             if ($this->collEtvaPhysicalvolumes !== null{
  840.                 foreach ($this->collEtvaPhysicalvolumes as $referrerFK{
  841.                     if (!$referrerFK->isDeleted()) {
  842.                         $affectedRows += $referrerFK->save($con);
  843.                     }
  844.                 }
  845.             }
  846.  
  847.             if ($this->collEtvaVolumegroups !== null{
  848.                 foreach ($this->collEtvaVolumegroups as $referrerFK{
  849.                     if (!$referrerFK->isDeleted()) {
  850.                         $affectedRows += $referrerFK->save($con);
  851.                     }
  852.                 }
  853.             }
  854.  
  855.             if ($this->collEtvaLogicalvolumes !== null{
  856.                 foreach ($this->collEtvaLogicalvolumes as $referrerFK{
  857.                     if (!$referrerFK->isDeleted()) {
  858.                         $affectedRows += $referrerFK->save($con);
  859.                     }
  860.                 }
  861.             }
  862.  
  863.             $this->alreadyInSave = false;
  864.  
  865.         }
  866.         return $affectedRows;
  867.     // doSave()
  868.  
  869.     /**
  870.      * Array of ValidationFailed objects.
  871.      * @var        array ValidationFailed[]
  872.      */
  873.     protected $validationFailures = array();
  874.  
  875.     /**
  876.      * Gets any ValidationFailed objects that resulted from last call to validate().
  877.      *
  878.      *
  879.      * @return     array ValidationFailed[]
  880.      * @see        validate()
  881.      */
  882.     public function getValidationFailures()
  883.     {
  884.         return $this->validationFailures;
  885.     }
  886.  
  887.     /**
  888.      * Validates the objects modified field values and all objects related to this table.
  889.      *
  890.      * If $columns is either a column name or an array of column names
  891.      * only those columns are validated.
  892.      *
  893.      * @param      mixed $columns Column name or an array of column names.
  894.      * @return     boolean Whether all columns pass validation.
  895.      * @see        doValidate()
  896.      * @see        getValidationFailures()
  897.      */
  898.     public function validate($columns null)
  899.     {
  900.         $res $this->doValidate($columns);
  901.         if ($res === true{
  902.             $this->validationFailures = array();
  903.             return true;
  904.         else {
  905.             $this->validationFailures = $res;
  906.             return false;
  907.         }
  908.     }
  909.  
  910.     /**
  911.      * This function performs the validation work for complex object models.
  912.      *
  913.      * In addition to checking the current object, all related objects will
  914.      * also be validated.  If all pass then <code>true</code> is returned; otherwise
  915.      * an aggreagated array of ValidationFailed objects will be returned.
  916.      *
  917.      * @param      array $columns Array of column names to validate.
  918.      * @return     mixed <code>true</code> if all validations pass; array of <code>ValidationFailed</code> objets otherwise.
  919.      */
  920.     protected function doValidate($columns null)
  921.     {
  922.         if (!$this->alreadyInValidation{
  923.             $this->alreadyInValidation = true;
  924.             $retval null;
  925.  
  926.             $failureMap array();
  927.  
  928.  
  929.             if (($retval EtvaNodePeer::doValidate($this$columns)) !== true{
  930.                 $failureMap array_merge($failureMap$retval);
  931.             }
  932.  
  933.  
  934.                 if ($this->collEtvaServers !== null{
  935.                     foreach ($this->collEtvaServers as $referrerFK{
  936.                         if (!$referrerFK->validate($columns)) {
  937.                             $failureMap array_merge($failureMap$referrerFK->getValidationFailures());
  938.                         }
  939.                     }
  940.                 }
  941.  
  942.                 if ($this->collEtvaPhysicalvolumes !== null{
  943.                     foreach ($this->collEtvaPhysicalvolumes as $referrerFK{
  944.                         if (!$referrerFK->validate($columns)) {
  945.                             $failureMap array_merge($failureMap$referrerFK->getValidationFailures());
  946.                         }
  947.                     }
  948.                 }
  949.  
  950.                 if ($this->collEtvaVolumegroups !== null{
  951.                     foreach ($this->collEtvaVolumegroups as $referrerFK{
  952.                         if (!$referrerFK->validate($columns)) {
  953.                             $failureMap array_merge($failureMap$referrerFK->getValidationFailures());
  954.                         }
  955.                     }
  956.                 }
  957.  
  958.                 if ($this->collEtvaLogicalvolumes !== null{
  959.                     foreach ($this->collEtvaLogicalvolumes as $referrerFK{
  960.                         if (!$referrerFK->validate($columns)) {
  961.                             $failureMap array_merge($failureMap$referrerFK->getValidationFailures());
  962.                         }
  963.                     }
  964.                 }
  965.  
  966.  
  967.             $this->alreadyInValidation = false;
  968.         }
  969.  
  970.         return (!empty($failureMap$failureMap true);
  971.     }
  972.  
  973.     /**
  974.      * Retrieves a field from the object by name passed in as a string.
  975.      *
  976.      * @param      string $name name
  977.      * @param      string $type The type of fieldname the $name is of:
  978.      *                      one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
  979.      *                      BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
  980.      * @return     mixed Value of field.
  981.      */
  982.     public function getByName($name$type BasePeer::TYPE_PHPNAME)
  983.     {
  984.         $pos EtvaNodePeer::translateFieldName($name$typeBasePeer::TYPE_NUM);
  985.         $field $this->getByPosition($pos);
  986.         return $field;
  987.     }
  988.  
  989.     /**
  990.      * Retrieves a field from the object by Position as specified in the xml schema.
  991.      * Zero-based.
  992.      *
  993.      * @param      int $pos position in xml schema
  994.      * @return     mixed Value of field at $pos
  995.      */
  996.     public function getByPosition($pos)
  997.     {
  998.         switch($pos{
  999.             case 0:
  1000.                 return $this->getId();
  1001.                 break;
  1002.             case 1:
  1003.                 return $this->getName();
  1004.                 break;
  1005.             case 2:
  1006.                 return $this->getMemtotal();
  1007.                 break;
  1008.             case 3:
  1009.                 return $this->getMemfree();
  1010.                 break;
  1011.             case 4:
  1012.                 return $this->getCputotal();
  1013.                 break;
  1014.             case 5:
  1015.                 return $this->getIp();
  1016.                 break;
  1017.             case 6:
  1018.                 return $this->getPort();
  1019.                 break;
  1020.             case 7:
  1021.                 return $this->getUid();
  1022.                 break;
  1023.             case 8:
  1024.                 return $this->getNetworkCards();
  1025.                 break;
  1026.             case 9:
  1027.                 return $this->getState();
  1028.                 break;
  1029.             case 10:
  1030.                 return $this->getCreatedAt();
  1031.                 break;
  1032.             default:
  1033.                 return null;
  1034.                 break;
  1035.         // switch()
  1036.     }
  1037.  
  1038.     /**
  1039.      * Exports the object as an array.
  1040.      *
  1041.      * You can specify the key type of the array by passing one of the class
  1042.      * type constants.
  1043.      *
  1044.      * @param      string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
  1045.      *                         BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. Defaults to BasePeer::TYPE_PHPNAME.
  1046.      * @param      boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns.  Defaults to TRUE.
  1047.      * @return     an associative array containing the field names (as keys) and field values
  1048.      */
  1049.     public function toArray($keyType BasePeer::TYPE_PHPNAME$includeLazyLoadColumns true)
  1050.     {
  1051.         $keys EtvaNodePeer::getFieldNames($keyType);
  1052.         $result array(
  1053.             $keys[0=> $this->getId(),
  1054.             $keys[1=> $this->getName(),
  1055.             $keys[2=> $this->getMemtotal(),
  1056.             $keys[3=> $this->getMemfree(),
  1057.             $keys[4=> $this->getCputotal(),
  1058.             $keys[5=> $this->getIp(),
  1059.             $keys[6=> $this->getPort(),
  1060.             $keys[7=> $this->getUid(),
  1061.             $keys[8=> $this->getNetworkCards(),
  1062.             $keys[9=> $this->getState(),
  1063.             $keys[10=> $this->getCreatedAt(),
  1064.         );
  1065.         return $result;
  1066.     }
  1067.  
  1068.     /**
  1069.      * Sets a field from the object by name passed in as a string.
  1070.      *
  1071.      * @param      string $name peer name
  1072.      * @param      mixed $value field value
  1073.      * @param      string $type The type of fieldname the $name is of:
  1074.      *                      one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
  1075.      *                      BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
  1076.      * @return     void 
  1077.      */
  1078.     public function setByName($name$value$type BasePeer::TYPE_PHPNAME)
  1079.     {
  1080.         $pos EtvaNodePeer::translateFieldName($name$typeBasePeer::TYPE_NUM);
  1081.         return $this->setByPosition($pos$value);
  1082.     }
  1083.  
  1084.     /**
  1085.      * Sets a field from the object by Position as specified in the xml schema.
  1086.      * Zero-based.
  1087.      *
  1088.      * @param      int $pos position in xml schema
  1089.      * @param      mixed $value field value
  1090.      * @return     void 
  1091.      */
  1092.     public function setByPosition($pos$value)
  1093.     {
  1094.         switch($pos{
  1095.             case 0:
  1096.                 $this->setId($value);
  1097.                 break;
  1098.             case 1:
  1099.                 $this->setName($value);
  1100.                 break;
  1101.             case 2:
  1102.                 $this->setMemtotal($value);
  1103.                 break;
  1104.             case 3:
  1105.                 $this->setMemfree($value);
  1106.                 break;
  1107.             case 4:
  1108.                 $this->setCputotal($value);
  1109.                 break;
  1110.             case 5:
  1111.                 $this->setIp($value);
  1112.                 break;
  1113.             case 6:
  1114.                 $this->setPort($value);
  1115.                 break;
  1116.             case 7:
  1117.                 $this->setUid($value);
  1118.                 break;
  1119.             case 8:
  1120.                 $this->setNetworkCards($value);
  1121.                 break;
  1122.             case 9:
  1123.                 $this->setState($value);
  1124.                 break;
  1125.             case 10:
  1126.                 $this->setCreatedAt($value);
  1127.                 break;
  1128.         // switch()
  1129.     }
  1130.  
  1131.     /**
  1132.      * Populates the object using an array.
  1133.      *
  1134.      * This is particularly useful when populating an object from one of the
  1135.      * request arrays (e.g. $_POST).  This method goes through the column
  1136.      * names, checking to see whether a matching key exists in populated
  1137.      * array. If so the setByName() method is called for that column.
  1138.      *
  1139.      * You can specify the key type of the array by additionally passing one
  1140.      * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME,
  1141.      * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
  1142.      * The default key type is the column's phpname (e.g. 'AuthorId')
  1143.      *
  1144.      * @param      array  $arr     An array to populate the object from.
  1145.      * @param      string $keyType The type of keys the array uses.
  1146.      * @return     void 
  1147.      */
  1148.     public function fromArray($arr$keyType BasePeer::TYPE_PHPNAME)
  1149.     {
  1150.         $keys EtvaNodePeer::getFieldNames($keyType);
  1151.  
  1152.         if (array_key_exists($keys[0]$arr)) $this->setId($arr[$keys[0]]);
  1153.         if (array_key_exists($keys[1]$arr)) $this->setName($arr[$keys[1]]);
  1154.         if (array_key_exists($keys[2]$arr)) $this->setMemtotal($arr[$keys[2]]);
  1155.         if (array_key_exists($keys[3]$arr)) $this->setMemfree($arr[$keys[3]]);
  1156.         if (array_key_exists($keys[4]$arr)) $this->setCputotal($arr[$keys[4]]);
  1157.         if (array_key_exists($keys[5]$arr)) $this->setIp($arr[$keys[5]]);
  1158.         if (array_key_exists($keys[6]$arr)) $this->setPort($arr[$keys[6]]);
  1159.         if (array_key_exists($keys[7]$arr)) $this->setUid($arr[$keys[7]]);
  1160.         if (array_key_exists($keys[8]$arr)) $this->setNetworkCards($arr[$keys[8]]);
  1161.         if (array_key_exists($keys[9]$arr)) $this->setState($arr[$keys[9]]);
  1162.         if (array_key_exists($keys[10]$arr)) $this->setCreatedAt($arr[$keys[10]]);
  1163.     }
  1164.  
  1165.     /**
  1166.      * Build a Criteria object containing the values of all modified columns in this object.
  1167.      *
  1168.      * @return     Criteria The Criteria object containing all modified values.
  1169.      */
  1170.     public function buildCriteria()
  1171.     {
  1172.         $criteria new Criteria(EtvaNodePeer::DATABASE_NAME);
  1173.  
  1174.         if ($this->isColumnModified(EtvaNodePeer::ID)) $criteria->add(EtvaNodePeer::ID$this->id);
  1175.         if ($this->isColumnModified(EtvaNodePeer::NAME)) $criteria->add(EtvaNodePeer::NAME$this->name);
  1176.         if ($this->isColumnModified(EtvaNodePeer::MEMTOTAL)) $criteria->add(EtvaNodePeer::MEMTOTAL$this->memtotal);
  1177.         if ($this->isColumnModified(EtvaNodePeer::MEMFREE)) $criteria->add(EtvaNodePeer::MEMFREE$this->memfree);
  1178.         if ($this->isColumnModified(EtvaNodePeer::CPUTOTAL)) $criteria->add(EtvaNodePeer::CPUTOTAL$this->cputotal);
  1179.         if ($this->isColumnModified(EtvaNodePeer::IP)) $criteria->add(EtvaNodePeer::IP$this->ip);
  1180.         if ($this->isColumnModified(EtvaNodePeer::PORT)) $criteria->add(EtvaNodePeer::PORT$this->port);
  1181.         if ($this->isColumnModified(EtvaNodePeer::UID)) $criteria->add(EtvaNodePeer::UID$this->uid);
  1182.         if ($this->isColumnModified(EtvaNodePeer::NETWORK_CARDS)) $criteria->add(EtvaNodePeer::NETWORK_CARDS$this->network_cards);
  1183.         if ($this->isColumnModified(EtvaNodePeer::STATE)) $criteria->add(EtvaNodePeer::STATE$this->state);
  1184.         if ($this->isColumnModified(EtvaNodePeer::CREATED_AT)) $criteria->add(EtvaNodePeer::CREATED_AT$this->created_at);
  1185.  
  1186.         return $criteria;
  1187.     }
  1188.  
  1189.     /**
  1190.      * Builds a Criteria object containing the primary key for this object.
  1191.      *
  1192.      * Unlike buildCriteria() this method includes the primary key values regardless
  1193.      * of whether or not they have been modified.
  1194.      *
  1195.      * @return     Criteria The Criteria object containing value(s) for primary key(s).
  1196.      */
  1197.     public function buildPkeyCriteria()
  1198.     {
  1199.         $criteria new Criteria(EtvaNodePeer::DATABASE_NAME);
  1200.  
  1201.         $criteria->add(EtvaNodePeer::ID$this->id);
  1202.  
  1203.         return $criteria;
  1204.     }
  1205.  
  1206.     /**
  1207.      * Returns the primary key for this object (row).
  1208.      * @return     int 
  1209.      */
  1210.     public function getPrimaryKey()
  1211.     {
  1212.         return $this->getId();
  1213.     }
  1214.  
  1215.     /**
  1216.      * Generic method to set the primary key (id column).
  1217.      *
  1218.      * @param      int $key Primary key.
  1219.      * @return     void 
  1220.      */
  1221.     public function setPrimaryKey($key)
  1222.     {
  1223.         $this->setId($key);
  1224.     }
  1225.  
  1226.     /**
  1227.      * Sets contents of passed object to values from current object.
  1228.      *
  1229.      * If desired, this method can also make copies of all associated (fkey referrers)
  1230.      * objects.
  1231.      *
  1232.      * @param      object $copyObj An object of EtvaNode (or compatible) type.
  1233.      * @param      boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
  1234.      * @throws     PropelException
  1235.      */
  1236.     public function copyInto($copyObj$deepCopy false)
  1237.     {
  1238.  
  1239.         $copyObj->setName($this->name);
  1240.  
  1241.         $copyObj->setMemtotal($this->memtotal);
  1242.  
  1243.         $copyObj->setMemfree($this->memfree);
  1244.  
  1245.         $copyObj->setCputotal($this->cputotal);
  1246.  
  1247.         $copyObj->setIp($this->ip);
  1248.  
  1249.         $copyObj->setPort($this->port);
  1250.  
  1251.         $copyObj->setUid($this->uid);
  1252.  
  1253.         $copyObj->setNetworkCards($this->network_cards);
  1254.  
  1255.         $copyObj->setState($this->state);
  1256.  
  1257.         $copyObj->setCreatedAt($this->created_at);
  1258.  
  1259.  
  1260.         if ($deepCopy{
  1261.             // important: temporarily setNew(false) because this affects the behavior of
  1262.             // the getter/setter methods for fkey referrer objects.
  1263.             $copyObj->setNew(false);
  1264.  
  1265.             foreach ($this->getEtvaServers(as $relObj{
  1266.                 if ($relObj !== $this{  // ensure that we don't try to copy a reference to ourselves
  1267.                     $copyObj->addEtvaServer($relObj->copy($deepCopy));
  1268.                 }
  1269.             }
  1270.  
  1271.             foreach ($this->getEtvaPhysicalvolumes(as $relObj{
  1272.                 if ($relObj !== $this{  // ensure that we don't try to copy a reference to ourselves
  1273.                     $copyObj->addEtvaPhysicalvolume($relObj->copy($deepCopy));
  1274.                 }
  1275.             }
  1276.  
  1277.             foreach ($this->getEtvaVolumegroups(as $relObj{
  1278.                 if ($relObj !== $this{  // ensure that we don't try to copy a reference to ourselves
  1279.                     $copyObj->addEtvaVolumegroup($relObj->copy($deepCopy));
  1280.                 }
  1281.             }
  1282.  
  1283.             foreach ($this->getEtvaLogicalvolumes(as $relObj{
  1284.                 if ($relObj !== $this{  // ensure that we don't try to copy a reference to ourselves
  1285.                     $copyObj->addEtvaLogicalvolume($relObj->copy($deepCopy));
  1286.                 }
  1287.             }
  1288.  
  1289.         // if ($deepCopy)
  1290.  
  1291.  
  1292.         $copyObj->setNew(true);
  1293.  
  1294.         $copyObj->setId(NULL)// this is a auto-increment column, so set to default value
  1295.  
  1296.     }
  1297.  
  1298.     /**
  1299.      * Makes a copy of this object that will be inserted as a new row in table when saved.
  1300.      * It creates a new object filling in the simple attributes, but skipping any primary
  1301.      * keys that are defined for the table.
  1302.      *
  1303.      * If desired, this method can also make copies of all associated (fkey referrers)
  1304.      * objects.
  1305.      *
  1306.      * @param      boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
  1307.      * @return     EtvaNode Clone of current object.
  1308.      * @throws     PropelException
  1309.      */
  1310.     public function copy($deepCopy false)
  1311.     {
  1312.         // we use get_class(), because this might be a subclass
  1313.         $clazz get_class($this);
  1314.         $copyObj new $clazz();
  1315.         $this->copyInto($copyObj$deepCopy);
  1316.         return $copyObj;
  1317.     }
  1318.  
  1319.     /**
  1320.      * Returns a peer instance associated with this om.
  1321.      *
  1322.      * Since Peer classes are not to have any instance attributes, this method returns the
  1323.      * same instance for all member of this class. The method could therefore
  1324.      * be static, but this would prevent one from overriding the behavior.
  1325.      *
  1326.      * @return     EtvaNodePeer 
  1327.      */
  1328.     public function getPeer()
  1329.     {
  1330.         if (self::$peer === null{
  1331.             self::$peer new EtvaNodePeer();
  1332.         }
  1333.         return self::$peer;
  1334.     }
  1335.  
  1336.     /**
  1337.      * Clears out the collEtvaServers collection (array).
  1338.      *
  1339.      * This does not modify the database; however, it will remove any associated objects, causing
  1340.      * them to be refetched by subsequent calls to accessor method.
  1341.      *
  1342.      * @return     void 
  1343.      * @see        addEtvaServers()
  1344.      */
  1345.     public function clearEtvaServers()
  1346.     {
  1347.         $this->collEtvaServers = null// important to set this to NULL since that means it is uninitialized
  1348.     }
  1349.  
  1350.     /**
  1351.      * Initializes the collEtvaServers collection (array).
  1352.      *
  1353.      * By default this just sets the collEtvaServers collection to an empty array (like clearcollEtvaServers());
  1354.      * however, you may wish to override this method in your stub class to provide setting appropriate
  1355.      * to your application -- for example, setting the initial array to the values stored in database.
  1356.      *
  1357.      * @return     void 
  1358.      */
  1359.     public function initEtvaServers()
  1360.     {
  1361.         $this->collEtvaServers = array();
  1362.     }
  1363.  
  1364.     /**
  1365.      * Gets an array of EtvaServer objects which contain a foreign key that references this object.
  1366.      *
  1367.      * If this collection has already been initialized with an identical Criteria, it returns the collection.
  1368.      * Otherwise if this EtvaNode has previously been saved, it will retrieve
  1369.      * related EtvaServers from storage. If this EtvaNode is new, it will return
  1370.      * an empty collection or the current collection, the criteria is ignored on a new object.
  1371.      *
  1372.      * @param      PropelPDO $con 
  1373.      * @param      Criteria $criteria 
  1374.      * @return     array EtvaServer[]
  1375.      * @throws     PropelException
  1376.      */
  1377.     public function getEtvaServers($criteria nullPropelPDO $con null)
  1378.     {
  1379.         if ($criteria === null{
  1380.             $criteria new Criteria(EtvaNodePeer::DATABASE_NAME);
  1381.         }
  1382.         elseif ($criteria instanceof Criteria)
  1383.         {
  1384.             $criteria clone $criteria;
  1385.         }
  1386.  
  1387.         if ($this->collEtvaServers === null{
  1388.             if ($this->isNew()) {
  1389.                $this->collEtvaServers = array();
  1390.             else {
  1391.  
  1392.                 $criteria->add(EtvaServerPeer::NODE_ID$this->id);
  1393.  
  1394.                 EtvaServerPeer::addSelectColumns($criteria);
  1395.                 $this->collEtvaServers = EtvaServerPeer::doSelect($criteria$con);
  1396.             }
  1397.         else {
  1398.             // criteria has no effect for a new object
  1399.             if (!$this->isNew()) {
  1400.                 // the following code is to determine if a new query is
  1401.                 // called for.  If the criteria is the same as the last
  1402.                 // one, just return the collection.
  1403.  
  1404.  
  1405.                 $criteria->add(EtvaServerPeer::NODE_ID$this->id);
  1406.  
  1407.                 EtvaServerPeer::addSelectColumns($criteria);
  1408.                 if (!isset($this->lastEtvaServerCriteria|| !$this->lastEtvaServerCriteria->equals($criteria)) {
  1409.                     $this->collEtvaServers = EtvaServerPeer::doSelect($criteria$con);
  1410.                 }
  1411.             }
  1412.         }
  1413.         $this->lastEtvaServerCriteria $criteria;
  1414.         return $this->collEtvaServers;
  1415.     }
  1416.  
  1417.     /**
  1418.      * Returns the number of related EtvaServer objects.
  1419.      *
  1420.      * @param      Criteria $criteria 
  1421.      * @param      boolean $distinct 
  1422.      * @param      PropelPDO $con 
  1423.      * @return     int Count of related EtvaServer objects.
  1424.      * @throws     PropelException
  1425.      */
  1426.     public function countEtvaServers(Criteria $criteria null$distinct falsePropelPDO $con null)
  1427.     {
  1428.         if ($criteria === null{
  1429.             $criteria new Criteria(EtvaNodePeer::DATABASE_NAME);
  1430.         else {
  1431.             $criteria clone $criteria;
  1432.         }
  1433.  
  1434.         if ($distinct{
  1435.             $criteria->setDistinct();
  1436.         }
  1437.  
  1438.         $count null;
  1439.  
  1440.         if ($this->collEtvaServers === null{
  1441.             if ($this->isNew()) {
  1442.                 $count 0;
  1443.             else {
  1444.  
  1445.                 $criteria->add(EtvaServerPeer::NODE_ID$this->id);
  1446.  
  1447.                 $count EtvaServerPeer::doCount($criteria$con);
  1448.             }
  1449.         else {
  1450.             // criteria has no effect for a new object
  1451.             if (!$this->isNew()) {
  1452.                 // the following code is to determine if a new query is
  1453.                 // called for.  If the criteria is the same as the last
  1454.                 // one, just return count of the collection.
  1455.  
  1456.  
  1457.                 $criteria->add(EtvaServerPeer::NODE_ID$this->id);
  1458.  
  1459.                 if (!isset($this->lastEtvaServerCriteria|| !$this->lastEtvaServerCriteria->equals($criteria)) {
  1460.                     $count EtvaServerPeer::doCount($criteria$con);
  1461.                 else {
  1462.                     $count count($this->collEtvaServers);
  1463.                 }
  1464.             else {
  1465.                 $count count($this->collEtvaServers);
  1466.             }
  1467.         }
  1468.         $this->lastEtvaServerCriteria $criteria;
  1469.         return $count;
  1470.     }
  1471.  
  1472.     /**
  1473.      * Method called to associate a EtvaServer object to this object
  1474.      * through the EtvaServer foreign key attribute.
  1475.      *
  1476.      * @param      EtvaServer $l EtvaServer
  1477.      * @return     void 
  1478.      * @throws     PropelException
  1479.      */
  1480.     public function addEtvaServer(EtvaServer $l)
  1481.     {
  1482.         if ($this->collEtvaServers === null{
  1483.             $this->initEtvaServers();
  1484.         }
  1485.         if (!in_array($l$this->collEtvaServerstrue)) // only add it if the **same** object is not already associated
  1486.             array_push($this->collEtvaServers$l);
  1487.             $l->setEtvaNode($this);
  1488.         }
  1489.     }
  1490.  
  1491.  
  1492.     /**
  1493.      * If this collection has already been initialized with
  1494.      * an identical criteria, it returns the collection.
  1495.      * Otherwise if this EtvaNode is new, it will return
  1496.      * an empty collection; or if this EtvaNode has previously
  1497.      * been saved, it will retrieve related EtvaServers from storage.
  1498.      *
  1499.      * This method is protected by default in order to keep the public
  1500.      * api reasonable.  You can provide public methods for those you
  1501.      * actually need in EtvaNode.
  1502.      */
  1503.     public function getEtvaServersJoinEtvaLogicalvolume($criteria null$con null$join_behavior Criteria::LEFT_JOIN)
  1504.     {
  1505.         if ($criteria === null{
  1506.             $criteria new Criteria(EtvaNodePeer::DATABASE_NAME);
  1507.         }
  1508.         elseif ($criteria instanceof Criteria)
  1509.         {
  1510.             $criteria clone $criteria;
  1511.         }
  1512.  
  1513.         if ($this->collEtvaServers === null{
  1514.             if ($this->isNew()) {
  1515.                 $this->collEtvaServers = array();
  1516.             else {
  1517.  
  1518.                 $criteria->add(EtvaServerPeer::NODE_ID$this->id);
  1519.  
  1520.                 $this->collEtvaServers = EtvaServerPeer::doSelectJoinEtvaLogicalvolume($criteria$con$join_behavior);
  1521.             }
  1522.         else {
  1523.             // the following code is to determine if a new query is
  1524.             // called for.  If the criteria is the same as the last
  1525.             // one, just return the collection.
  1526.  
  1527.             $criteria->add(EtvaServerPeer::NODE_ID$this->id);
  1528.  
  1529.             if (!isset($this->lastEtvaServerCriteria|| !$this->lastEtvaServerCriteria->equals($criteria)) {
  1530.                 $this->collEtvaServers = EtvaServerPeer::doSelectJoinEtvaLogicalvolume($criteria$con$join_behavior);
  1531.             }
  1532.         }
  1533.         $this->lastEtvaServerCriteria $criteria;
  1534.  
  1535.         return $this->collEtvaServers;
  1536.     }
  1537.  
  1538.  
  1539.     /**
  1540.      * If this collection has already been initialized with
  1541.      * an identical criteria, it returns the collection.
  1542.      * Otherwise if this EtvaNode is new, it will return
  1543.      * an empty collection; or if this EtvaNode has previously
  1544.      * been saved, it will retrieve related EtvaServers from storage.
  1545.      *
  1546.      * This method is protected by default in order to keep the public
  1547.      * api reasonable.  You can provide public methods for those you
  1548.      * actually need in EtvaNode.
  1549.      */
  1550.     public function getEtvaServersJoinsfGuardGroup($criteria null$con null$join_behavior Criteria::LEFT_JOIN)
  1551.     {
  1552.         if ($criteria === null{
  1553.             $criteria new Criteria(EtvaNodePeer::DATABASE_NAME);
  1554.         }
  1555.         elseif ($criteria instanceof Criteria)
  1556.         {
  1557.             $criteria clone $criteria;
  1558.         }
  1559.  
  1560.         if ($this->collEtvaServers === null{
  1561.             if ($this->isNew()) {
  1562.                 $this->collEtvaServers = array();
  1563.             else {
  1564.  
  1565.                 $criteria->add(EtvaServerPeer::NODE_ID$this->id);
  1566.  
  1567.                 $this->collEtvaServers = EtvaServerPeer::doSelectJoinsfGuardGroup($criteria$con$join_behavior);
  1568.             }
  1569.         else {
  1570.             // the following code is to determine if a new query is
  1571.             // called for.  If the criteria is the same as the last
  1572.             // one, just return the collection.
  1573.  
  1574.             $criteria->add(EtvaServerPeer::NODE_ID$this->id);
  1575.  
  1576.             if (!isset($this->lastEtvaServerCriteria|| !$this->lastEtvaServerCriteria->equals($criteria)) {
  1577.                 $this->collEtvaServers = EtvaServerPeer::doSelectJoinsfGuardGroup($criteria$con$join_behavior);
  1578.             }
  1579.         }
  1580.         $this->lastEtvaServerCriteria $criteria;
  1581.  
  1582.         return $this->collEtvaServers;
  1583.     }
  1584.  
  1585.     /**
  1586.      * Clears out the collEtvaPhysicalvolumes collection (array).
  1587.      *
  1588.      * This does not modify the database; however, it will remove any associated objects, causing
  1589.      * them to be refetched by subsequent calls to accessor method.
  1590.      *
  1591.      * @return     void 
  1592.      * @see        addEtvaPhysicalvolumes()
  1593.      */
  1594.     public function clearEtvaPhysicalvolumes()
  1595.     {
  1596.         $this->collEtvaPhysicalvolumes = null// important to set this to NULL since that means it is uninitialized
  1597.     }
  1598.  
  1599.     /**
  1600.      * Initializes the collEtvaPhysicalvolumes collection (array).
  1601.      *
  1602.      * By default this just sets the collEtvaPhysicalvolumes collection to an empty array (like clearcollEtvaPhysicalvolumes());
  1603.      * however, you may wish to override this method in your stub class to provide setting appropriate
  1604.      * to your application -- for example, setting the initial array to the values stored in database.
  1605.      *
  1606.      * @return     void 
  1607.      */
  1608.     public function initEtvaPhysicalvolumes()
  1609.     {
  1610.         $this->collEtvaPhysicalvolumes = array();
  1611.     }
  1612.  
  1613.     /**
  1614.      * Gets an array of EtvaPhysicalvolume objects which contain a foreign key that references this object.
  1615.      *
  1616.      * If this collection has already been initialized with an identical Criteria, it returns the collection.
  1617.      * Otherwise if this EtvaNode has previously been saved, it will retrieve
  1618.      * related EtvaPhysicalvolumes from storage. If this EtvaNode is new, it will return
  1619.      * an empty collection or the current collection, the criteria is ignored on a new object.
  1620.      *
  1621.      * @param      PropelPDO $con 
  1622.      * @param      Criteria $criteria 
  1623.      * @return     array EtvaPhysicalvolume[]
  1624.      * @throws     PropelException
  1625.      */
  1626.     public function getEtvaPhysicalvolumes($criteria nullPropelPDO $con null)
  1627.     {
  1628.         if ($criteria === null{
  1629.             $criteria new Criteria(EtvaNodePeer::DATABASE_NAME);
  1630.         }
  1631.         elseif ($criteria instanceof Criteria)
  1632.         {
  1633.             $criteria clone $criteria;
  1634.         }
  1635.  
  1636.         if ($this->collEtvaPhysicalvolumes === null{
  1637.             if ($this->isNew()) {
  1638.                $this->collEtvaPhysicalvolumes = array();
  1639.             else {
  1640.  
  1641.                 $criteria->add(EtvaPhysicalvolumePeer::NODE_ID$this->id);
  1642.  
  1643.                 EtvaPhysicalvolumePeer::addSelectColumns($criteria);
  1644.                 $this->collEtvaPhysicalvolumes = EtvaPhysicalvolumePeer::doSelect($criteria$con);
  1645.             }
  1646.         else {
  1647.             // criteria has no effect for a new object
  1648.             if (!$this->isNew()) {
  1649.                 // the following code is to determine if a new query is
  1650.                 // called for.  If the criteria is the same as the last
  1651.                 // one, just return the collection.
  1652.  
  1653.  
  1654.                 $criteria->add(EtvaPhysicalvolumePeer::NODE_ID$this->id);
  1655.  
  1656.                 EtvaPhysicalvolumePeer::addSelectColumns($criteria);
  1657.                 if (!isset($this->lastEtvaPhysicalvolumeCriteria|| !$this->lastEtvaPhysicalvolumeCriteria->equals($criteria)) {
  1658.                     $this->collEtvaPhysicalvolumes = EtvaPhysicalvolumePeer::doSelect($criteria$con);
  1659.                 }
  1660.             }
  1661.         }
  1662.         $this->lastEtvaPhysicalvolumeCriteria $criteria;
  1663.         return $this->collEtvaPhysicalvolumes;
  1664.     }
  1665.  
  1666.     /**
  1667.      * Returns the number of related EtvaPhysicalvolume objects.
  1668.      *
  1669.      * @param      Criteria $criteria 
  1670.      * @param      boolean $distinct 
  1671.      * @param      PropelPDO $con 
  1672.      * @return     int Count of related EtvaPhysicalvolume objects.
  1673.      * @throws     PropelException
  1674.      */
  1675.     public function countEtvaPhysicalvolumes(Criteria $criteria null$distinct falsePropelPDO $con null)
  1676.     {
  1677.         if ($criteria === null{
  1678.             $criteria new Criteria(EtvaNodePeer::DATABASE_NAME);
  1679.         else {
  1680.             $criteria clone $criteria;
  1681.         }
  1682.  
  1683.         if ($distinct{
  1684.             $criteria->setDistinct();
  1685.         }
  1686.  
  1687.         $count null;
  1688.  
  1689.         if ($this->collEtvaPhysicalvolumes === null{
  1690.             if ($this->isNew()) {
  1691.                 $count 0;
  1692.             else {
  1693.  
  1694.                 $criteria->add(EtvaPhysicalvolumePeer::NODE_ID$this->id);
  1695.  
  1696.                 $count EtvaPhysicalvolumePeer::doCount($criteria$con);
  1697.             }
  1698.         else {
  1699.             // criteria has no effect for a new object
  1700.             if (!$this->isNew()) {
  1701.                 // the following code is to determine if a new query is
  1702.                 // called for.  If the criteria is the same as the last
  1703.                 // one, just return count of the collection.
  1704.  
  1705.  
  1706.                 $criteria->add(EtvaPhysicalvolumePeer::NODE_ID$this->id);
  1707.  
  1708.                 if (!isset($this->lastEtvaPhysicalvolumeCriteria|| !$this->lastEtvaPhysicalvolumeCriteria->equals($criteria)) {
  1709.                     $count EtvaPhysicalvolumePeer::doCount($criteria$con);
  1710.                 else {
  1711.                     $count count($this->collEtvaPhysicalvolumes);
  1712.                 }
  1713.             else {
  1714.                 $count count($this->collEtvaPhysicalvolumes);
  1715.             }
  1716.         }
  1717.         $this->lastEtvaPhysicalvolumeCriteria $criteria;
  1718.         return $count;
  1719.     }
  1720.  
  1721.     /**
  1722.      * Method called to associate a EtvaPhysicalvolume object to this object
  1723.      * through the EtvaPhysicalvolume foreign key attribute.
  1724.      *
  1725.      * @param      EtvaPhysicalvolume $l EtvaPhysicalvolume
  1726.      * @return     void 
  1727.      * @throws     PropelException
  1728.      */
  1729.     public function addEtvaPhysicalvolume(EtvaPhysicalvolume $l)
  1730.     {
  1731.         if ($this->collEtvaPhysicalvolumes === null{
  1732.             $this->initEtvaPhysicalvolumes();
  1733.         }
  1734.         if (!in_array($l$this->collEtvaPhysicalvolumestrue)) // only add it if the **same** object is not already associated
  1735.             array_push($this->collEtvaPhysicalvolumes$l);
  1736.             $l->setEtvaNode($this);
  1737.         }
  1738.     }
  1739.  
  1740.     /**
  1741.      * Clears out the collEtvaVolumegroups collection (array).
  1742.      *
  1743.      * This does not modify the database; however, it will remove any associated objects, causing
  1744.      * them to be refetched by subsequent calls to accessor method.
  1745.      *
  1746.      * @return     void 
  1747.      * @see        addEtvaVolumegroups()
  1748.      */
  1749.     public function clearEtvaVolumegroups()
  1750.     {
  1751.         $this->collEtvaVolumegroups = null// important to set this to NULL since that means it is uninitialized
  1752.     }
  1753.  
  1754.     /**
  1755.      * Initializes the collEtvaVolumegroups collection (array).
  1756.      *
  1757.      * By default this just sets the collEtvaVolumegroups collection to an empty array (like clearcollEtvaVolumegroups());
  1758.      * however, you may wish to override this method in your stub class to provide setting appropriate
  1759.      * to your application -- for example, setting the initial array to the values stored in database.
  1760.      *
  1761.      * @return     void 
  1762.      */
  1763.     public function initEtvaVolumegroups()
  1764.     {
  1765.         $this->collEtvaVolumegroups = array();
  1766.     }
  1767.  
  1768.     /**
  1769.      * Gets an array of EtvaVolumegroup objects which contain a foreign key that references this object.
  1770.      *
  1771.      * If this collection has already been initialized with an identical Criteria, it returns the collection.
  1772.      * Otherwise if this EtvaNode has previously been saved, it will retrieve
  1773.      * related EtvaVolumegroups from storage. If this EtvaNode is new, it will return
  1774.      * an empty collection or the current collection, the criteria is ignored on a new object.
  1775.      *
  1776.      * @param      PropelPDO $con 
  1777.      * @param      Criteria $criteria 
  1778.      * @return     array EtvaVolumegroup[]
  1779.      * @throws     PropelException
  1780.      */
  1781.     public function getEtvaVolumegroups($criteria nullPropelPDO $con null)
  1782.     {
  1783.         if ($criteria === null{
  1784.             $criteria new Criteria(EtvaNodePeer::DATABASE_NAME);
  1785.         }
  1786.         elseif ($criteria instanceof Criteria)
  1787.         {
  1788.             $criteria clone $criteria;
  1789.         }
  1790.  
  1791.         if ($this->collEtvaVolumegroups === null{
  1792.             if ($this->isNew()) {
  1793.                $this->collEtvaVolumegroups = array();
  1794.             else {
  1795.  
  1796.                 $criteria->add(EtvaVolumegroupPeer::NODE_ID$this->id);
  1797.  
  1798.                 EtvaVolumegroupPeer::addSelectColumns($criteria);
  1799.                 $this->collEtvaVolumegroups = EtvaVolumegroupPeer::doSelect($criteria$con);
  1800.             }
  1801.         else {
  1802.             // criteria has no effect for a new object
  1803.             if (!$this->isNew()) {
  1804.                 // the following code is to determine if a new query is
  1805.                 // called for.  If the criteria is the same as the last
  1806.                 // one, just return the collection.
  1807.  
  1808.  
  1809.                 $criteria->add(EtvaVolumegroupPeer::NODE_ID$this->id);
  1810.  
  1811.                 EtvaVolumegroupPeer::addSelectColumns($criteria);
  1812.                 if (!isset($this->lastEtvaVolumegroupCriteria|| !$this->lastEtvaVolumegroupCriteria->equals($criteria)) {
  1813.                     $this->collEtvaVolumegroups = EtvaVolumegroupPeer::doSelect($criteria$con);
  1814.                 }
  1815.             }
  1816.         }
  1817.         $this->lastEtvaVolumegroupCriteria $criteria;
  1818.         return $this->collEtvaVolumegroups;
  1819.     }
  1820.  
  1821.     /**
  1822.      * Returns the number of related EtvaVolumegroup objects.
  1823.      *
  1824.      * @param      Criteria $criteria 
  1825.      * @param      boolean $distinct 
  1826.      * @param      PropelPDO $con 
  1827.      * @return     int Count of related EtvaVolumegroup objects.
  1828.      * @throws     PropelException
  1829.      */
  1830.     public function countEtvaVolumegroups(Criteria $criteria null$distinct falsePropelPDO $con null)
  1831.     {
  1832.         if ($criteria === null{
  1833.             $criteria new Criteria(EtvaNodePeer::DATABASE_NAME);
  1834.         else {
  1835.             $criteria clone $criteria;
  1836.         }
  1837.  
  1838.         if ($distinct{
  1839.             $criteria->setDistinct();
  1840.         }
  1841.  
  1842.         $count null;
  1843.  
  1844.         if ($this->collEtvaVolumegroups === null{
  1845.             if ($this->isNew()) {
  1846.                 $count 0;
  1847.             else {
  1848.  
  1849.                 $criteria->add(EtvaVolumegroupPeer::NODE_ID$this->id);
  1850.  
  1851.                 $count EtvaVolumegroupPeer::doCount($criteria$con);
  1852.             }
  1853.         else {
  1854.             // criteria has no effect for a new object
  1855.             if (!$this->isNew()) {
  1856.                 // the following code is to determine if a new query is
  1857.                 // called for.  If the criteria is the same as the last
  1858.                 // one, just return count of the collection.
  1859.  
  1860.  
  1861.                 $criteria->add(EtvaVolumegroupPeer::NODE_ID$this->id);
  1862.  
  1863.                 if (!isset($this->lastEtvaVolumegroupCriteria|| !$this->lastEtvaVolumegroupCriteria->equals($criteria)) {
  1864.                     $count EtvaVolumegroupPeer::doCount($criteria$con);
  1865.                 else {
  1866.                     $count count($this->collEtvaVolumegroups);
  1867.                 }
  1868.             else {
  1869.                 $count count($this->collEtvaVolumegroups);
  1870.             }
  1871.         }
  1872.         $this->lastEtvaVolumegroupCriteria $criteria;
  1873.         return $count;
  1874.     }
  1875.  
  1876.     /**
  1877.      * Method called to associate a EtvaVolumegroup object to this object
  1878.      * through the EtvaVolumegroup foreign key attribute.
  1879.      *
  1880.      * @param      EtvaVolumegroup $l EtvaVolumegroup
  1881.      * @return     void 
  1882.      * @throws     PropelException
  1883.      */
  1884.     public function addEtvaVolumegroup(EtvaVolumegroup $l)
  1885.     {
  1886.         if ($this->collEtvaVolumegroups === null{
  1887.             $this->initEtvaVolumegroups();
  1888.         }
  1889.         if (!in_array($l$this->collEtvaVolumegroupstrue)) // only add it if the **same** object is not already associated
  1890.             array_push($this->collEtvaVolumegroups$l);
  1891.             $l->setEtvaNode($this);
  1892.         }
  1893.     }
  1894.  
  1895.     /**
  1896.      * Clears out the collEtvaLogicalvolumes collection (array).
  1897.      *
  1898.      * This does not modify the database; however, it will remove any associated objects, causing
  1899.      * them to be refetched by subsequent calls to accessor method.
  1900.      *
  1901.      * @return     void 
  1902.      * @see        addEtvaLogicalvolumes()
  1903.      */
  1904.     public function clearEtvaLogicalvolumes()
  1905.     {
  1906.         $this->collEtvaLogicalvolumes = null// important to set this to NULL since that means it is uninitialized
  1907.     }
  1908.  
  1909.     /**
  1910.      * Initializes the collEtvaLogicalvolumes collection (array).
  1911.      *
  1912.      * By default this just sets the collEtvaLogicalvolumes collection to an empty array (like clearcollEtvaLogicalvolumes());
  1913.      * however, you may wish to override this method in your stub class to provide setting appropriate
  1914.      * to your application -- for example, setting the initial array to the values stored in database.
  1915.      *
  1916.      * @return     void 
  1917.      */
  1918.     public function initEtvaLogicalvolumes()
  1919.     {
  1920.         $this->collEtvaLogicalvolumes = array();
  1921.     }
  1922.  
  1923.     /**
  1924.      * Gets an array of EtvaLogicalvolume objects which contain a foreign key that references this object.
  1925.      *
  1926.      * If this collection has already been initialized with an identical Criteria, it returns the collection.
  1927.      * Otherwise if this EtvaNode has previously been saved, it will retrieve
  1928.      * related EtvaLogicalvolumes from storage. If this EtvaNode is new, it will return
  1929.      * an empty collection or the current collection, the criteria is ignored on a new object.
  1930.      *
  1931.      * @param      PropelPDO $con 
  1932.      * @param      Criteria $criteria 
  1933.      * @return     array EtvaLogicalvolume[]
  1934.      * @throws     PropelException
  1935.      */
  1936.     public function getEtvaLogicalvolumes($criteria nullPropelPDO $con null)
  1937.     {
  1938.         if ($criteria === null{
  1939.             $criteria new Criteria(EtvaNodePeer::DATABASE_NAME);
  1940.         }
  1941.         elseif ($criteria instanceof Criteria)
  1942.         {
  1943.             $criteria clone $criteria;
  1944.         }
  1945.  
  1946.         if ($this->collEtvaLogicalvolumes === null{
  1947.             if ($this->isNew()) {
  1948.                $this->collEtvaLogicalvolumes = array();
  1949.             else {
  1950.  
  1951.                 $criteria->add(EtvaLogicalvolumePeer::NODE_ID$this->id);
  1952.  
  1953.                 EtvaLogicalvolumePeer::addSelectColumns($criteria);
  1954.                 $this->collEtvaLogicalvolumes = EtvaLogicalvolumePeer::doSelect($criteria$con);
  1955.             }
  1956.         else {
  1957.             // criteria has no effect for a new object
  1958.             if (!$this->isNew()) {
  1959.                 // the following code is to determine if a new query is
  1960.                 // called for.  If the criteria is the same as the last
  1961.                 // one, just return the collection.
  1962.  
  1963.  
  1964.                 $criteria->add(EtvaLogicalvolumePeer::NODE_ID$this->id);
  1965.  
  1966.                 EtvaLogicalvolumePeer::addSelectColumns($criteria);
  1967.                 if (!isset($this->lastEtvaLogicalvolumeCriteria|| !$this->lastEtvaLogicalvolumeCriteria->equals($criteria)) {
  1968.                     $this->collEtvaLogicalvolumes = EtvaLogicalvolumePeer::doSelect($criteria$con);
  1969.                 }
  1970.             }
  1971.         }
  1972.         $this->lastEtvaLogicalvolumeCriteria $criteria;
  1973.         return $this->collEtvaLogicalvolumes;
  1974.     }
  1975.  
  1976.     /**
  1977.      * Returns the number of related EtvaLogicalvolume objects.
  1978.      *
  1979.      * @param      Criteria $criteria 
  1980.      * @param      boolean $distinct 
  1981.      * @param      PropelPDO $con 
  1982.      * @return     int Count of related EtvaLogicalvolume objects.
  1983.      * @throws     PropelException
  1984.      */
  1985.     public function countEtvaLogicalvolumes(Criteria $criteria null$distinct falsePropelPDO $con null)
  1986.     {
  1987.         if ($criteria === null{
  1988.             $criteria new Criteria(EtvaNodePeer::DATABASE_NAME);
  1989.         else {
  1990.             $criteria clone $criteria;
  1991.         }
  1992.  
  1993.         if ($distinct{
  1994.             $criteria->setDistinct();
  1995.         }
  1996.  
  1997.         $count null;
  1998.  
  1999.         if ($this->collEtvaLogicalvolumes === null{
  2000.             if ($this->isNew()) {
  2001.                 $count 0;
  2002.             else {
  2003.  
  2004.                 $criteria->add(EtvaLogicalvolumePeer::NODE_ID$this->id);
  2005.  
  2006.                 $count EtvaLogicalvolumePeer::doCount($criteria$con);
  2007.             }
  2008.         else {
  2009.             // criteria has no effect for a new object
  2010.             if (!$this->isNew()) {
  2011.                 // the following code is to determine if a new query is
  2012.                 // called for.  If the criteria is the same as the last
  2013.                 // one, just return count of the collection.
  2014.  
  2015.  
  2016.                 $criteria->add(EtvaLogicalvolumePeer::NODE_ID$this->id);
  2017.  
  2018.                 if (!isset($this->lastEtvaLogicalvolumeCriteria|| !$this->lastEtvaLogicalvolumeCriteria->equals($criteria)) {
  2019.                     $count EtvaLogicalvolumePeer::doCount($criteria$con);
  2020.                 else {
  2021.                     $count count($this->collEtvaLogicalvolumes);
  2022.                 }
  2023.             else {
  2024.                 $count count($this->collEtvaLogicalvolumes);
  2025.             }
  2026.         }
  2027.         $this->lastEtvaLogicalvolumeCriteria $criteria;
  2028.         return $count;
  2029.     }
  2030.  
  2031.     /**
  2032.      * Method called to associate a EtvaLogicalvolume object to this object
  2033.      * through the EtvaLogicalvolume foreign key attribute.
  2034.      *
  2035.      * @param      EtvaLogicalvolume $l EtvaLogicalvolume
  2036.      * @return     void 
  2037.      * @throws     PropelException
  2038.      */
  2039.     public function addEtvaLogicalvolume(EtvaLogicalvolume $l)
  2040.     {
  2041.         if ($this->collEtvaLogicalvolumes === null{
  2042.             $this->initEtvaLogicalvolumes();
  2043.         }
  2044.         if (!in_array($l$this->collEtvaLogicalvolumestrue)) // only add it if the **same** object is not already associated
  2045.             array_push($this->collEtvaLogicalvolumes$l);
  2046.             $l->setEtvaNode($this);
  2047.         }
  2048.     }
  2049.  
  2050.  
  2051.     /**
  2052.      * If this collection has already been initialized with
  2053.      * an identical criteria, it returns the collection.
  2054.      * Otherwise if this EtvaNode is new, it will return
  2055.      * an empty collection; or if this EtvaNode has previously
  2056.      * been saved, it will retrieve related EtvaLogicalvolumes from storage.
  2057.      *
  2058.      * This method is protected by default in order to keep the public
  2059.      * api reasonable.  You can provide public methods for those you
  2060.      * actually need in EtvaNode.
  2061.      */
  2062.     public function getEtvaLogicalvolumesJoinEtvaVolumegroup($criteria null$con null$join_behavior Criteria::LEFT_JOIN)
  2063.     {
  2064.         if ($criteria === null{
  2065.             $criteria new Criteria(EtvaNodePeer::DATABASE_NAME);
  2066.         }
  2067.         elseif ($criteria instanceof Criteria)
  2068.         {
  2069.             $criteria clone $criteria;
  2070.         }
  2071.  
  2072.         if ($this->collEtvaLogicalvolumes === null{
  2073.             if ($this->isNew()) {
  2074.                 $this->collEtvaLogicalvolumes = array();
  2075.             else {
  2076.  
  2077.                 $criteria->add(EtvaLogicalvolumePeer::NODE_ID$this->id);
  2078.  
  2079.                 $this->collEtvaLogicalvolumes = EtvaLogicalvolumePeer::doSelectJoinEtvaVolumegroup($criteria$con$join_behavior);
  2080.             }
  2081.         else {
  2082.             // the following code is to determine if a new query is
  2083.             // called for.  If the criteria is the same as the last
  2084.             // one, just return the collection.
  2085.  
  2086.             $criteria->add(EtvaLogicalvolumePeer::NODE_ID$this->id);
  2087.  
  2088.             if (!isset($this->lastEtvaLogicalvolumeCriteria|| !$this->lastEtvaLogicalvolumeCriteria->equals($criteria)) {
  2089.                 $this->collEtvaLogicalvolumes = EtvaLogicalvolumePeer::doSelectJoinEtvaVolumegroup($criteria$con$join_behavior);
  2090.             }
  2091.         }
  2092.         $this->lastEtvaLogicalvolumeCriteria $criteria;
  2093.  
  2094.         return $this->collEtvaLogicalvolumes;
  2095.     }
  2096.  
  2097.     /**
  2098.      * Resets all collections of referencing foreign keys.
  2099.      *
  2100.      * This method is a user-space workaround for PHP's inability to garbage collect objects
  2101.      * with circular references.  This is currently necessary when using Propel in certain
  2102.      * daemon or large-volumne/high-memory operations.
  2103.      *
  2104.      * @param      boolean $deep Whether to also clear the references on all associated objects.
  2105.      */
  2106.     public function clearAllReferences($deep false)
  2107.     {
  2108.         if ($deep{
  2109.             if ($this->collEtvaServers{
  2110.                 foreach ((array) $this->collEtvaServers as $o{
  2111.                     $o->clearAllReferences($deep);
  2112.                 }
  2113.             }
  2114.             if ($this->collEtvaPhysicalvolumes{
  2115.                 foreach ((array) $this->collEtvaPhysicalvolumes as $o{
  2116.                     $o->clearAllReferences($deep);
  2117.                 }
  2118.             }
  2119.             if ($this->collEtvaVolumegroups{
  2120.                 foreach ((array) $this->collEtvaVolumegroups as $o{
  2121.                     $o->clearAllReferences($deep);
  2122.                 }
  2123.             }
  2124.             if ($this->collEtvaLogicalvolumes{
  2125.                 foreach ((array) $this->collEtvaLogicalvolumes as $o{
  2126.                     $o->clearAllReferences($deep);
  2127.                 }
  2128.             }
  2129.         // if ($deep)
  2130.  
  2131.         $this->collEtvaServers = null;
  2132.         $this->collEtvaPhysicalvolumes = null;
  2133.         $this->collEtvaVolumegroups = null;
  2134.         $this->collEtvaLogicalvolumes = null;
  2135.     }
  2136.  
  2137.  
  2138.   public function __call($method$arguments)
  2139.   {
  2140.     if (!$callable sfMixer::getCallable('BaseEtvaNode:'.$method))
  2141.     {
  2142.       throw new sfException(sprintf('Call to undefined method BaseEtvaNode::%s'$method));
  2143.     }
  2144.  
  2145.     array_unshift($arguments$this);
  2146.  
  2147.     return call_user_func_array($callable$arguments);
  2148.   }
  2149.  
  2150.  
  2151. // BaseEtvaNode

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