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

Source for file BaseEtvaServerPeer.php

Documentation is available at BaseEtvaServerPeer.php

  1. <?php
  2.  
  3. /**
  4.  * Base static class for performing query and update operations on 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 BaseEtvaServerPeer {
  15.  
  16.     /** the default database name for this class */
  17.     const DATABASE_NAME 'propel';
  18.  
  19.     /** the table name for this class */
  20.     const TABLE_NAME 'server';
  21.  
  22.     /** A class that can be returned by this peer. */
  23.     const CLASS_DEFAULT 'lib.model.EtvaServer';
  24.  
  25.     /** The total number of columns. */
  26.     const NUM_COLUMNS 18;
  27.  
  28.     /** The number of lazy-loaded columns. */
  29.     const NUM_LAZY_LOAD_COLUMNS 0;
  30.  
  31.     /** the column name for the ID field */
  32.     const ID 'server.ID';
  33.  
  34.     /** the column name for the LOGICALVOLUME_ID field */
  35.     const LOGICALVOLUME_ID 'server.LOGICALVOLUME_ID';
  36.  
  37.     /** the column name for the NODE_ID field */
  38.     const NODE_ID 'server.NODE_ID';
  39.  
  40.     /** the column name for the NAME field */
  41.     const NAME 'server.NAME';
  42.  
  43.     /** the column name for the DESCRIPTION field */
  44.     const DESCRIPTION 'server.DESCRIPTION';
  45.  
  46.     /** the column name for the IP field */
  47.     const IP 'server.IP';
  48.  
  49.     /** the column name for the VNC_PORT field */
  50.     const VNC_PORT 'server.VNC_PORT';
  51.  
  52.     /** the column name for the UID field */
  53.     const UID 'server.UID';
  54.  
  55.     /** the column name for the MEM field */
  56.     const MEM 'server.MEM';
  57.  
  58.     /** the column name for the VCPU field */
  59.     const VCPU 'server.VCPU';
  60.  
  61.     /** the column name for the CPUSET field */
  62.     const CPUSET 'server.CPUSET';
  63.  
  64.     /** the column name for the LOCATION field */
  65.     const LOCATION 'server.LOCATION';
  66.  
  67.     /** the column name for the NETWORK_CARDS field */
  68.     const NETWORK_CARDS 'server.NETWORK_CARDS';
  69.  
  70.     /** the column name for the STATE field */
  71.     const STATE 'server.STATE';
  72.  
  73.     /** the column name for the MAC_ADDRESSES field */
  74.     const MAC_ADDRESSES 'server.MAC_ADDRESSES';
  75.  
  76.     /** the column name for the SF_GUARD_GROUP_ID field */
  77.     const SF_GUARD_GROUP_ID 'server.SF_GUARD_GROUP_ID';
  78.  
  79.     /** the column name for the CREATED_AT field */
  80.     const CREATED_AT 'server.CREATED_AT';
  81.  
  82.     /** the column name for the UPDATED_AT field */
  83.     const UPDATED_AT 'server.UPDATED_AT';
  84.  
  85.     /**
  86.      * An identiy map to hold any loaded instances of EtvaServer objects.
  87.      * This must be public so that other peer classes can access this when hydrating from JOIN
  88.      * queries.
  89.      * @var        array EtvaServer[]
  90.      */
  91.     public static $instances array();
  92.  
  93.     /**
  94.      * The MapBuilder instance for this peer.
  95.      * @var        MapBuilder 
  96.      */
  97.     private static $mapBuilder null;
  98.  
  99.     /**
  100.      * holds an array of fieldnames
  101.      *
  102.      * first dimension keys are the type constants
  103.      * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
  104.      */
  105.     private static $fieldNames array (
  106.         BasePeer::TYPE_PHPNAME => array ('Id''LogicalvolumeId''NodeId''Name''Description''Ip''VncPort''Uid''Mem''Vcpu''Cpuset''Location''NetworkCards''State''MacAddresses''SfGuardGroupId''CreatedAt''UpdatedAt'),
  107.         BasePeer::TYPE_STUDLYPHPNAME => array ('id''logicalvolumeId''nodeId''name''description''ip''vncPort''uid''mem''vcpu''cpuset''location''networkCards''state''macAddresses''sfGuardGroupId''createdAt''updatedAt'),
  108.         BasePeer::TYPE_COLNAME => array (self::IDself::LOGICALVOLUME_IDself::NODE_IDself::NAMEself::DESCRIPTIONself::IPself::VNC_PORTself::UIDself::MEMself::VCPUself::CPUSETself::LOCATIONself::NETWORK_CARDSself::STATEself::MAC_ADDRESSESself::SF_GUARD_GROUP_IDself::CREATED_ATself::UPDATED_AT),
  109.         BasePeer::TYPE_FIELDNAME => array ('id''logicalvolume_id''node_id''name''description''ip''vnc_port''uid''mem''vcpu''cpuset''location''network_cards''state''mac_addresses''sf_guard_group_id''created_at''updated_at'),
  110.         BasePeer::TYPE_NUM => array (01234567891011121314151617)
  111.     );
  112.  
  113.     /**
  114.      * holds an array of keys for quick access to the fieldnames array
  115.      *
  116.      * first dimension keys are the type constants
  117.      * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
  118.      */
  119.     private static $fieldKeys array (
  120.         BasePeer::TYPE_PHPNAME => array ('Id' => 0'LogicalvolumeId' => 1'NodeId' => 2'Name' => 3'Description' => 4'Ip' => 5'VncPort' => 6'Uid' => 7'Mem' => 8'Vcpu' => 9'Cpuset' => 10'Location' => 11'NetworkCards' => 12'State' => 13'MacAddresses' => 14'SfGuardGroupId' => 15'CreatedAt' => 16'UpdatedAt' => 17),
  121.         BasePeer::TYPE_STUDLYPHPNAME => array ('id' => 0'logicalvolumeId' => 1'nodeId' => 2'name' => 3'description' => 4'ip' => 5'vncPort' => 6'uid' => 7'mem' => 8'vcpu' => 9'cpuset' => 10'location' => 11'networkCards' => 12'state' => 13'macAddresses' => 14'sfGuardGroupId' => 15'createdAt' => 16'updatedAt' => 17),
  122.         BasePeer::TYPE_COLNAME => array (self::ID => 0self::LOGICALVOLUME_ID => 1self::NODE_ID => 2self::NAME => 3self::DESCRIPTION => 4self::IP => 5self::VNC_PORT => 6self::UID => 7self::MEM => 8self::VCPU => 9self::CPUSET => 10self::LOCATION => 11self::NETWORK_CARDS => 12self::STATE => 13self::MAC_ADDRESSES => 14self::SF_GUARD_GROUP_ID => 15self::CREATED_AT => 16self::UPDATED_AT => 17),
  123.         BasePeer::TYPE_FIELDNAME => array ('id' => 0'logicalvolume_id' => 1'node_id' => 2'name' => 3'description' => 4'ip' => 5'vnc_port' => 6'uid' => 7'mem' => 8'vcpu' => 9'cpuset' => 10'location' => 11'network_cards' => 12'state' => 13'mac_addresses' => 14'sf_guard_group_id' => 15'created_at' => 16'updated_at' => 17),
  124.         BasePeer::TYPE_NUM => array (01234567891011121314151617)
  125.     );
  126.  
  127.     /**
  128.      * Get a (singleton) instance of the MapBuilder for this peer class.
  129.      * @return     MapBuilder The map builder for this peer
  130.      */
  131.     public static function getMapBuilder()
  132.     {
  133.         if (self::$mapBuilder === null{
  134.             self::$mapBuilder new EtvaServerMapBuilder();
  135.         }
  136.         return self::$mapBuilder;
  137.     }
  138.     /**
  139.      * Translates a fieldname to another type
  140.      *
  141.      * @param      string $name field name
  142.      * @param      string $fromType One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
  143.      *                          BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
  144.      * @param      string $toType   One of the class type constants
  145.      * @return     string translated name of the field.
  146.      * @throws     PropelException - if the specified name could not be found in the fieldname mappings.
  147.      */
  148.     static public function translateFieldName($name$fromType$toType)
  149.     {
  150.         $toNames self::getFieldNames($toType);
  151.         $key = isset(self::$fieldKeys[$fromType][$name]self::$fieldKeys[$fromType][$namenull;
  152.         if ($key === null{
  153.             throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: print_r(self::$fieldKeys[$fromType]true));
  154.         }
  155.         return $toNames[$key];
  156.     }
  157.  
  158.     /**
  159.      * Returns an array of field names.
  160.      *
  161.      * @param      string $type The type of fieldnames to return:
  162.      *                       One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
  163.      *                       BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
  164.      * @return     array A list of field names
  165.      */
  166.  
  167.     static public function getFieldNames($type BasePeer::TYPE_PHPNAME)
  168.     {
  169.         if (!array_key_exists($typeself::$fieldNames)) {
  170.             throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. ' $type ' was given.');
  171.         }
  172.         return self::$fieldNames[$type];
  173.     }
  174.  
  175.     /**
  176.      * Convenience method which changes table.column to alias.column.
  177.      *
  178.      * Using this method you can maintain SQL abstraction while using column aliases.
  179.      * <code>
  180.      *        $c->addAlias("alias1", TablePeer::TABLE_NAME);
  181.      *        $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
  182.      * </code>
  183.      * @param      string $alias The alias for the current table.
  184.      * @param      string $column The column name for current table. (i.e. EtvaServerPeer::COLUMN_NAME).
  185.      * @return     string 
  186.      */
  187.     public static function alias($alias$column)
  188.     {
  189.         return str_replace(EtvaServerPeer::TABLE_NAME.'.'$alias.'.'$column);
  190.     }
  191.  
  192.     /**
  193.      * Add all the columns needed to create a new object.
  194.      *
  195.      * Note: any columns that were marked with lazyLoad="true" in the
  196.      * XML schema will not be added to the select list and only loaded
  197.      * on demand.
  198.      *
  199.      * @param      criteria object containing the columns to add.
  200.      * @throws     PropelException Any exceptions caught during processing will be
  201.      *          rethrown wrapped into a PropelException.
  202.      */
  203.     public static function addSelectColumns(Criteria $criteria)
  204.     {
  205.  
  206.         $criteria->addSelectColumn(EtvaServerPeer::ID);
  207.  
  208.         $criteria->addSelectColumn(EtvaServerPeer::LOGICALVOLUME_ID);
  209.  
  210.         $criteria->addSelectColumn(EtvaServerPeer::NODE_ID);
  211.  
  212.         $criteria->addSelectColumn(EtvaServerPeer::NAME);
  213.  
  214.         $criteria->addSelectColumn(EtvaServerPeer::DESCRIPTION);
  215.  
  216.         $criteria->addSelectColumn(EtvaServerPeer::IP);
  217.  
  218.         $criteria->addSelectColumn(EtvaServerPeer::VNC_PORT);
  219.  
  220.         $criteria->addSelectColumn(EtvaServerPeer::UID);
  221.  
  222.         $criteria->addSelectColumn(EtvaServerPeer::MEM);
  223.  
  224.         $criteria->addSelectColumn(EtvaServerPeer::VCPU);
  225.  
  226.         $criteria->addSelectColumn(EtvaServerPeer::CPUSET);
  227.  
  228.         $criteria->addSelectColumn(EtvaServerPeer::LOCATION);
  229.  
  230.         $criteria->addSelectColumn(EtvaServerPeer::NETWORK_CARDS);
  231.  
  232.         $criteria->addSelectColumn(EtvaServerPeer::STATE);
  233.  
  234.         $criteria->addSelectColumn(EtvaServerPeer::MAC_ADDRESSES);
  235.  
  236.         $criteria->addSelectColumn(EtvaServerPeer::SF_GUARD_GROUP_ID);
  237.  
  238.         $criteria->addSelectColumn(EtvaServerPeer::CREATED_AT);
  239.  
  240.         $criteria->addSelectColumn(EtvaServerPeer::UPDATED_AT);
  241.  
  242.     }
  243.  
  244.     /**
  245.      * Returns the number of rows matching criteria.
  246.      *
  247.      * @param      Criteria $criteria 
  248.      * @param      boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
  249.      * @param      PropelPDO $con 
  250.      * @return     int Number of matching rows.
  251.      */
  252.     public static function doCount(Criteria $criteria$distinct falsePropelPDO $con null)
  253.     {
  254.         // we may modify criteria, so copy it first
  255.         $criteria clone $criteria;
  256.  
  257.         // We need to set the primary table name, since in the case that there are no WHERE columns
  258.         // it will be impossible for the BasePeer::createSelectSql() method to determine which
  259.         // tables go into the FROM clause.
  260.         $criteria->setPrimaryTableName(EtvaServerPeer::TABLE_NAME);
  261.  
  262.         if ($distinct && !in_array(Criteria::DISTINCT$criteria->getSelectModifiers())) {
  263.             $criteria->setDistinct();
  264.         }
  265.  
  266.         if (!$criteria->hasSelectClause()) {
  267.             EtvaServerPeer::addSelectColumns($criteria);
  268.         }
  269.  
  270.         $criteria->clearOrderByColumns()// ORDER BY won't ever affect the count
  271.         $criteria->setDbName(self::DATABASE_NAME)// Set the correct dbName
  272.  
  273.         if ($con === null{
  274.             $con Propel::getConnection(EtvaServerPeer::DATABASE_NAMEPropel::CONNECTION_READ);
  275.         }
  276.  
  277.  
  278.     foreach (sfMixer::getCallables('BaseEtvaServerPeer:doCount:doCount'as $callable)
  279.     {
  280.       call_user_func($callable'BaseEtvaServerPeer'$criteria$con);
  281.     }
  282.  
  283.  
  284.         // BasePeer returns a PDOStatement
  285.         $stmt BasePeer::doCount($criteria$con);
  286.  
  287.         if ($row $stmt->fetch(PDO::FETCH_NUM)) {
  288.             $count = (int) $row[0];
  289.         else {
  290.             $count 0// no rows returned; we infer that means 0 matches.
  291.         }
  292.         $stmt->closeCursor();
  293.         return $count;
  294.     }
  295.     /**
  296.      * Method to select one object from the DB.
  297.      *
  298.      * @param      Criteria $criteria object used to create the SELECT statement.
  299.      * @param      PropelPDO $con 
  300.      * @return     EtvaServer 
  301.      * @throws     PropelException Any exceptions caught during processing will be
  302.      *          rethrown wrapped into a PropelException.
  303.      */
  304.     public static function doSelectOne(Criteria $criteriaPropelPDO $con null)
  305.     {
  306.         $critcopy clone $criteria;
  307.         $critcopy->setLimit(1);
  308.         $objects EtvaServerPeer::doSelect($critcopy$con);
  309.         if ($objects{
  310.             return $objects[0];
  311.         }
  312.         return null;
  313.     }
  314.     /**
  315.      * Method to do selects.
  316.      *
  317.      * @param      Criteria $criteria The Criteria object used to build the SELECT statement.
  318.      * @param      PropelPDO $con 
  319.      * @return     array Array of selected Objects
  320.      * @throws     PropelException Any exceptions caught during processing will be
  321.      *          rethrown wrapped into a PropelException.
  322.      */
  323.     public static function doSelect(Criteria $criteriaPropelPDO $con null)
  324.     {
  325.         return EtvaServerPeer::populateObjects(EtvaServerPeer::doSelectStmt($criteria$con));
  326.     }
  327.     /**
  328.      * Prepares the Criteria object and uses the parent doSelect() method to execute a PDOStatement.
  329.      *
  330.      * Use this method directly if you want to work with an executed statement durirectly (for example
  331.      * to perform your own object hydration).
  332.      *
  333.      * @param      Criteria $criteria The Criteria object used to build the SELECT statement.
  334.      * @param      PropelPDO $con The connection to use
  335.      * @throws     PropelException Any exceptions caught during processing will be
  336.      *          rethrown wrapped into a PropelException.
  337.      * @return     PDOStatement The executed PDOStatement object.
  338.      * @see        BasePeer::doSelect()
  339.      */
  340.     public static function doSelectStmt(Criteria $criteriaPropelPDO $con null)
  341.     {
  342.  
  343.     foreach (sfMixer::getCallables('BaseEtvaServerPeer:doSelectStmt:doSelectStmt'as $callable)
  344.     {
  345.       call_user_func($callable'BaseEtvaServerPeer'$criteria$con);
  346.     }
  347.  
  348.  
  349.         if ($con === null{
  350.             $con Propel::getConnection(EtvaServerPeer::DATABASE_NAMEPropel::CONNECTION_READ);
  351.         }
  352.  
  353.         if (!$criteria->hasSelectClause()) {
  354.             $criteria clone $criteria;
  355.             EtvaServerPeer::addSelectColumns($criteria);
  356.         }
  357.  
  358.         // Set the correct dbName
  359.         $criteria->setDbName(self::DATABASE_NAME);
  360.  
  361.         // BasePeer returns a PDOStatement
  362.         return BasePeer::doSelect($criteria$con);
  363.     }
  364.     /**
  365.      * Adds an object to the instance pool.
  366.      *
  367.      * Propel keeps cached copies of objects in an instance pool when they are retrieved
  368.      * from the database.  In some cases -- especially when you override doSelect*()
  369.      * methods in your stub classes -- you may need to explicitly add objects
  370.      * to the cache in order to ensure that the same objects are always returned by doSelect*()
  371.      * and retrieveByPK*() calls.
  372.      *
  373.      * @param      EtvaServer $value A EtvaServer object.
  374.      * @param      string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
  375.      */
  376.     public static function addInstanceToPool(EtvaServer $obj$key null)
  377.     {
  378.         if (Propel::isInstancePoolingEnabled()) {
  379.             if ($key === null{
  380.                 $key = (string) $obj->getId();
  381.             // if key === null
  382.             self::$instances[$key$obj;
  383.         }
  384.     }
  385.  
  386.     /**
  387.      * Removes an object from the instance pool.
  388.      *
  389.      * Propel keeps cached copies of objects in an instance pool when they are retrieved
  390.      * from the database.  In some cases -- especially when you override doDelete
  391.      * methods in your stub classes -- you may need to explicitly remove objects
  392.      * from the cache in order to prevent returning objects that no longer exist.
  393.      *
  394.      * @param      mixed $value A EtvaServer object or a primary key value.
  395.      */
  396.     public static function removeInstanceFromPool($value)
  397.     {
  398.         if (Propel::isInstancePoolingEnabled(&& $value !== null{
  399.             if (is_object($value&& $value instanceof EtvaServer{
  400.                 $key = (string) $value->getId();
  401.             elseif (is_scalar($value)) {
  402.                 // assume we've been passed a primary key
  403.                 $key = (string) $value;
  404.             else {
  405.                 $e new PropelException("Invalid value passed to removeInstanceFromPool().  Expected primary key or EtvaServer object; got " (is_object($valueget_class($value' object.' var_export($value,true)));
  406.                 throw $e;
  407.             }
  408.  
  409.             unset(self::$instances[$key]);
  410.         }
  411.     // removeInstanceFromPool()
  412.  
  413.     /**
  414.      * Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
  415.      *
  416.      * For tables with a single-column primary key, that simple pkey value will be returned.  For tables with
  417.      * a multi-column primary key, a serialize()d version of the primary key will be returned.
  418.      *
  419.      * @param      string $key The key (@see getPrimaryKeyHash()) for this instance.
  420.      * @return     EtvaServer Found object or NULL if 1) no instance exists for specified key or 2) instance pooling has been disabled.
  421.      * @see        getPrimaryKeyHash()
  422.      */
  423.     public static function getInstanceFromPool($key)
  424.     {
  425.         if (Propel::isInstancePoolingEnabled()) {
  426.             if (isset(self::$instances[$key])) {
  427.                 return self::$instances[$key];
  428.             }
  429.         }
  430.         return null// just to be explicit
  431.     }
  432.     
  433.     /**
  434.      * Clear the instance pool.
  435.      *
  436.      * @return     void 
  437.      */
  438.     public static function clearInstancePool()
  439.     {
  440.         self::$instances array();
  441.     }
  442.     
  443.     /**
  444.      * Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
  445.      *
  446.      * For tables with a single-column primary key, that simple pkey value will be returned.  For tables with
  447.      * a multi-column primary key, a serialize()d version of the primary key will be returned.
  448.      *
  449.      * @param      array $row PropelPDO resultset row.
  450.      * @param      int $startcol The 0-based offset for reading from the resultset row.
  451.      * @return     string A string version of PK or NULL if the components of primary key in result array are all null.
  452.      */
  453.     public static function getPrimaryKeyHashFromRow($row$startcol 0)
  454.     {
  455.         // If the PK cannot be derived from the row, return NULL.
  456.         if ($row[$startcol 0=== null{
  457.             return null;
  458.         }
  459.         return (string) $row[$startcol 0];
  460.     }
  461.  
  462.     /**
  463.      * The returned array will contain objects of the default type or
  464.      * objects that inherit from the default.
  465.      *
  466.      * @throws     PropelException Any exceptions caught during processing will be
  467.      *          rethrown wrapped into a PropelException.
  468.      */
  469.     public static function populateObjects(PDOStatement $stmt)
  470.     {
  471.         $results array();
  472.     
  473.         // set the class once to avoid overhead in the loop
  474.         $cls EtvaServerPeer::getOMClass();
  475.         $cls substr('.'.$clsstrrpos('.'.$cls'.'1);
  476.         // populate the object(s)
  477.         while ($row $stmt->fetch(PDO::FETCH_NUM)) {
  478.             $key EtvaServerPeer::getPrimaryKeyHashFromRow($row0);
  479.             if (null !== ($obj EtvaServerPeer::getInstanceFromPool($key))) {
  480.                 // We no longer rehydrate the object, since this can cause data loss.
  481.                 // See http://propel.phpdb.org/trac/ticket/509
  482.                 // $obj->hydrate($row, 0, true); // rehydrate
  483.                 $results[$obj;
  484.             else {
  485.         
  486.                 $obj new $cls();
  487.                 $obj->hydrate($row);
  488.                 $results[$obj;
  489.                 EtvaServerPeer::addInstanceToPool($obj$key);
  490.             // if key exists
  491.         }
  492.         $stmt->closeCursor();
  493.         return $results;
  494.     }
  495.  
  496.     /**
  497.      * Returns the number of rows matching criteria, joining the related EtvaLogicalvolume table
  498.      *
  499.      * @param      Criteria $c 
  500.      * @param      boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
  501.      * @param      PropelPDO $con 
  502.      * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
  503.      * @return     int Number of matching rows.
  504.      */
  505.     public static function doCountJoinEtvaLogicalvolume(Criteria $criteria$distinct falsePropelPDO $con null$join_behavior Criteria::LEFT_JOIN)
  506.     {
  507.         // we're going to modify criteria, so copy it first
  508.         $criteria clone $criteria;
  509.  
  510.         // We need to set the primary table name, since in the case that there are no WHERE columns
  511.         // it will be impossible for the BasePeer::createSelectSql() method to determine which
  512.         // tables go into the FROM clause.
  513.         $criteria->setPrimaryTableName(EtvaServerPeer::TABLE_NAME);
  514.  
  515.         if ($distinct && !in_array(Criteria::DISTINCT$criteria->getSelectModifiers())) {
  516.             $criteria->setDistinct();
  517.         }
  518.  
  519.         if (!$criteria->hasSelectClause()) {
  520.             EtvaServerPeer::addSelectColumns($criteria);
  521.         }
  522.  
  523.         $criteria->clearOrderByColumns()// ORDER BY won't ever affect the count
  524.  
  525.         // Set the correct dbName
  526.         $criteria->setDbName(self::DATABASE_NAME);
  527.  
  528.         if ($con === null{
  529.             $con Propel::getConnection(EtvaServerPeer::DATABASE_NAMEPropel::CONNECTION_READ);
  530.         }
  531.  
  532.         $criteria->addJoin(array(EtvaServerPeer::LOGICALVOLUME_ID,)array(EtvaLogicalvolumePeer::ID,)$join_behavior);
  533.  
  534.  
  535.     foreach (sfMixer::getCallables('BaseEtvaServerPeer:doCount:doCount'as $callable)
  536.     {
  537.       call_user_func($callable'BaseEtvaServerPeer'$criteria$con);
  538.     }
  539.  
  540.  
  541.         $stmt BasePeer::doCount($criteria$con);
  542.  
  543.         if ($row $stmt->fetch(PDO::FETCH_NUM)) {
  544.             $count = (int) $row[0];
  545.         else {
  546.             $count 0// no rows returned; we infer that means 0 matches.
  547.         }
  548.         $stmt->closeCursor();
  549.         return $count;
  550.     }
  551.  
  552.  
  553.     /**
  554.      * Returns the number of rows matching criteria, joining the related EtvaNode table
  555.      *
  556.      * @param      Criteria $c 
  557.      * @param      boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
  558.      * @param      PropelPDO $con 
  559.      * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
  560.      * @return     int Number of matching rows.
  561.      */
  562.     public static function doCountJoinEtvaNode(Criteria $criteria$distinct falsePropelPDO $con null$join_behavior Criteria::LEFT_JOIN)
  563.     {
  564.         // we're going to modify criteria, so copy it first
  565.         $criteria clone $criteria;
  566.  
  567.         // We need to set the primary table name, since in the case that there are no WHERE columns
  568.         // it will be impossible for the BasePeer::createSelectSql() method to determine which
  569.         // tables go into the FROM clause.
  570.         $criteria->setPrimaryTableName(EtvaServerPeer::TABLE_NAME);
  571.  
  572.         if ($distinct && !in_array(Criteria::DISTINCT$criteria->getSelectModifiers())) {
  573.             $criteria->setDistinct();
  574.         }
  575.  
  576.         if (!$criteria->hasSelectClause()) {
  577.             EtvaServerPeer::addSelectColumns($criteria);
  578.         }
  579.  
  580.         $criteria->clearOrderByColumns()// ORDER BY won't ever affect the count
  581.  
  582.         // Set the correct dbName
  583.         $criteria->setDbName(self::DATABASE_NAME);
  584.  
  585.         if ($con === null{
  586.             $con Propel::getConnection(EtvaServerPeer::DATABASE_NAMEPropel::CONNECTION_READ);
  587.         }
  588.  
  589.         $criteria->addJoin(array(EtvaServerPeer::NODE_ID,)array(EtvaNodePeer::ID,)$join_behavior);
  590.  
  591.  
  592.     foreach (sfMixer::getCallables('BaseEtvaServerPeer:doCount:doCount'as $callable)
  593.     {
  594.       call_user_func($callable'BaseEtvaServerPeer'$criteria$con);
  595.     }
  596.  
  597.  
  598.         $stmt BasePeer::doCount($criteria$con);
  599.  
  600.         if ($row $stmt->fetch(PDO::FETCH_NUM)) {
  601.             $count = (int) $row[0];
  602.         else {
  603.             $count 0// no rows returned; we infer that means 0 matches.
  604.         }
  605.         $stmt->closeCursor();
  606.         return $count;
  607.     }
  608.  
  609.  
  610.     /**
  611.      * Returns the number of rows matching criteria, joining the related sfGuardGroup table
  612.      *
  613.      * @param      Criteria $c 
  614.      * @param      boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
  615.      * @param      PropelPDO $con 
  616.      * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
  617.      * @return     int Number of matching rows.
  618.      */
  619.     public static function doCountJoinsfGuardGroup(Criteria $criteria$distinct falsePropelPDO $con null$join_behavior Criteria::LEFT_JOIN)
  620.     {
  621.         // we're going to modify criteria, so copy it first
  622.         $criteria clone $criteria;
  623.  
  624.         // We need to set the primary table name, since in the case that there are no WHERE columns
  625.         // it will be impossible for the BasePeer::createSelectSql() method to determine which
  626.         // tables go into the FROM clause.
  627.         $criteria->setPrimaryTableName(EtvaServerPeer::TABLE_NAME);
  628.  
  629.         if ($distinct && !in_array(Criteria::DISTINCT$criteria->getSelectModifiers())) {
  630.             $criteria->setDistinct();
  631.         }
  632.  
  633.         if (!$criteria->hasSelectClause()) {
  634.             EtvaServerPeer::addSelectColumns($criteria);
  635.         }
  636.  
  637.         $criteria->clearOrderByColumns()// ORDER BY won't ever affect the count
  638.  
  639.         // Set the correct dbName
  640.         $criteria->setDbName(self::DATABASE_NAME);
  641.  
  642.         if ($con === null{
  643.             $con Propel::getConnection(EtvaServerPeer::DATABASE_NAMEPropel::CONNECTION_READ);
  644.         }
  645.  
  646.         $criteria->addJoin(array(EtvaServerPeer::SF_GUARD_GROUP_ID,)array(sfGuardGroupPeer::ID,)$join_behavior);
  647.  
  648.  
  649.     foreach (sfMixer::getCallables('BaseEtvaServerPeer:doCount:doCount'as $callable)
  650.     {
  651.       call_user_func($callable'BaseEtvaServerPeer'$criteria$con);
  652.     }
  653.  
  654.  
  655.         $stmt BasePeer::doCount($criteria$con);
  656.  
  657.         if ($row $stmt->fetch(PDO::FETCH_NUM)) {
  658.             $count = (int) $row[0];
  659.         else {
  660.             $count 0// no rows returned; we infer that means 0 matches.
  661.         }
  662.         $stmt->closeCursor();
  663.         return $count;
  664.     }
  665.  
  666.  
  667.     /**
  668.      * Selects a collection of EtvaServer objects pre-filled with their EtvaLogicalvolume objects.
  669.      * @param      Criteria  $c 
  670.      * @param      PropelPDO $con 
  671.      * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
  672.      * @return     array Array of EtvaServer objects.
  673.      * @throws     PropelException Any exceptions caught during processing will be
  674.      *          rethrown wrapped into a PropelException.
  675.      */
  676.     public static function doSelectJoinEtvaLogicalvolume(Criteria $c$con null$join_behavior Criteria::LEFT_JOIN)
  677.     {
  678.  
  679.     foreach (sfMixer::getCallables('BaseEtvaServerPeer:doSelectJoin:doSelectJoin'as $callable)
  680.     {
  681.       call_user_func($callable'BaseEtvaServerPeer'$c$con);
  682.     }
  683.  
  684.  
  685.         $c clone $c;
  686.  
  687.         // Set the correct dbName if it has not been overridden
  688.         if ($c->getDbName(== Propel::getDefaultDB()) {
  689.             $c->setDbName(self::DATABASE_NAME);
  690.         }
  691.  
  692.         EtvaServerPeer::addSelectColumns($c);
  693.         $startcol (EtvaServerPeer::NUM_COLUMNS EtvaServerPeer::NUM_LAZY_LOAD_COLUMNS);
  694.         EtvaLogicalvolumePeer::addSelectColumns($c);
  695.  
  696.         $c->addJoin(array(EtvaServerPeer::LOGICALVOLUME_ID,)array(EtvaLogicalvolumePeer::ID,)$join_behavior);
  697.         $stmt BasePeer::doSelect($c$con);
  698.         $results array();
  699.  
  700.         while ($row $stmt->fetch(PDO::FETCH_NUM)) {
  701.             $key1 EtvaServerPeer::getPrimaryKeyHashFromRow($row0);
  702.             if (null !== ($obj1 EtvaServerPeer::getInstanceFromPool($key1))) {
  703.                 // We no longer rehydrate the object, since this can cause data loss.
  704.                 // See http://propel.phpdb.org/trac/ticket/509
  705.                 // $obj1->hydrate($row, 0, true); // rehydrate
  706.             else {
  707.  
  708.                 $omClass EtvaServerPeer::getOMClass();
  709.  
  710.                 $cls substr('.'.$omClassstrrpos('.'.$omClass'.'1);
  711.                 $obj1 new $cls();
  712.                 $obj1->hydrate($row);
  713.                 EtvaServerPeer::addInstanceToPool($obj1$key1);
  714.             // if $obj1 already loaded
  715.  
  716.             $key2 EtvaLogicalvolumePeer::getPrimaryKeyHashFromRow($row$startcol);
  717.             if ($key2 !== null{
  718.                 $obj2 EtvaLogicalvolumePeer::getInstanceFromPool($key2);
  719.                 if (!$obj2{
  720.  
  721.                     $omClass EtvaLogicalvolumePeer::getOMClass();
  722.  
  723.                     $cls substr('.'.$omClassstrrpos('.'.$omClass'.'1);
  724.                     $obj2 new $cls();
  725.                     $obj2->hydrate($row$startcol);
  726.                     EtvaLogicalvolumePeer::addInstanceToPool($obj2$key2);
  727.                 // if obj2 already loaded
  728.  
  729.                 // Add the $obj1 (EtvaServer) to $obj2 (EtvaLogicalvolume)
  730.                 $obj2->addEtvaServer($obj1);
  731.  
  732.             // if joined row was not null
  733.  
  734.             $results[$obj1;
  735.         }
  736.         $stmt->closeCursor();
  737.         return $results;
  738.     }
  739.  
  740.  
  741.     /**
  742.      * Selects a collection of EtvaServer objects pre-filled with their EtvaNode objects.
  743.      * @param      Criteria  $c 
  744.      * @param      PropelPDO $con 
  745.      * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
  746.      * @return     array Array of EtvaServer objects.
  747.      * @throws     PropelException Any exceptions caught during processing will be
  748.      *          rethrown wrapped into a PropelException.
  749.      */
  750.     public static function doSelectJoinEtvaNode(Criteria $c$con null$join_behavior Criteria::LEFT_JOIN)
  751.     {
  752.         $c clone $c;
  753.  
  754.         // Set the correct dbName if it has not been overridden
  755.         if ($c->getDbName(== Propel::getDefaultDB()) {
  756.             $c->setDbName(self::DATABASE_NAME);
  757.         }
  758.  
  759.         EtvaServerPeer::addSelectColumns($c);
  760.         $startcol (EtvaServerPeer::NUM_COLUMNS EtvaServerPeer::NUM_LAZY_LOAD_COLUMNS);
  761.         EtvaNodePeer::addSelectColumns($c);
  762.  
  763.         $c->addJoin(array(EtvaServerPeer::NODE_ID,)array(EtvaNodePeer::ID,)$join_behavior);
  764.         $stmt BasePeer::doSelect($c$con);
  765.         $results array();
  766.  
  767.         while ($row $stmt->fetch(PDO::FETCH_NUM)) {
  768.             $key1 EtvaServerPeer::getPrimaryKeyHashFromRow($row0);
  769.             if (null !== ($obj1 EtvaServerPeer::getInstanceFromPool($key1))) {
  770.                 // We no longer rehydrate the object, since this can cause data loss.
  771.                 // See http://propel.phpdb.org/trac/ticket/509
  772.                 // $obj1->hydrate($row, 0, true); // rehydrate
  773.             else {
  774.  
  775.                 $omClass EtvaServerPeer::getOMClass();
  776.  
  777.                 $cls substr('.'.$omClassstrrpos('.'.$omClass'.'1);
  778.                 $obj1 new $cls();
  779.                 $obj1->hydrate($row);
  780.                 EtvaServerPeer::addInstanceToPool($obj1$key1);
  781.             // if $obj1 already loaded
  782.  
  783.             $key2 EtvaNodePeer::getPrimaryKeyHashFromRow($row$startcol);
  784.             if ($key2 !== null{
  785.                 $obj2 EtvaNodePeer::getInstanceFromPool($key2);
  786.                 if (!$obj2{
  787.  
  788.                     $omClass EtvaNodePeer::getOMClass();
  789.  
  790.                     $cls substr('.'.$omClassstrrpos('.'.$omClass'.'1);
  791.                     $obj2 new $cls();
  792.                     $obj2->hydrate($row$startcol);
  793.                     EtvaNodePeer::addInstanceToPool($obj2$key2);
  794.                 // if obj2 already loaded
  795.  
  796.                 // Add the $obj1 (EtvaServer) to $obj2 (EtvaNode)
  797.                 $obj2->addEtvaServer($obj1);
  798.  
  799.             // if joined row was not null
  800.  
  801.             $results[$obj1;
  802.         }
  803.         $stmt->closeCursor();
  804.         return $results;
  805.     }
  806.  
  807.  
  808.     /**
  809.      * Selects a collection of EtvaServer objects pre-filled with their sfGuardGroup objects.
  810.      * @param      Criteria  $c 
  811.      * @param      PropelPDO $con 
  812.      * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
  813.      * @return     array Array of EtvaServer objects.
  814.      * @throws     PropelException Any exceptions caught during processing will be
  815.      *          rethrown wrapped into a PropelException.
  816.      */
  817.     public static function doSelectJoinsfGuardGroup(Criteria $c$con null$join_behavior Criteria::LEFT_JOIN)
  818.     {
  819.         $c clone $c;
  820.  
  821.         // Set the correct dbName if it has not been overridden
  822.         if ($c->getDbName(== Propel::getDefaultDB()) {
  823.             $c->setDbName(self::DATABASE_NAME);
  824.         }
  825.  
  826.         EtvaServerPeer::addSelectColumns($c);
  827.         $startcol (EtvaServerPeer::NUM_COLUMNS EtvaServerPeer::NUM_LAZY_LOAD_COLUMNS);
  828.         sfGuardGroupPeer::addSelectColumns($c);
  829.  
  830.         $c->addJoin(array(EtvaServerPeer::SF_GUARD_GROUP_ID,)array(sfGuardGroupPeer::ID,)$join_behavior);
  831.         $stmt BasePeer::doSelect($c$con);
  832.         $results array();
  833.  
  834.         while ($row $stmt->fetch(PDO::FETCH_NUM)) {
  835.             $key1 EtvaServerPeer::getPrimaryKeyHashFromRow($row0);
  836.             if (null !== ($obj1 EtvaServerPeer::getInstanceFromPool($key1))) {
  837.                 // We no longer rehydrate the object, since this can cause data loss.
  838.                 // See http://propel.phpdb.org/trac/ticket/509
  839.                 // $obj1->hydrate($row, 0, true); // rehydrate
  840.             else {
  841.  
  842.                 $omClass EtvaServerPeer::getOMClass();
  843.  
  844.                 $cls substr('.'.$omClassstrrpos('.'.$omClass'.'1);
  845.                 $obj1 new $cls();
  846.                 $obj1->hydrate($row);
  847.                 EtvaServerPeer::addInstanceToPool($obj1$key1);
  848.             // if $obj1 already loaded
  849.  
  850.             $key2 sfGuardGroupPeer::getPrimaryKeyHashFromRow($row$startcol);
  851.             if ($key2 !== null{
  852.                 $obj2 sfGuardGroupPeer::getInstanceFromPool($key2);
  853.                 if (!$obj2{
  854.  
  855.                     $omClass sfGuardGroupPeer::getOMClass();
  856.  
  857.                     $cls substr('.'.$omClassstrrpos('.'.$omClass'.'1);
  858.                     $obj2 new $cls();
  859.                     $obj2->hydrate($row$startcol);
  860.                     sfGuardGroupPeer::addInstanceToPool($obj2$key2);
  861.                 // if obj2 already loaded
  862.  
  863.                 // Add the $obj1 (EtvaServer) to $obj2 (sfGuardGroup)
  864.                 $obj2->addEtvaServer($obj1);
  865.  
  866.             // if joined row was not null
  867.  
  868.             $results[$obj1;
  869.         }
  870.         $stmt->closeCursor();
  871.         return $results;
  872.     }
  873.  
  874.  
  875.     /**
  876.      * Returns the number of rows matching criteria, joining all related tables
  877.      *
  878.      * @param      Criteria $c 
  879.      * @param      boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
  880.      * @param      PropelPDO $con 
  881.      * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
  882.      * @return     int Number of matching rows.
  883.      */
  884.     public static function doCountJoinAll(Criteria $criteria$distinct falsePropelPDO $con null$join_behavior Criteria::LEFT_JOIN)
  885.     {
  886.         // we're going to modify criteria, so copy it first
  887.         $criteria clone $criteria;
  888.  
  889.         // We need to set the primary table name, since in the case that there are no WHERE columns
  890.         // it will be impossible for the BasePeer::createSelectSql() method to determine which
  891.         // tables go into the FROM clause.
  892.         $criteria->setPrimaryTableName(EtvaServerPeer::TABLE_NAME);
  893.  
  894.         if ($distinct && !in_array(Criteria::DISTINCT$criteria->getSelectModifiers())) {
  895.             $criteria->setDistinct();
  896.         }
  897.  
  898.         if (!$criteria->hasSelectClause()) {
  899.             EtvaServerPeer::addSelectColumns($criteria);
  900.         }
  901.  
  902.         $criteria->clearOrderByColumns()// ORDER BY won't ever affect the count
  903.  
  904.         // Set the correct dbName
  905.         $criteria->setDbName(self::DATABASE_NAME);
  906.  
  907.         if ($con === null{
  908.             $con Propel::getConnection(EtvaServerPeer::DATABASE_NAMEPropel::CONNECTION_READ);
  909.         }
  910.  
  911.         $criteria->addJoin(array(EtvaServerPeer::LOGICALVOLUME_ID,)array(EtvaLogicalvolumePeer::ID,)$join_behavior);
  912.         $criteria->addJoin(array(EtvaServerPeer::NODE_ID,)array(EtvaNodePeer::ID,)$join_behavior);
  913.         $criteria->addJoin(array(EtvaServerPeer::SF_GUARD_GROUP_ID,)array(sfGuardGroupPeer::ID,)$join_behavior);
  914.  
  915.     foreach (sfMixer::getCallables('BaseEtvaServerPeer:doCount:doCount'as $callable)
  916.     {
  917.       call_user_func($callable'BaseEtvaServerPeer'$criteria$con);
  918.     }
  919.  
  920.  
  921.         $stmt BasePeer::doCount($criteria$con);
  922.  
  923.         if ($row $stmt->fetch(PDO::FETCH_NUM)) {
  924.             $count = (int) $row[0];
  925.         else {
  926.             $count 0// no rows returned; we infer that means 0 matches.
  927.         }
  928.         $stmt->closeCursor();
  929.         return $count;
  930.     }
  931.  
  932.     /**
  933.      * Selects a collection of EtvaServer objects pre-filled with all related objects.
  934.      *
  935.      * @param      Criteria  $c 
  936.      * @param      PropelPDO $con 
  937.      * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
  938.      * @return     array Array of EtvaServer objects.
  939.      * @throws     PropelException Any exceptions caught during processing will be
  940.      *          rethrown wrapped into a PropelException.
  941.      */
  942.     public static function doSelectJoinAll(Criteria $c$con null$join_behavior Criteria::LEFT_JOIN)
  943.     {
  944.  
  945.     foreach (sfMixer::getCallables('BaseEtvaServerPeer:doSelectJoinAll:doSelectJoinAll'as $callable)
  946.     {
  947.       call_user_func($callable'BaseEtvaServerPeer'$c$con);
  948.     }
  949.  
  950.  
  951.         $c clone $c;
  952.  
  953.         // Set the correct dbName if it has not been overridden
  954.         if ($c->getDbName(== Propel::getDefaultDB()) {
  955.             $c->setDbName(self::DATABASE_NAME);
  956.         }
  957.  
  958.         EtvaServerPeer::addSelectColumns($c);
  959.         $startcol2 (EtvaServerPeer::NUM_COLUMNS EtvaServerPeer::NUM_LAZY_LOAD_COLUMNS);
  960.  
  961.         EtvaLogicalvolumePeer::addSelectColumns($c);
  962.         $startcol3 $startcol2 (EtvaLogicalvolumePeer::NUM_COLUMNS EtvaLogicalvolumePeer::NUM_LAZY_LOAD_COLUMNS);
  963.  
  964.         EtvaNodePeer::addSelectColumns($c);
  965.         $startcol4 $startcol3 (EtvaNodePeer::NUM_COLUMNS EtvaNodePeer::NUM_LAZY_LOAD_COLUMNS);
  966.  
  967.         sfGuardGroupPeer::addSelectColumns($c);
  968.         $startcol5 $startcol4 (sfGuardGroupPeer::NUM_COLUMNS sfGuardGroupPeer::NUM_LAZY_LOAD_COLUMNS);
  969.  
  970.         $c->addJoin(array(EtvaServerPeer::LOGICALVOLUME_ID,)array(EtvaLogicalvolumePeer::ID,)$join_behavior);
  971.         $c->addJoin(array(EtvaServerPeer::NODE_ID,)array(EtvaNodePeer::ID,)$join_behavior);
  972.         $c->addJoin(array(EtvaServerPeer::SF_GUARD_GROUP_ID,)array(sfGuardGroupPeer::ID,)$join_behavior);
  973.         $stmt BasePeer::doSelect($c$con);
  974.         $results array();
  975.  
  976.         while ($row $stmt->fetch(PDO::FETCH_NUM)) {
  977.             $key1 EtvaServerPeer::getPrimaryKeyHashFromRow($row0);
  978.             if (null !== ($obj1 EtvaServerPeer::getInstanceFromPool($key1))) {
  979.                 // We no longer rehydrate the object, since this can cause data loss.
  980.                 // See http://propel.phpdb.org/trac/ticket/509
  981.                 // $obj1->hydrate($row, 0, true); // rehydrate
  982.             else {
  983.                 $omClass EtvaServerPeer::getOMClass();
  984.  
  985.                 $cls substr('.'.$omClassstrrpos('.'.$omClass'.'1);
  986.                 $obj1 new $cls();
  987.                 $obj1->hydrate($row);
  988.                 EtvaServerPeer::addInstanceToPool($obj1$key1);
  989.             // if obj1 already loaded
  990.  
  991.             // Add objects for joined EtvaLogicalvolume rows
  992.  
  993.             $key2 EtvaLogicalvolumePeer::getPrimaryKeyHashFromRow($row$startcol2);
  994.             if ($key2 !== null{
  995.                 $obj2 EtvaLogicalvolumePeer::getInstanceFromPool($key2);
  996.                 if (!$obj2{
  997.  
  998.                     $omClass EtvaLogicalvolumePeer::getOMClass();
  999.  
  1000.  
  1001.                     $cls substr('.'.$omClassstrrpos('.'.$omClass'.'1);
  1002.                     $obj2 new $cls();
  1003.                     $obj2->hydrate($row$startcol2);
  1004.                     EtvaLogicalvolumePeer::addInstanceToPool($obj2$key2);
  1005.                 // if obj2 loaded
  1006.  
  1007.                 // Add the $obj1 (EtvaServer) to the collection in $obj2 (EtvaLogicalvolume)
  1008.                 $obj2->addEtvaServer($obj1);
  1009.             // if joined row not null
  1010.  
  1011.             // Add objects for joined EtvaNode rows
  1012.  
  1013.             $key3 EtvaNodePeer::getPrimaryKeyHashFromRow($row$startcol3);
  1014.             if ($key3 !== null{
  1015.                 $obj3 EtvaNodePeer::getInstanceFromPool($key3);
  1016.                 if (!$obj3{
  1017.  
  1018.                     $omClass EtvaNodePeer::getOMClass();
  1019.  
  1020.  
  1021.                     $cls substr('.'.$omClassstrrpos('.'.$omClass'.'1);
  1022.                     $obj3 new $cls();
  1023.                     $obj3->hydrate($row$startcol3);
  1024.                     EtvaNodePeer::addInstanceToPool($obj3$key3);
  1025.                 // if obj3 loaded
  1026.  
  1027.                 // Add the $obj1 (EtvaServer) to the collection in $obj3 (EtvaNode)
  1028.                 $obj3->addEtvaServer($obj1);
  1029.             // if joined row not null
  1030.  
  1031.             // Add objects for joined sfGuardGroup rows
  1032.  
  1033.             $key4 sfGuardGroupPeer::getPrimaryKeyHashFromRow($row$startcol4);
  1034.             if ($key4 !== null{
  1035.                 $obj4 sfGuardGroupPeer::getInstanceFromPool($key4);
  1036.                 if (!$obj4{
  1037.  
  1038.                     $omClass sfGuardGroupPeer::getOMClass();
  1039.  
  1040.  
  1041.                     $cls substr('.'.$omClassstrrpos('.'.$omClass'.'1);
  1042.                     $obj4 new $cls();
  1043.                     $obj4->hydrate($row$startcol4);
  1044.                     sfGuardGroupPeer::addInstanceToPool($obj4$key4);
  1045.                 // if obj4 loaded
  1046.  
  1047.                 // Add the $obj1 (EtvaServer) to the collection in $obj4 (sfGuardGroup)
  1048.                 $obj4->addEtvaServer($obj1);
  1049.             // if joined row not null
  1050.  
  1051.             $results[$obj1;
  1052.         }
  1053.         $stmt->closeCursor();
  1054.         return $results;
  1055.     }
  1056.  
  1057.  
  1058.     /**
  1059.      * Returns the number of rows matching criteria, joining the related EtvaLogicalvolume table
  1060.      *
  1061.      * @param      Criteria $c 
  1062.      * @param      boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
  1063.      * @param      PropelPDO $con 
  1064.      * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
  1065.      * @return     int Number of matching rows.
  1066.      */
  1067.     public static function doCountJoinAllExceptEtvaLogicalvolume(Criteria $criteria$distinct falsePropelPDO $con null$join_behavior Criteria::LEFT_JOIN)
  1068.     {
  1069.         // we're going to modify criteria, so copy it first
  1070.         $criteria clone $criteria;
  1071.  
  1072.         if ($distinct && !in_array(Criteria::DISTINCT$criteria->getSelectModifiers())) {
  1073.             $criteria->setDistinct();
  1074.         }
  1075.  
  1076.         if (!$criteria->hasSelectClause()) {
  1077.             EtvaServerPeer::addSelectColumns($criteria);
  1078.         }
  1079.  
  1080.         $criteria->clearOrderByColumns()// ORDER BY won't ever affect the count
  1081.  
  1082.         // Set the correct dbName
  1083.         $criteria->setDbName(self::DATABASE_NAME);
  1084.  
  1085.         if ($con === null{
  1086.             $con Propel::getConnection(EtvaServerPeer::DATABASE_NAMEPropel::CONNECTION_READ);
  1087.         }
  1088.     
  1089.                 $criteria->addJoin(array(EtvaServerPeer::NODE_ID,)array(EtvaNodePeer::ID,)$join_behavior);
  1090.                 $criteria->addJoin(array(EtvaServerPeer::SF_GUARD_GROUP_ID,)array(sfGuardGroupPeer::ID,)$join_behavior);
  1091.  
  1092.     foreach (sfMixer::getCallables('BaseEtvaServerPeer:doCount:doCount'as $callable)
  1093.     {
  1094.       call_user_func($callable'BaseEtvaServerPeer'$criteria$con);
  1095.     }
  1096.  
  1097.  
  1098.         $stmt BasePeer::doCount($criteria$con);
  1099.  
  1100.         if ($row $stmt->fetch(PDO::FETCH_NUM)) {
  1101.             $count = (int) $row[0];
  1102.         else {
  1103.             $count 0// no rows returned; we infer that means 0 matches.
  1104.         }
  1105.         $stmt->closeCursor();
  1106.         return $count;
  1107.     }
  1108.  
  1109.  
  1110.     /**
  1111.      * Returns the number of rows matching criteria, joining the related EtvaNode table
  1112.      *
  1113.      * @param      Criteria $c 
  1114.      * @param      boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
  1115.      * @param      PropelPDO $con 
  1116.      * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
  1117.      * @return     int Number of matching rows.
  1118.      */
  1119.     public static function doCountJoinAllExceptEtvaNode(Criteria $criteria$distinct falsePropelPDO $con null$join_behavior Criteria::LEFT_JOIN)
  1120.     {
  1121.         // we're going to modify criteria, so copy it first
  1122.         $criteria clone $criteria;
  1123.  
  1124.         if ($distinct && !in_array(Criteria::DISTINCT$criteria->getSelectModifiers())) {
  1125.             $criteria->setDistinct();
  1126.         }
  1127.  
  1128.         if (!$criteria->hasSelectClause()) {
  1129.             EtvaServerPeer::addSelectColumns($criteria);
  1130.         }
  1131.  
  1132.         $criteria->clearOrderByColumns()// ORDER BY won't ever affect the count
  1133.  
  1134.         // Set the correct dbName
  1135.         $criteria->setDbName(self::DATABASE_NAME);
  1136.  
  1137.         if ($con === null{
  1138.             $con Propel::getConnection(EtvaServerPeer::DATABASE_NAMEPropel::CONNECTION_READ);
  1139.         }
  1140.     
  1141.                 $criteria->addJoin(array(EtvaServerPeer::LOGICALVOLUME_ID,)array(EtvaLogicalvolumePeer::ID,)$join_behavior);
  1142.                 $criteria->addJoin(array(EtvaServerPeer::SF_GUARD_GROUP_ID,)array(sfGuardGroupPeer::ID,)$join_behavior);
  1143.  
  1144.     foreach (sfMixer::getCallables('BaseEtvaServerPeer:doCount:doCount'as $callable)
  1145.     {
  1146.       call_user_func($callable'BaseEtvaServerPeer'$criteria$con);
  1147.     }
  1148.  
  1149.  
  1150.         $stmt BasePeer::doCount($criteria$con);
  1151.  
  1152.         if ($row $stmt->fetch(PDO::FETCH_NUM)) {
  1153.             $count = (int) $row[0];
  1154.         else {
  1155.             $count 0// no rows returned; we infer that means 0 matches.
  1156.         }
  1157.         $stmt->closeCursor();
  1158.         return $count;
  1159.     }
  1160.  
  1161.  
  1162.     /**
  1163.      * Returns the number of rows matching criteria, joining the related sfGuardGroup table
  1164.      *
  1165.      * @param      Criteria $c 
  1166.      * @param      boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
  1167.      * @param      PropelPDO $con 
  1168.      * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
  1169.      * @return     int Number of matching rows.
  1170.      */
  1171.     public static function doCountJoinAllExceptsfGuardGroup(Criteria $criteria$distinct falsePropelPDO $con null$join_behavior Criteria::LEFT_JOIN)
  1172.     {
  1173.         // we're going to modify criteria, so copy it first
  1174.         $criteria clone $criteria;
  1175.  
  1176.         if ($distinct && !in_array(Criteria::DISTINCT$criteria->getSelectModifiers())) {
  1177.             $criteria->setDistinct();
  1178.         }
  1179.  
  1180.         if (!$criteria->hasSelectClause()) {
  1181.             EtvaServerPeer::addSelectColumns($criteria);
  1182.         }
  1183.  
  1184.         $criteria->clearOrderByColumns()// ORDER BY won't ever affect the count
  1185.  
  1186.         // Set the correct dbName
  1187.         $criteria->setDbName(self::DATABASE_NAME);
  1188.  
  1189.         if ($con === null{
  1190.             $con Propel::getConnection(EtvaServerPeer::DATABASE_NAMEPropel::CONNECTION_READ);
  1191.         }
  1192.     
  1193.                 $criteria->addJoin(array(EtvaServerPeer::LOGICALVOLUME_ID,)array(EtvaLogicalvolumePeer::ID,)$join_behavior);
  1194.                 $criteria->addJoin(array(EtvaServerPeer::NODE_ID,)array(EtvaNodePeer::ID,)$join_behavior);
  1195.  
  1196.     foreach (sfMixer::getCallables('BaseEtvaServerPeer:doCount:doCount'as $callable)
  1197.     {
  1198.       call_user_func($callable'BaseEtvaServerPeer'$criteria$con);
  1199.     }
  1200.  
  1201.  
  1202.         $stmt BasePeer::doCount($criteria$con);
  1203.  
  1204.         if ($row $stmt->fetch(PDO::FETCH_NUM)) {
  1205.             $count = (int) $row[0];
  1206.         else {
  1207.             $count 0// no rows returned; we infer that means 0 matches.
  1208.         }
  1209.         $stmt->closeCursor();
  1210.         return $count;
  1211.     }
  1212.  
  1213.  
  1214.     /**
  1215.      * Selects a collection of EtvaServer objects pre-filled with all related objects except EtvaLogicalvolume.
  1216.      *
  1217.      * @param      Criteria  $c 
  1218.      * @param      PropelPDO $con 
  1219.      * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
  1220.      * @return     array Array of EtvaServer objects.
  1221.      * @throws     PropelException Any exceptions caught during processing will be
  1222.      *          rethrown wrapped into a PropelException.
  1223.      */
  1224.     public static function doSelectJoinAllExceptEtvaLogicalvolume(Criteria $c$con null$join_behavior Criteria::LEFT_JOIN)
  1225.     {
  1226.  
  1227.     foreach (sfMixer::getCallables('BaseEtvaServerPeer:doSelectJoinAllExcept:doSelectJoinAllExcept'as $callable)
  1228.     {
  1229.       call_user_func($callable'BaseEtvaServerPeer'$c$con);
  1230.     }
  1231.  
  1232.  
  1233.         $c clone $c;
  1234.  
  1235.         // Set the correct dbName if it has not been overridden
  1236.         // $c->getDbName() will return the same object if not set to another value
  1237.         // so == check is okay and faster
  1238.         if ($c->getDbName(== Propel::getDefaultDB()) {
  1239.             $c->setDbName(self::DATABASE_NAME);
  1240.         }
  1241.  
  1242.         EtvaServerPeer::addSelectColumns($c);
  1243.         $startcol2 (EtvaServerPeer::NUM_COLUMNS EtvaServerPeer::NUM_LAZY_LOAD_COLUMNS);
  1244.  
  1245.         EtvaNodePeer::addSelectColumns($c);
  1246.         $startcol3 $startcol2 (EtvaNodePeer::NUM_COLUMNS EtvaNodePeer::NUM_LAZY_LOAD_COLUMNS);
  1247.  
  1248.         sfGuardGroupPeer::addSelectColumns($c);
  1249.         $startcol4 $startcol3 (sfGuardGroupPeer::NUM_COLUMNS sfGuardGroupPeer::NUM_LAZY_LOAD_COLUMNS);
  1250.  
  1251.                 $c->addJoin(array(EtvaServerPeer::NODE_ID,)array(EtvaNodePeer::ID,)$join_behavior);
  1252.                 $c->addJoin(array(EtvaServerPeer::SF_GUARD_GROUP_ID,)array(sfGuardGroupPeer::ID,)$join_behavior);
  1253.  
  1254.         $stmt BasePeer::doSelect($c$con);
  1255.         $results array();
  1256.  
  1257.         while ($row $stmt->fetch(PDO::FETCH_NUM)) {
  1258.             $key1 EtvaServerPeer::getPrimaryKeyHashFromRow($row0);
  1259.             if (null !== ($obj1 EtvaServerPeer::getInstanceFromPool($key1))) {
  1260.                 // We no longer rehydrate the object, since this can cause data loss.
  1261.                 // See http://propel.phpdb.org/trac/ticket/509
  1262.                 // $obj1->hydrate($row, 0, true); // rehydrate
  1263.             else {
  1264.                 $omClass EtvaServerPeer::getOMClass();
  1265.  
  1266.                 $cls substr('.'.$omClassstrrpos('.'.$omClass'.'1);
  1267.                 $obj1 new $cls();
  1268.                 $obj1->hydrate($row);
  1269.                 EtvaServerPeer::addInstanceToPool($obj1$key1);
  1270.             // if obj1 already loaded
  1271.  
  1272.                 // Add objects for joined EtvaNode rows
  1273.  
  1274.                 $key2 EtvaNodePeer::getPrimaryKeyHashFromRow($row$startcol2);
  1275.                 if ($key2 !== null{
  1276.                     $obj2 EtvaNodePeer::getInstanceFromPool($key2);
  1277.                     if (!$obj2{
  1278.     
  1279.                         $omClass EtvaNodePeer::getOMClass();
  1280.  
  1281.  
  1282.                     $cls substr('.'.$omClassstrrpos('.'.$omClass'.'1);
  1283.                     $obj2 new $cls();
  1284.                     $obj2->hydrate($row$startcol2);
  1285.                     EtvaNodePeer::addInstanceToPool($obj2$key2);
  1286.                 // if $obj2 already loaded
  1287.  
  1288.                 // Add the $obj1 (EtvaServer) to the collection in $obj2 (EtvaNode)
  1289.                 $obj2->addEtvaServer($obj1);
  1290.  
  1291.             // if joined row is not null
  1292.  
  1293.                 // Add objects for joined sfGuardGroup rows
  1294.  
  1295.                 $key3 sfGuardGroupPeer::getPrimaryKeyHashFromRow($row$startcol3);
  1296.                 if ($key3 !== null{
  1297.                     $obj3 sfGuardGroupPeer::getInstanceFromPool($key3);
  1298.                     if (!$obj3{
  1299.     
  1300.                         $omClass sfGuardGroupPeer::getOMClass();
  1301.  
  1302.  
  1303.                     $cls substr('.'.$omClassstrrpos('.'.$omClass'.'1);
  1304.                     $obj3 new $cls();
  1305.                     $obj3->hydrate($row$startcol3);
  1306.                     sfGuardGroupPeer::addInstanceToPool($obj3$key3);
  1307.                 // if $obj3 already loaded
  1308.  
  1309.                 // Add the $obj1 (EtvaServer) to the collection in $obj3 (sfGuardGroup)
  1310.                 $obj3->addEtvaServer($obj1);
  1311.  
  1312.             // if joined row is not null
  1313.  
  1314.             $results[$obj1;
  1315.         }
  1316.         $stmt->closeCursor();
  1317.         return $results;
  1318.     }
  1319.  
  1320.  
  1321.     /**
  1322.      * Selects a collection of EtvaServer objects pre-filled with all related objects except EtvaNode.
  1323.      *
  1324.      * @param      Criteria  $c 
  1325.      * @param      PropelPDO $con 
  1326.      * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
  1327.      * @return     array Array of EtvaServer objects.
  1328.      * @throws     PropelException Any exceptions caught during processing will be
  1329.      *          rethrown wrapped into a PropelException.
  1330.      */
  1331.     public static function doSelectJoinAllExceptEtvaNode(Criteria $c$con null$join_behavior Criteria::LEFT_JOIN)
  1332.     {
  1333.         $c clone $c;
  1334.  
  1335.         // Set the correct dbName if it has not been overridden
  1336.         // $c->getDbName() will return the same object if not set to another value
  1337.         // so == check is okay and faster
  1338.         if ($c->getDbName(== Propel::getDefaultDB()) {
  1339.             $c->setDbName(self::DATABASE_NAME);
  1340.         }
  1341.  
  1342.         EtvaServerPeer::addSelectColumns($c);
  1343.         $startcol2 (EtvaServerPeer::NUM_COLUMNS EtvaServerPeer::NUM_LAZY_LOAD_COLUMNS);
  1344.  
  1345.         EtvaLogicalvolumePeer::addSelectColumns($c);
  1346.         $startcol3 $startcol2 (EtvaLogicalvolumePeer::NUM_COLUMNS EtvaLogicalvolumePeer::NUM_LAZY_LOAD_COLUMNS);
  1347.  
  1348.         sfGuardGroupPeer::addSelectColumns($c);
  1349.         $startcol4 $startcol3 (sfGuardGroupPeer::NUM_COLUMNS sfGuardGroupPeer::NUM_LAZY_LOAD_COLUMNS);
  1350.  
  1351.                 $c->addJoin(array(EtvaServerPeer::LOGICALVOLUME_ID,)array(EtvaLogicalvolumePeer::ID,)$join_behavior);
  1352.                 $c->addJoin(array(EtvaServerPeer::SF_GUARD_GROUP_ID,)array(sfGuardGroupPeer::ID,)$join_behavior);
  1353.  
  1354.         $stmt BasePeer::doSelect($c$con);
  1355.         $results array();
  1356.  
  1357.         while ($row $stmt->fetch(PDO::FETCH_NUM)) {
  1358.             $key1 EtvaServerPeer::getPrimaryKeyHashFromRow($row0);
  1359.             if (null !== ($obj1 EtvaServerPeer::getInstanceFromPool($key1))) {
  1360.                 // We no longer rehydrate the object, since this can cause data loss.
  1361.                 // See http://propel.phpdb.org/trac/ticket/509
  1362.                 // $obj1->hydrate($row, 0, true); // rehydrate
  1363.             else {
  1364.                 $omClass EtvaServerPeer::getOMClass();
  1365.  
  1366.                 $cls substr('.'.$omClassstrrpos('.'.$omClass'.'1);
  1367.                 $obj1 new $cls();
  1368.                 $obj1->hydrate($row);
  1369.                 EtvaServerPeer::addInstanceToPool($obj1$key1);
  1370.             // if obj1 already loaded
  1371.  
  1372.                 // Add objects for joined EtvaLogicalvolume rows
  1373.  
  1374.                 $key2 EtvaLogicalvolumePeer::getPrimaryKeyHashFromRow($row$startcol2);
  1375.                 if ($key2 !== null{
  1376.                     $obj2 EtvaLogicalvolumePeer::getInstanceFromPool($key2);
  1377.                     if (!$obj2{
  1378.     
  1379.                         $omClass EtvaLogicalvolumePeer::getOMClass();
  1380.  
  1381.  
  1382.                     $cls substr('.'.$omClassstrrpos('.'.$omClass'.'1);
  1383.                     $obj2 new $cls();
  1384.                     $obj2->hydrate($row$startcol2);
  1385.                     EtvaLogicalvolumePeer::addInstanceToPool($obj2$key2);
  1386.                 // if $obj2 already loaded
  1387.  
  1388.                 // Add the $obj1 (EtvaServer) to the collection in $obj2 (EtvaLogicalvolume)
  1389.                 $obj2->addEtvaServer($obj1);
  1390.  
  1391.             // if joined row is not null
  1392.  
  1393.                 // Add objects for joined sfGuardGroup rows
  1394.  
  1395.                 $key3 sfGuardGroupPeer::getPrimaryKeyHashFromRow($row$startcol3);
  1396.                 if ($key3 !== null{
  1397.                     $obj3 sfGuardGroupPeer::getInstanceFromPool($key3);
  1398.                     if (!$obj3{
  1399.     
  1400.                         $omClass sfGuardGroupPeer::getOMClass();
  1401.  
  1402.  
  1403.                     $cls substr('.'.$omClassstrrpos('.'.$omClass'.'1);
  1404.                     $obj3 new $cls();
  1405.                     $obj3->hydrate($row$startcol3);
  1406.                     sfGuardGroupPeer::addInstanceToPool($obj3$key3);
  1407.                 // if $obj3 already loaded
  1408.  
  1409.                 // Add the $obj1 (EtvaServer) to the collection in $obj3 (sfGuardGroup)
  1410.                 $obj3->addEtvaServer($obj1);
  1411.  
  1412.             // if joined row is not null
  1413.  
  1414.             $results[$obj1;
  1415.         }
  1416.         $stmt->closeCursor();
  1417.         return $results;
  1418.     }
  1419.  
  1420.  
  1421.     /**
  1422.      * Selects a collection of EtvaServer objects pre-filled with all related objects except sfGuardGroup.
  1423.      *
  1424.      * @param      Criteria  $c 
  1425.      * @param      PropelPDO $con 
  1426.      * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
  1427.      * @return     array Array of EtvaServer objects.
  1428.      * @throws     PropelException Any exceptions caught during processing will be
  1429.      *          rethrown wrapped into a PropelException.
  1430.      */
  1431.     public static function doSelectJoinAllExceptsfGuardGroup(Criteria $c$con null$join_behavior Criteria::LEFT_JOIN)
  1432.     {
  1433.         $c clone $c;
  1434.  
  1435.         // Set the correct dbName if it has not been overridden
  1436.         // $c->getDbName() will return the same object if not set to another value
  1437.         // so == check is okay and faster
  1438.         if ($c->getDbName(== Propel::getDefaultDB()) {
  1439.             $c->setDbName(self::DATABASE_NAME);
  1440.         }
  1441.  
  1442.         EtvaServerPeer::addSelectColumns($c);
  1443.         $startcol2 (EtvaServerPeer::NUM_COLUMNS EtvaServerPeer::NUM_LAZY_LOAD_COLUMNS);
  1444.  
  1445.         EtvaLogicalvolumePeer::addSelectColumns($c);
  1446.         $startcol3 $startcol2 (EtvaLogicalvolumePeer::NUM_COLUMNS EtvaLogicalvolumePeer::NUM_LAZY_LOAD_COLUMNS);
  1447.  
  1448.         EtvaNodePeer::addSelectColumns($c);
  1449.         $startcol4 $startcol3 (EtvaNodePeer::NUM_COLUMNS EtvaNodePeer::NUM_LAZY_LOAD_COLUMNS);
  1450.  
  1451.                 $c->addJoin(array(EtvaServerPeer::LOGICALVOLUME_ID,)array(EtvaLogicalvolumePeer::ID,)$join_behavior);
  1452.                 $c->addJoin(array(EtvaServerPeer::NODE_ID,)array(EtvaNodePeer::ID,)$join_behavior);
  1453.  
  1454.         $stmt BasePeer::doSelect($c$con);
  1455.         $results array();
  1456.  
  1457.         while ($row $stmt->fetch(PDO::FETCH_NUM)) {
  1458.             $key1 EtvaServerPeer::getPrimaryKeyHashFromRow($row0);
  1459.             if (null !== ($obj1 EtvaServerPeer::getInstanceFromPool($key1))) {
  1460.                 // We no longer rehydrate the object, since this can cause data loss.
  1461.                 // See http://propel.phpdb.org/trac/ticket/509
  1462.                 // $obj1->hydrate($row, 0, true); // rehydrate
  1463.             else {
  1464.                 $omClass EtvaServerPeer::getOMClass();
  1465.  
  1466.                 $cls substr('.'.$omClassstrrpos('.'.$omClass'.'1);
  1467.                 $obj1 new $cls();
  1468.                 $obj1->hydrate($row);
  1469.                 EtvaServerPeer::addInstanceToPool($obj1$key1);
  1470.             // if obj1 already loaded
  1471.  
  1472.                 // Add objects for joined EtvaLogicalvolume rows
  1473.  
  1474.                 $key2 EtvaLogicalvolumePeer::getPrimaryKeyHashFromRow($row$startcol2);
  1475.                 if ($key2 !== null{
  1476.                     $obj2 EtvaLogicalvolumePeer::getInstanceFromPool($key2);
  1477.                     if (!$obj2{
  1478.     
  1479.                         $omClass EtvaLogicalvolumePeer::getOMClass();
  1480.  
  1481.  
  1482.                     $cls substr('.'.$omClassstrrpos('.'.$omClass'.'1);
  1483.                     $obj2 new $cls();
  1484.                     $obj2->hydrate($row$startcol2);
  1485.                     EtvaLogicalvolumePeer::addInstanceToPool($obj2$key2);
  1486.                 // if $obj2 already loaded
  1487.  
  1488.                 // Add the $obj1 (EtvaServer) to the collection in $obj2 (EtvaLogicalvolume)
  1489.                 $obj2->addEtvaServer($obj1);
  1490.  
  1491.             // if joined row is not null
  1492.  
  1493.                 // Add objects for joined EtvaNode rows
  1494.  
  1495.                 $key3 EtvaNodePeer::getPrimaryKeyHashFromRow($row$startcol3);
  1496.                 if ($key3 !== null{
  1497.                     $obj3 EtvaNodePeer::getInstanceFromPool($key3);
  1498.                     if (!$obj3{
  1499.     
  1500.                         $omClass EtvaNodePeer::getOMClass();
  1501.  
  1502.  
  1503.                     $cls substr('.'.$omClassstrrpos('.'.$omClass'.'1);
  1504.                     $obj3 new $cls();
  1505.                     $obj3->hydrate($row$startcol3);
  1506.                     EtvaNodePeer::addInstanceToPool($obj3$key3);
  1507.                 // if $obj3 already loaded
  1508.  
  1509.                 // Add the $obj1 (EtvaServer) to the collection in $obj3 (EtvaNode)
  1510.                 $obj3->addEtvaServer($obj1);
  1511.  
  1512.             // if joined row is not null
  1513.  
  1514.             $results[$obj1;
  1515.         }
  1516.         $stmt->closeCursor();
  1517.         return $results;
  1518.     }
  1519.  
  1520.  
  1521.   static public function getUniqueColumnNames()
  1522.   {
  1523.     return array();
  1524.   }
  1525.     /**
  1526.      * Returns the TableMap related to this peer.
  1527.      * This method is not needed for general use but a specific application could have a need.
  1528.      * @return     TableMap 
  1529.      * @throws     PropelException Any exceptions caught during processing will be
  1530.      *          rethrown wrapped into a PropelException.
  1531.      */
  1532.     public static function getTableMap()
  1533.     {
  1534.         return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
  1535.     }
  1536.  
  1537.     /**
  1538.      * The class that the Peer will make instances of.
  1539.      *
  1540.      * This uses a dot-path notation which is tranalted into a path
  1541.      * relative to a location on the PHP include_path.
  1542.      * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
  1543.      *
  1544.      * @return     string path.to.ClassName
  1545.      */
  1546.     public static function getOMClass()
  1547.     {
  1548.         return EtvaServerPeer::CLASS_DEFAULT;
  1549.     }
  1550.  
  1551.     /**
  1552.      * Method perform an INSERT on the database, given a EtvaServer or Criteria object.
  1553.      *
  1554.      * @param      mixed $values Criteria or EtvaServer object containing data that is used to create the INSERT statement.
  1555.      * @param      PropelPDO $con the PropelPDO connection to use
  1556.      * @return     mixed The new primary key.
  1557.      * @throws     PropelException Any exceptions caught during processing will be
  1558.      *          rethrown wrapped into a PropelException.
  1559.      */
  1560.     public static function doInsert($valuesPropelPDO $con null)
  1561.     {
  1562.  
  1563.     foreach (sfMixer::getCallables('BaseEtvaServerPeer:doInsert:pre'as $callable)
  1564.     {
  1565.       $ret call_user_func($callable'BaseEtvaServerPeer'$values$con);
  1566.       if (false !== $ret)
  1567.       {
  1568.         return $ret;
  1569.       }
  1570.     }
  1571.  
  1572.  
  1573.         if ($con === null{
  1574.             $con Propel::getConnection(EtvaServerPeer::DATABASE_NAMEPropel::CONNECTION_WRITE);
  1575.         }
  1576.  
  1577.         if ($values instanceof Criteria{
  1578.             $criteria clone $values// rename for clarity
  1579.         else {
  1580.             $criteria $values->buildCriteria()// build Criteria from EtvaServer object
  1581.         }
  1582.  
  1583.         if ($criteria->containsKey(EtvaServerPeer::ID&& $criteria->keyContainsValue(EtvaServerPeer::ID) ) {
  1584.             throw new PropelException('Cannot insert a value for auto-increment primary key ('.EtvaServerPeer::ID.')');
  1585.         }
  1586.  
  1587.  
  1588.         // Set the correct dbName
  1589.         $criteria->setDbName(self::DATABASE_NAME);
  1590.  
  1591.         try {
  1592.             // use transaction because $criteria could contain info
  1593.             // for more than one table (I guess, conceivably)
  1594.             $con->beginTransaction();
  1595.             $pk BasePeer::doInsert($criteria$con);
  1596.             $con->commit();
  1597.         catch(PropelException $e{
  1598.             $con->rollBack();
  1599.             throw $e;
  1600.         }
  1601.  
  1602.         
  1603.     foreach (sfMixer::getCallables('BaseEtvaServerPeer:doInsert:post'as $callable)
  1604.     {
  1605.       call_user_func($callable'BaseEtvaServerPeer'$values$con$pk);
  1606.     }
  1607.  
  1608.     return $pk;
  1609.     }
  1610.  
  1611.     /**
  1612.      * Method perform an UPDATE on the database, given a EtvaServer or Criteria object.
  1613.      *
  1614.      * @param      mixed $values Criteria or EtvaServer object containing data that is used to create the UPDATE statement.
  1615.      * @param      PropelPDO $con The connection to use (specify PropelPDO connection object to exert more control over transactions).
  1616.      * @return     int The number of affected rows (if supported by underlying database driver).
  1617.      * @throws     PropelException Any exceptions caught during processing will be
  1618.      *          rethrown wrapped into a PropelException.
  1619.      */
  1620.     public static function doUpdate($valuesPropelPDO $con null)
  1621.     {
  1622.  
  1623.     foreach (sfMixer::getCallables('BaseEtvaServerPeer:doUpdate:pre'as $callable)
  1624.     {
  1625.       $ret call_user_func($callable'BaseEtvaServerPeer'$values$con);
  1626.       if (false !== $ret)
  1627.       {
  1628.         return $ret;
  1629.       }
  1630.     }
  1631.  
  1632.  
  1633.         if ($con === null{
  1634.             $con Propel::getConnection(EtvaServerPeer::DATABASE_NAMEPropel::CONNECTION_WRITE);
  1635.         }
  1636.  
  1637.         $selectCriteria new Criteria(self::DATABASE_NAME);
  1638.  
  1639.         if ($values instanceof Criteria{
  1640.             $criteria clone $values// rename for clarity
  1641.  
  1642.             $comparison $criteria->getComparison(EtvaServerPeer::ID);
  1643.             $selectCriteria->add(EtvaServerPeer::ID$criteria->remove(EtvaServerPeer::ID)$comparison);
  1644.  
  1645.         else // $values is EtvaServer object
  1646.             $criteria $values->buildCriteria()// gets full criteria
  1647.             $selectCriteria $values->buildPkeyCriteria()// gets criteria w/ primary key(s)
  1648.         }
  1649.  
  1650.         // set the correct dbName
  1651.         $criteria->setDbName(self::DATABASE_NAME);
  1652.  
  1653.         $ret BasePeer::doUpdate($selectCriteria$criteria$con);
  1654.     
  1655.  
  1656.     foreach (sfMixer::getCallables('BaseEtvaServerPeer:doUpdate:post'as $callable)
  1657.     {
  1658.       call_user_func($callable'BaseEtvaServerPeer'$values$con$ret);
  1659.     }
  1660.  
  1661.     return $ret;
  1662.   }
  1663.  
  1664.     /**
  1665.      * Method to DELETE all rows from the server table.
  1666.      *
  1667.      * @return     int The number of affected rows (if supported by underlying database driver).
  1668.      */
  1669.     public static function doDeleteAll($con null)
  1670.     {
  1671.         if ($con === null{
  1672.             $con Propel::getConnection(EtvaServerPeer::DATABASE_NAMEPropel::CONNECTION_WRITE);
  1673.         }
  1674.         $affectedRows 0// initialize var to track total num of affected rows
  1675.         try {
  1676.             // use transaction because $criteria could contain info
  1677.             // for more than one table or we could emulating ON DELETE CASCADE, etc.
  1678.             $con->beginTransaction();
  1679.             $affectedRows += BasePeer::doDeleteAll(EtvaServerPeer::TABLE_NAME$con);
  1680.             $con->commit();
  1681.             return $affectedRows;
  1682.         catch (PropelException $e{
  1683.             $con->rollBack();
  1684.             throw $e;
  1685.         }
  1686.     }
  1687.  
  1688.     /**
  1689.      * Method perform a DELETE on the database, given a EtvaServer or Criteria object OR a primary key value.
  1690.      *
  1691.      * @param      mixed $values Criteria or EtvaServer object or primary key or array of primary keys
  1692.      *               which is used to create the DELETE statement
  1693.      * @param      PropelPDO $con the connection to use
  1694.      * @return     int     The number of affected rows (if supported by underlying database driver).  This includes CASCADE-related rows
  1695.      *                 if supported by native driver or if emulated using Propel.
  1696.      * @throws     PropelException Any exceptions caught during processing will be
  1697.      *          rethrown wrapped into a PropelException.
  1698.      */
  1699.      public static function doDelete($valuesPropelPDO $con null)
  1700.      {
  1701.         if ($con === null{
  1702.             $con Propel::getConnection(EtvaServerPeer::DATABASE_NAMEPropel::CONNECTION_WRITE);
  1703.         }
  1704.  
  1705.         if ($values instanceof Criteria{
  1706.             // invalidate the cache for all objects of this type, since we have no
  1707.             // way of knowing (without running a query) what objects should be invalidated
  1708.             // from the cache based on this Criteria.
  1709.             EtvaServerPeer::clearInstancePool();
  1710.  
  1711.             // rename for clarity
  1712.             $criteria clone $values;
  1713.         elseif ($values instanceof EtvaServer{
  1714.             // invalidate the cache for this single object
  1715.             EtvaServerPeer::removeInstanceFromPool($values);
  1716.             // create criteria based on pk values
  1717.             $criteria $values->buildPkeyCriteria();
  1718.         else {
  1719.             // it must be the primary key
  1720.  
  1721.  
  1722.  
  1723.             $criteria new Criteria(self::DATABASE_NAME);
  1724.             $criteria->add(EtvaServerPeer::ID(array) $valuesCriteria::IN);
  1725.  
  1726.             foreach ((array) $values as $singleval{
  1727.                 // we can invalidate the cache for this single object
  1728.                 EtvaServerPeer::removeInstanceFromPool($singleval);
  1729.             }
  1730.         }
  1731.  
  1732.         // Set the correct dbName
  1733.         $criteria->setDbName(self::DATABASE_NAME);
  1734.  
  1735.         $affectedRows 0// initialize var to track total num of affected rows
  1736.  
  1737.         try {
  1738.             // use transaction because $criteria could contain info
  1739.             // for more than one table or we could emulating ON DELETE CASCADE, etc.
  1740.             $con->beginTransaction();
  1741.             
  1742.             $affectedRows += BasePeer::doDelete($criteria$con);
  1743.  
  1744.             $con->commit();
  1745.             return $affectedRows;
  1746.         catch (PropelException $e{
  1747.             $con->rollBack();
  1748.             throw $e;
  1749.         }
  1750.     }
  1751.  
  1752.     /**
  1753.      * Validates all modified columns of given EtvaServer object.
  1754.      * If parameter $columns is either a single column name or an array of column names
  1755.      * than only those columns are validated.
  1756.      *
  1757.      * NOTICE: This does not apply to primary or foreign keys for now.
  1758.      *
  1759.      * @param      EtvaServer $obj The object to validate.
  1760.      * @param      mixed $cols Column name or array of column names.
  1761.      *
  1762.      * @return     mixed TRUE if all columns are valid or the error message of the first invalid column.
  1763.      */
  1764.     public static function doValidate(EtvaServer $obj$cols null)
  1765.     {
  1766.         $columns array();
  1767.  
  1768.         if ($cols{
  1769.             $dbMap Propel::getDatabaseMap(EtvaServerPeer::DATABASE_NAME);
  1770.             $tableMap $dbMap->getTable(EtvaServerPeer::TABLE_NAME);
  1771.  
  1772.             if (is_array($cols)) {
  1773.                 $cols array($cols);
  1774.             }
  1775.  
  1776.             foreach ($cols as $colName{
  1777.                 if ($tableMap->containsColumn($colName)) {
  1778.                     $get 'get' $tableMap->getColumn($colName)->getPhpName();
  1779.                     $columns[$colName$obj->$get();
  1780.                 }
  1781.             }
  1782.         else {
  1783.  
  1784.         }
  1785.  
  1786.         $res =  BasePeer::doValidate(EtvaServerPeer::DATABASE_NAMEEtvaServerPeer::TABLE_NAME$columns);
  1787.     if ($res !== true{
  1788.         $request sfContext::getInstance()->getRequest();
  1789.         foreach ($res as $failed{
  1790.             $col EtvaServerPeer::translateFieldname($failed->getColumn()BasePeer::TYPE_COLNAMEBasePeer::TYPE_PHPNAME);
  1791.         }
  1792.     }
  1793.  
  1794.     return $res;
  1795.     }
  1796.  
  1797.     /**
  1798.      * Retrieve a single object by pkey.
  1799.      *
  1800.      * @param      int $pk the primary key.
  1801.      * @param      PropelPDO $con the connection to use
  1802.      * @return     EtvaServer 
  1803.      */
  1804.     public static function retrieveByPK($pkPropelPDO $con null)
  1805.     {
  1806.  
  1807.         if (null !== ($obj EtvaServerPeer::getInstanceFromPool((string) $pk))) {
  1808.             return $obj;
  1809.         }
  1810.  
  1811.         if ($con === null{
  1812.             $con Propel::getConnection(EtvaServerPeer::DATABASE_NAMEPropel::CONNECTION_READ);
  1813.         }
  1814.  
  1815.         $criteria new Criteria(EtvaServerPeer::DATABASE_NAME);
  1816.         $criteria->add(EtvaServerPeer::ID$pk);
  1817.  
  1818.         $v EtvaServerPeer::doSelect($criteria$con);
  1819.  
  1820.         return !empty($v$v[0null;
  1821.     }
  1822.  
  1823.     /**
  1824.      * Retrieve multiple objects by pkey.
  1825.      *
  1826.      * @param      array $pks List of primary keys
  1827.      * @param      PropelPDO $con the connection to use
  1828.      * @throws     PropelException Any exceptions caught during processing will be
  1829.      *          rethrown wrapped into a PropelException.
  1830.      */
  1831.     public static function retrieveByPKs($pksPropelPDO $con null)
  1832.     {
  1833.         if ($con === null{
  1834.             $con Propel::getConnection(EtvaServerPeer::DATABASE_NAMEPropel::CONNECTION_READ);
  1835.         }
  1836.  
  1837.         $objs null;
  1838.         if (empty($pks)) {
  1839.             $objs array();
  1840.         else {
  1841.             $criteria new Criteria(EtvaServerPeer::DATABASE_NAME);
  1842.             $criteria->add(EtvaServerPeer::ID$pksCriteria::IN);
  1843.             $objs EtvaServerPeer::doSelect($criteria$con);
  1844.         }
  1845.         return $objs;
  1846.     }
  1847.  
  1848. // BaseEtvaServerPeer
  1849.  
  1850. // This is the static code needed to register the MapBuilder for this table with the main Propel class.
  1851. //
  1852. // NOTE: This static code cannot call methods on the EtvaServerPeer class, because it is not defined yet.
  1853. // If you need to use overridden methods, you can add this code to the bottom of the EtvaServerPeer class:
  1854. //
  1855. // Propel::getDatabaseMap(EtvaServerPeer::DATABASE_NAME)->addTableBuilder(EtvaServerPeer::TABLE_NAME, EtvaServerPeer::getMapBuilder());
  1856. //
  1857. // Doing so will effectively overwrite the registration below.
  1858.  
  1859. Propel::getDatabaseMap(BaseEtvaServerPeer::DATABASE_NAME)->addTableBuilder(BaseEtvaServerPeer::TABLE_NAMEBaseEtvaServerPeer::getMapBuilder());

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