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

Source for file BaseEtvaServer.php

Documentation is available at BaseEtvaServer.php

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

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