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

Source for file BaseEtvaLogicalvolumePeer.php

Documentation is available at BaseEtvaLogicalvolumePeer.php

  1. <?php
  2.  
  3. /**
  4.  * Base static class for performing query and update operations on the 'logicalvolume' table.
  5.  *
  6.  * 
  7.  *
  8.  * This class was autogenerated by Propel 1.3.0-dev on:
  9.  *
  10.  * Thu Jun 18 14:28:38 2009
  11.  *
  12.  * @package    lib.model.om
  13.  */
  14. abstract class BaseEtvaLogicalvolumePeer {
  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 'logicalvolume';
  21.  
  22.     /** A class that can be returned by this peer. */
  23.     const CLASS_DEFAULT 'lib.model.EtvaLogicalvolume';
  24.  
  25.     /** The total number of columns. */
  26.     const NUM_COLUMNS 10;
  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 'logicalvolume.ID';
  33.  
  34.     /** the column name for the VOLUMEGROUP_ID field */
  35.     const VOLUMEGROUP_ID 'logicalvolume.VOLUMEGROUP_ID';
  36.  
  37.     /** the column name for the NODE_ID field */
  38.     const NODE_ID 'logicalvolume.NODE_ID';
  39.  
  40.     /** the column name for the LV field */
  41.     const LV 'logicalvolume.LV';
  42.  
  43.     /** the column name for the LVDEVICE field */
  44.     const LVDEVICE 'logicalvolume.LVDEVICE';
  45.  
  46.     /** the column name for the SIZE field */
  47.     const SIZE 'logicalvolume.SIZE';
  48.  
  49.     /** the column name for the FREESIZE field */
  50.     const FREESIZE 'logicalvolume.FREESIZE';
  51.  
  52.     /** the column name for the STORAGE_TYPE field */
  53.     const STORAGE_TYPE 'logicalvolume.STORAGE_TYPE';
  54.  
  55.     /** the column name for the WRITEABLE field */
  56.     const WRITEABLE 'logicalvolume.WRITEABLE';
  57.  
  58.     /** the column name for the IN_USE field */
  59.     const IN_USE 'logicalvolume.IN_USE';
  60.  
  61.     /**
  62.      * An identiy map to hold any loaded instances of EtvaLogicalvolume objects.
  63.      * This must be public so that other peer classes can access this when hydrating from JOIN
  64.      * queries.
  65.      * @var        array EtvaLogicalvolume[]
  66.      */
  67.     public static $instances array();
  68.  
  69.     /**
  70.      * The MapBuilder instance for this peer.
  71.      * @var        MapBuilder 
  72.      */
  73.     private static $mapBuilder null;
  74.  
  75.     /**
  76.      * holds an array of fieldnames
  77.      *
  78.      * first dimension keys are the type constants
  79.      * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
  80.      */
  81.     private static $fieldNames array (
  82.         BasePeer::TYPE_PHPNAME => array ('Id''VolumegroupId''NodeId''Lv''Lvdevice''Size''Freesize''StorageType''Writeable''InUse'),
  83.         BasePeer::TYPE_STUDLYPHPNAME => array ('id''volumegroupId''nodeId''lv''lvdevice''size''freesize''storageType''writeable''inUse'),
  84.         BasePeer::TYPE_COLNAME => array (self::IDself::VOLUMEGROUP_IDself::NODE_IDself::LVself::LVDEVICEself::SIZEself::FREESIZEself::STORAGE_TYPEself::WRITEABLEself::IN_USE),
  85.         BasePeer::TYPE_FIELDNAME => array ('id''volumegroup_id''node_id''lv''lvdevice''size''freesize''storage_type''writeable''in_use'),
  86.         BasePeer::TYPE_NUM => array (0123456789)
  87.     );
  88.  
  89.     /**
  90.      * holds an array of keys for quick access to the fieldnames array
  91.      *
  92.      * first dimension keys are the type constants
  93.      * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
  94.      */
  95.     private static $fieldKeys array (
  96.         BasePeer::TYPE_PHPNAME => array ('Id' => 0'VolumegroupId' => 1'NodeId' => 2'Lv' => 3'Lvdevice' => 4'Size' => 5'Freesize' => 6'StorageType' => 7'Writeable' => 8'InUse' => 9),
  97.         BasePeer::TYPE_STUDLYPHPNAME => array ('id' => 0'volumegroupId' => 1'nodeId' => 2'lv' => 3'lvdevice' => 4'size' => 5'freesize' => 6'storageType' => 7'writeable' => 8'inUse' => 9),
  98.         BasePeer::TYPE_COLNAME => array (self::ID => 0self::VOLUMEGROUP_ID => 1self::NODE_ID => 2self::LV => 3self::LVDEVICE => 4self::SIZE => 5self::FREESIZE => 6self::STORAGE_TYPE => 7self::WRITEABLE => 8self::IN_USE => 9),
  99.         BasePeer::TYPE_FIELDNAME => array ('id' => 0'volumegroup_id' => 1'node_id' => 2'lv' => 3'lvdevice' => 4'size' => 5'freesize' => 6'storage_type' => 7'writeable' => 8'in_use' => 9),
  100.         BasePeer::TYPE_NUM => array (0123456789)
  101.     );
  102.  
  103.     /**
  104.      * Get a (singleton) instance of the MapBuilder for this peer class.
  105.      * @return     MapBuilder The map builder for this peer
  106.      */
  107.     public static function getMapBuilder()
  108.     {
  109.         if (self::$mapBuilder === null{
  110.             self::$mapBuilder new EtvaLogicalvolumeMapBuilder();
  111.         }
  112.         return self::$mapBuilder;
  113.     }
  114.     /**
  115.      * Translates a fieldname to another type
  116.      *
  117.      * @param      string $name field name
  118.      * @param      string $fromType One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
  119.      *                          BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
  120.      * @param      string $toType   One of the class type constants
  121.      * @return     string translated name of the field.
  122.      * @throws     PropelException - if the specified name could not be found in the fieldname mappings.
  123.      */
  124.     static public function translateFieldName($name$fromType$toType)
  125.     {
  126.         $toNames self::getFieldNames($toType);
  127.         $key = isset(self::$fieldKeys[$fromType][$name]self::$fieldKeys[$fromType][$namenull;
  128.         if ($key === null{
  129.             throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: print_r(self::$fieldKeys[$fromType]true));
  130.         }
  131.         return $toNames[$key];
  132.     }
  133.  
  134.     /**
  135.      * Returns an array of field names.
  136.      *
  137.      * @param      string $type The type of fieldnames to return:
  138.      *                       One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
  139.      *                       BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
  140.      * @return     array A list of field names
  141.      */
  142.  
  143.     static public function getFieldNames($type BasePeer::TYPE_PHPNAME)
  144.     {
  145.         if (!array_key_exists($typeself::$fieldNames)) {
  146.             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.');
  147.         }
  148.         return self::$fieldNames[$type];
  149.     }
  150.  
  151.     /**
  152.      * Convenience method which changes table.column to alias.column.
  153.      *
  154.      * Using this method you can maintain SQL abstraction while using column aliases.
  155.      * <code>
  156.      *        $c->addAlias("alias1", TablePeer::TABLE_NAME);
  157.      *        $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
  158.      * </code>
  159.      * @param      string $alias The alias for the current table.
  160.      * @param      string $column The column name for current table. (i.e. EtvaLogicalvolumePeer::COLUMN_NAME).
  161.      * @return     string 
  162.      */
  163.     public static function alias($alias$column)
  164.     {
  165.         return str_replace(EtvaLogicalvolumePeer::TABLE_NAME.'.'$alias.'.'$column);
  166.     }
  167.  
  168.     /**
  169.      * Add all the columns needed to create a new object.
  170.      *
  171.      * Note: any columns that were marked with lazyLoad="true" in the
  172.      * XML schema will not be added to the select list and only loaded
  173.      * on demand.
  174.      *
  175.      * @param      criteria object containing the columns to add.
  176.      * @throws     PropelException Any exceptions caught during processing will be
  177.      *          rethrown wrapped into a PropelException.
  178.      */
  179.     public static function addSelectColumns(Criteria $criteria)
  180.     {
  181.  
  182.         $criteria->addSelectColumn(EtvaLogicalvolumePeer::ID);
  183.  
  184.         $criteria->addSelectColumn(EtvaLogicalvolumePeer::VOLUMEGROUP_ID);
  185.  
  186.         $criteria->addSelectColumn(EtvaLogicalvolumePeer::NODE_ID);
  187.  
  188.         $criteria->addSelectColumn(EtvaLogicalvolumePeer::LV);
  189.  
  190.         $criteria->addSelectColumn(EtvaLogicalvolumePeer::LVDEVICE);
  191.  
  192.         $criteria->addSelectColumn(EtvaLogicalvolumePeer::SIZE);
  193.  
  194.         $criteria->addSelectColumn(EtvaLogicalvolumePeer::FREESIZE);
  195.  
  196.         $criteria->addSelectColumn(EtvaLogicalvolumePeer::STORAGE_TYPE);
  197.  
  198.         $criteria->addSelectColumn(EtvaLogicalvolumePeer::WRITEABLE);
  199.  
  200.         $criteria->addSelectColumn(EtvaLogicalvolumePeer::IN_USE);
  201.  
  202.     }
  203.  
  204.     /**
  205.      * Returns the number of rows matching criteria.
  206.      *
  207.      * @param      Criteria $criteria 
  208.      * @param      boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
  209.      * @param      PropelPDO $con 
  210.      * @return     int Number of matching rows.
  211.      */
  212.     public static function doCount(Criteria $criteria$distinct falsePropelPDO $con null)
  213.     {
  214.         // we may modify criteria, so copy it first
  215.         $criteria clone $criteria;
  216.  
  217.         // We need to set the primary table name, since in the case that there are no WHERE columns
  218.         // it will be impossible for the BasePeer::createSelectSql() method to determine which
  219.         // tables go into the FROM clause.
  220.         $criteria->setPrimaryTableName(EtvaLogicalvolumePeer::TABLE_NAME);
  221.  
  222.         if ($distinct && !in_array(Criteria::DISTINCT$criteria->getSelectModifiers())) {
  223.             $criteria->setDistinct();
  224.         }
  225.  
  226.         if (!$criteria->hasSelectClause()) {
  227.             EtvaLogicalvolumePeer::addSelectColumns($criteria);
  228.         }
  229.  
  230.         $criteria->clearOrderByColumns()// ORDER BY won't ever affect the count
  231.         $criteria->setDbName(self::DATABASE_NAME)// Set the correct dbName
  232.  
  233.         if ($con === null{
  234.             $con Propel::getConnection(EtvaLogicalvolumePeer::DATABASE_NAMEPropel::CONNECTION_READ);
  235.         }
  236.  
  237.  
  238.     foreach (sfMixer::getCallables('BaseEtvaLogicalvolumePeer:doCount:doCount'as $callable)
  239.     {
  240.       call_user_func($callable'BaseEtvaLogicalvolumePeer'$criteria$con);
  241.     }
  242.  
  243.  
  244.         // BasePeer returns a PDOStatement
  245.         $stmt BasePeer::doCount($criteria$con);
  246.  
  247.         if ($row $stmt->fetch(PDO::FETCH_NUM)) {
  248.             $count = (int) $row[0];
  249.         else {
  250.             $count 0// no rows returned; we infer that means 0 matches.
  251.         }
  252.         $stmt->closeCursor();
  253.         return $count;
  254.     }
  255.     /**
  256.      * Method to select one object from the DB.
  257.      *
  258.      * @param      Criteria $criteria object used to create the SELECT statement.
  259.      * @param      PropelPDO $con 
  260.      * @return     EtvaLogicalvolume 
  261.      * @throws     PropelException Any exceptions caught during processing will be
  262.      *          rethrown wrapped into a PropelException.
  263.      */
  264.     public static function doSelectOne(Criteria $criteriaPropelPDO $con null)
  265.     {
  266.         $critcopy clone $criteria;
  267.         $critcopy->setLimit(1);
  268.         $objects EtvaLogicalvolumePeer::doSelect($critcopy$con);
  269.         if ($objects{
  270.             return $objects[0];
  271.         }
  272.         return null;
  273.     }
  274.     /**
  275.      * Method to do selects.
  276.      *
  277.      * @param      Criteria $criteria The Criteria object used to build the SELECT statement.
  278.      * @param      PropelPDO $con 
  279.      * @return     array Array of selected Objects
  280.      * @throws     PropelException Any exceptions caught during processing will be
  281.      *          rethrown wrapped into a PropelException.
  282.      */
  283.     public static function doSelect(Criteria $criteriaPropelPDO $con null)
  284.     {
  285.         return EtvaLogicalvolumePeer::populateObjects(EtvaLogicalvolumePeer::doSelectStmt($criteria$con));
  286.     }
  287.     /**
  288.      * Prepares the Criteria object and uses the parent doSelect() method to execute a PDOStatement.
  289.      *
  290.      * Use this method directly if you want to work with an executed statement durirectly (for example
  291.      * to perform your own object hydration).
  292.      *
  293.      * @param      Criteria $criteria The Criteria object used to build the SELECT statement.
  294.      * @param      PropelPDO $con The connection to use
  295.      * @throws     PropelException Any exceptions caught during processing will be
  296.      *          rethrown wrapped into a PropelException.
  297.      * @return     PDOStatement The executed PDOStatement object.
  298.      * @see        BasePeer::doSelect()
  299.      */
  300.     public static function doSelectStmt(Criteria $criteriaPropelPDO $con null)
  301.     {
  302.  
  303.     foreach (sfMixer::getCallables('BaseEtvaLogicalvolumePeer:doSelectStmt:doSelectStmt'as $callable)
  304.     {
  305.       call_user_func($callable'BaseEtvaLogicalvolumePeer'$criteria$con);
  306.     }
  307.  
  308.  
  309.         if ($con === null{
  310.             $con Propel::getConnection(EtvaLogicalvolumePeer::DATABASE_NAMEPropel::CONNECTION_READ);
  311.         }
  312.  
  313.         if (!$criteria->hasSelectClause()) {
  314.             $criteria clone $criteria;
  315.             EtvaLogicalvolumePeer::addSelectColumns($criteria);
  316.         }
  317.  
  318.         // Set the correct dbName
  319.         $criteria->setDbName(self::DATABASE_NAME);
  320.  
  321.         // BasePeer returns a PDOStatement
  322.         return BasePeer::doSelect($criteria$con);
  323.     }
  324.     /**
  325.      * Adds an object to the instance pool.
  326.      *
  327.      * Propel keeps cached copies of objects in an instance pool when they are retrieved
  328.      * from the database.  In some cases -- especially when you override doSelect*()
  329.      * methods in your stub classes -- you may need to explicitly add objects
  330.      * to the cache in order to ensure that the same objects are always returned by doSelect*()
  331.      * and retrieveByPK*() calls.
  332.      *
  333.      * @param      EtvaLogicalvolume $value A EtvaLogicalvolume object.
  334.      * @param      string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
  335.      */
  336.     public static function addInstanceToPool(EtvaLogicalvolume $obj$key null)
  337.     {
  338.         if (Propel::isInstancePoolingEnabled()) {
  339.             if ($key === null{
  340.                 $key = (string) $obj->getId();
  341.             // if key === null
  342.             self::$instances[$key$obj;
  343.         }
  344.     }
  345.  
  346.     /**
  347.      * Removes an object from the instance pool.
  348.      *
  349.      * Propel keeps cached copies of objects in an instance pool when they are retrieved
  350.      * from the database.  In some cases -- especially when you override doDelete
  351.      * methods in your stub classes -- you may need to explicitly remove objects
  352.      * from the cache in order to prevent returning objects that no longer exist.
  353.      *
  354.      * @param      mixed $value A EtvaLogicalvolume object or a primary key value.
  355.      */
  356.     public static function removeInstanceFromPool($value)
  357.     {
  358.         if (Propel::isInstancePoolingEnabled(&& $value !== null{
  359.             if (is_object($value&& $value instanceof EtvaLogicalvolume{
  360.                 $key = (string) $value->getId();
  361.             elseif (is_scalar($value)) {
  362.                 // assume we've been passed a primary key
  363.                 $key = (string) $value;
  364.             else {
  365.                 $e new PropelException("Invalid value passed to removeInstanceFromPool().  Expected primary key or EtvaLogicalvolume object; got " (is_object($valueget_class($value' object.' var_export($value,true)));
  366.                 throw $e;
  367.             }
  368.  
  369.             unset(self::$instances[$key]);
  370.         }
  371.     // removeInstanceFromPool()
  372.  
  373.     /**
  374.      * 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.
  375.      *
  376.      * For tables with a single-column primary key, that simple pkey value will be returned.  For tables with
  377.      * a multi-column primary key, a serialize()d version of the primary key will be returned.
  378.      *
  379.      * @param      string $key The key (@see getPrimaryKeyHash()) for this instance.
  380.      * @return     EtvaLogicalvolume Found object or NULL if 1) no instance exists for specified key or 2) instance pooling has been disabled.
  381.      * @see        getPrimaryKeyHash()
  382.      */
  383.     public static function getInstanceFromPool($key)
  384.     {
  385.         if (Propel::isInstancePoolingEnabled()) {
  386.             if (isset(self::$instances[$key])) {
  387.                 return self::$instances[$key];
  388.             }
  389.         }
  390.         return null// just to be explicit
  391.     }
  392.     
  393.     /**
  394.      * Clear the instance pool.
  395.      *
  396.      * @return     void 
  397.      */
  398.     public static function clearInstancePool()
  399.     {
  400.         self::$instances array();
  401.     }
  402.     
  403.     /**
  404.      * 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.
  405.      *
  406.      * For tables with a single-column primary key, that simple pkey value will be returned.  For tables with
  407.      * a multi-column primary key, a serialize()d version of the primary key will be returned.
  408.      *
  409.      * @param      array $row PropelPDO resultset row.
  410.      * @param      int $startcol The 0-based offset for reading from the resultset row.
  411.      * @return     string A string version of PK or NULL if the components of primary key in result array are all null.
  412.      */
  413.     public static function getPrimaryKeyHashFromRow($row$startcol 0)
  414.     {
  415.         // If the PK cannot be derived from the row, return NULL.
  416.         if ($row[$startcol 0=== null{
  417.             return null;
  418.         }
  419.         return (string) $row[$startcol 0];
  420.     }
  421.  
  422.     /**
  423.      * The returned array will contain objects of the default type or
  424.      * objects that inherit from the default.
  425.      *
  426.      * @throws     PropelException Any exceptions caught during processing will be
  427.      *          rethrown wrapped into a PropelException.
  428.      */
  429.     public static function populateObjects(PDOStatement $stmt)
  430.     {
  431.         $results array();
  432.     
  433.         // set the class once to avoid overhead in the loop
  434.         $cls EtvaLogicalvolumePeer::getOMClass();
  435.         $cls substr('.'.$clsstrrpos('.'.$cls'.'1);
  436.         // populate the object(s)
  437.         while ($row $stmt->fetch(PDO::FETCH_NUM)) {
  438.             $key EtvaLogicalvolumePeer::getPrimaryKeyHashFromRow($row0);
  439.             if (null !== ($obj EtvaLogicalvolumePeer::getInstanceFromPool($key))) {
  440.                 // We no longer rehydrate the object, since this can cause data loss.
  441.                 // See http://propel.phpdb.org/trac/ticket/509
  442.                 // $obj->hydrate($row, 0, true); // rehydrate
  443.                 $results[$obj;
  444.             else {
  445.         
  446.                 $obj new $cls();
  447.                 $obj->hydrate($row);
  448.                 $results[$obj;
  449.                 EtvaLogicalvolumePeer::addInstanceToPool($obj$key);
  450.             // if key exists
  451.         }
  452.         $stmt->closeCursor();
  453.         return $results;
  454.     }
  455.  
  456.     /**
  457.      * Returns the number of rows matching criteria, joining the related EtvaVolumegroup table
  458.      *
  459.      * @param      Criteria $c 
  460.      * @param      boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
  461.      * @param      PropelPDO $con 
  462.      * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
  463.      * @return     int Number of matching rows.
  464.      */
  465.     public static function doCountJoinEtvaVolumegroup(Criteria $criteria$distinct falsePropelPDO $con null$join_behavior Criteria::LEFT_JOIN)
  466.     {
  467.         // we're going to modify criteria, so copy it first
  468.         $criteria clone $criteria;
  469.  
  470.         // We need to set the primary table name, since in the case that there are no WHERE columns
  471.         // it will be impossible for the BasePeer::createSelectSql() method to determine which
  472.         // tables go into the FROM clause.
  473.         $criteria->setPrimaryTableName(EtvaLogicalvolumePeer::TABLE_NAME);
  474.  
  475.         if ($distinct && !in_array(Criteria::DISTINCT$criteria->getSelectModifiers())) {
  476.             $criteria->setDistinct();
  477.         }
  478.  
  479.         if (!$criteria->hasSelectClause()) {
  480.             EtvaLogicalvolumePeer::addSelectColumns($criteria);
  481.         }
  482.  
  483.         $criteria->clearOrderByColumns()// ORDER BY won't ever affect the count
  484.  
  485.         // Set the correct dbName
  486.         $criteria->setDbName(self::DATABASE_NAME);
  487.  
  488.         if ($con === null{
  489.             $con Propel::getConnection(EtvaLogicalvolumePeer::DATABASE_NAMEPropel::CONNECTION_READ);
  490.         }
  491.  
  492.         $criteria->addJoin(array(EtvaLogicalvolumePeer::VOLUMEGROUP_ID,)array(EtvaVolumegroupPeer::ID,)$join_behavior);
  493.  
  494.  
  495.     foreach (sfMixer::getCallables('BaseEtvaLogicalvolumePeer:doCount:doCount'as $callable)
  496.     {
  497.       call_user_func($callable'BaseEtvaLogicalvolumePeer'$criteria$con);
  498.     }
  499.  
  500.  
  501.         $stmt BasePeer::doCount($criteria$con);
  502.  
  503.         if ($row $stmt->fetch(PDO::FETCH_NUM)) {
  504.             $count = (int) $row[0];
  505.         else {
  506.             $count 0// no rows returned; we infer that means 0 matches.
  507.         }
  508.         $stmt->closeCursor();
  509.         return $count;
  510.     }
  511.  
  512.  
  513.     /**
  514.      * Returns the number of rows matching criteria, joining the related EtvaNode table
  515.      *
  516.      * @param      Criteria $c 
  517.      * @param      boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
  518.      * @param      PropelPDO $con 
  519.      * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
  520.      * @return     int Number of matching rows.
  521.      */
  522.     public static function doCountJoinEtvaNode(Criteria $criteria$distinct falsePropelPDO $con null$join_behavior Criteria::LEFT_JOIN)
  523.     {
  524.         // we're going to modify criteria, so copy it first
  525.         $criteria clone $criteria;
  526.  
  527.         // We need to set the primary table name, since in the case that there are no WHERE columns
  528.         // it will be impossible for the BasePeer::createSelectSql() method to determine which
  529.         // tables go into the FROM clause.
  530.         $criteria->setPrimaryTableName(EtvaLogicalvolumePeer::TABLE_NAME);
  531.  
  532.         if ($distinct && !in_array(Criteria::DISTINCT$criteria->getSelectModifiers())) {
  533.             $criteria->setDistinct();
  534.         }
  535.  
  536.         if (!$criteria->hasSelectClause()) {
  537.             EtvaLogicalvolumePeer::addSelectColumns($criteria);
  538.         }
  539.  
  540.         $criteria->clearOrderByColumns()// ORDER BY won't ever affect the count
  541.  
  542.         // Set the correct dbName
  543.         $criteria->setDbName(self::DATABASE_NAME);
  544.  
  545.         if ($con === null{
  546.             $con Propel::getConnection(EtvaLogicalvolumePeer::DATABASE_NAMEPropel::CONNECTION_READ);
  547.         }
  548.  
  549.         $criteria->addJoin(array(EtvaLogicalvolumePeer::NODE_ID,)array(EtvaNodePeer::ID,)$join_behavior);
  550.  
  551.  
  552.     foreach (sfMixer::getCallables('BaseEtvaLogicalvolumePeer:doCount:doCount'as $callable)
  553.     {
  554.       call_user_func($callable'BaseEtvaLogicalvolumePeer'$criteria$con);
  555.     }
  556.  
  557.  
  558.         $stmt BasePeer::doCount($criteria$con);
  559.  
  560.         if ($row $stmt->fetch(PDO::FETCH_NUM)) {
  561.             $count = (int) $row[0];
  562.         else {
  563.             $count 0// no rows returned; we infer that means 0 matches.
  564.         }
  565.         $stmt->closeCursor();
  566.         return $count;
  567.     }
  568.  
  569.  
  570.     /**
  571.      * Selects a collection of EtvaLogicalvolume objects pre-filled with their EtvaVolumegroup objects.
  572.      * @param      Criteria  $c 
  573.      * @param      PropelPDO $con 
  574.      * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
  575.      * @return     array Array of EtvaLogicalvolume objects.
  576.      * @throws     PropelException Any exceptions caught during processing will be
  577.      *          rethrown wrapped into a PropelException.
  578.      */
  579.     public static function doSelectJoinEtvaVolumegroup(Criteria $c$con null$join_behavior Criteria::LEFT_JOIN)
  580.     {
  581.  
  582.     foreach (sfMixer::getCallables('BaseEtvaLogicalvolumePeer:doSelectJoin:doSelectJoin'as $callable)
  583.     {
  584.       call_user_func($callable'BaseEtvaLogicalvolumePeer'$c$con);
  585.     }
  586.  
  587.  
  588.         $c clone $c;
  589.  
  590.         // Set the correct dbName if it has not been overridden
  591.         if ($c->getDbName(== Propel::getDefaultDB()) {
  592.             $c->setDbName(self::DATABASE_NAME);
  593.         }
  594.  
  595.         EtvaLogicalvolumePeer::addSelectColumns($c);
  596.         $startcol (EtvaLogicalvolumePeer::NUM_COLUMNS EtvaLogicalvolumePeer::NUM_LAZY_LOAD_COLUMNS);
  597.         EtvaVolumegroupPeer::addSelectColumns($c);
  598.  
  599.         $c->addJoin(array(EtvaLogicalvolumePeer::VOLUMEGROUP_ID,)array(EtvaVolumegroupPeer::ID,)$join_behavior);
  600.         $stmt BasePeer::doSelect($c$con);
  601.         $results array();
  602.  
  603.         while ($row $stmt->fetch(PDO::FETCH_NUM)) {
  604.             $key1 EtvaLogicalvolumePeer::getPrimaryKeyHashFromRow($row0);
  605.             if (null !== ($obj1 EtvaLogicalvolumePeer::getInstanceFromPool($key1))) {
  606.                 // We no longer rehydrate the object, since this can cause data loss.
  607.                 // See http://propel.phpdb.org/trac/ticket/509
  608.                 // $obj1->hydrate($row, 0, true); // rehydrate
  609.             else {
  610.  
  611.                 $omClass EtvaLogicalvolumePeer::getOMClass();
  612.  
  613.                 $cls substr('.'.$omClassstrrpos('.'.$omClass'.'1);
  614.                 $obj1 new $cls();
  615.                 $obj1->hydrate($row);
  616.                 EtvaLogicalvolumePeer::addInstanceToPool($obj1$key1);
  617.             // if $obj1 already loaded
  618.  
  619.             $key2 EtvaVolumegroupPeer::getPrimaryKeyHashFromRow($row$startcol);
  620.             if ($key2 !== null{
  621.                 $obj2 EtvaVolumegroupPeer::getInstanceFromPool($key2);
  622.                 if (!$obj2{
  623.  
  624.                     $omClass EtvaVolumegroupPeer::getOMClass();
  625.  
  626.                     $cls substr('.'.$omClassstrrpos('.'.$omClass'.'1);
  627.                     $obj2 new $cls();
  628.                     $obj2->hydrate($row$startcol);
  629.                     EtvaVolumegroupPeer::addInstanceToPool($obj2$key2);
  630.                 // if obj2 already loaded
  631.  
  632.                 // Add the $obj1 (EtvaLogicalvolume) to $obj2 (EtvaVolumegroup)
  633.                 $obj2->addEtvaLogicalvolume($obj1);
  634.  
  635.             // if joined row was not null
  636.  
  637.             $results[$obj1;
  638.         }
  639.         $stmt->closeCursor();
  640.         return $results;
  641.     }
  642.  
  643.  
  644.     /**
  645.      * Selects a collection of EtvaLogicalvolume objects pre-filled with their EtvaNode objects.
  646.      * @param      Criteria  $c 
  647.      * @param      PropelPDO $con 
  648.      * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
  649.      * @return     array Array of EtvaLogicalvolume objects.
  650.      * @throws     PropelException Any exceptions caught during processing will be
  651.      *          rethrown wrapped into a PropelException.
  652.      */
  653.     public static function doSelectJoinEtvaNode(Criteria $c$con null$join_behavior Criteria::LEFT_JOIN)
  654.     {
  655.         $c clone $c;
  656.  
  657.         // Set the correct dbName if it has not been overridden
  658.         if ($c->getDbName(== Propel::getDefaultDB()) {
  659.             $c->setDbName(self::DATABASE_NAME);
  660.         }
  661.  
  662.         EtvaLogicalvolumePeer::addSelectColumns($c);
  663.         $startcol (EtvaLogicalvolumePeer::NUM_COLUMNS EtvaLogicalvolumePeer::NUM_LAZY_LOAD_COLUMNS);
  664.         EtvaNodePeer::addSelectColumns($c);
  665.  
  666.         $c->addJoin(array(EtvaLogicalvolumePeer::NODE_ID,)array(EtvaNodePeer::ID,)$join_behavior);
  667.         $stmt BasePeer::doSelect($c$con);
  668.         $results array();
  669.  
  670.         while ($row $stmt->fetch(PDO::FETCH_NUM)) {
  671.             $key1 EtvaLogicalvolumePeer::getPrimaryKeyHashFromRow($row0);
  672.             if (null !== ($obj1 EtvaLogicalvolumePeer::getInstanceFromPool($key1))) {
  673.                 // We no longer rehydrate the object, since this can cause data loss.
  674.                 // See http://propel.phpdb.org/trac/ticket/509
  675.                 // $obj1->hydrate($row, 0, true); // rehydrate
  676.             else {
  677.  
  678.                 $omClass EtvaLogicalvolumePeer::getOMClass();
  679.  
  680.                 $cls substr('.'.$omClassstrrpos('.'.$omClass'.'1);
  681.                 $obj1 new $cls();
  682.                 $obj1->hydrate($row);
  683.                 EtvaLogicalvolumePeer::addInstanceToPool($obj1$key1);
  684.             // if $obj1 already loaded
  685.  
  686.             $key2 EtvaNodePeer::getPrimaryKeyHashFromRow($row$startcol);
  687.             if ($key2 !== null{
  688.                 $obj2 EtvaNodePeer::getInstanceFromPool($key2);
  689.                 if (!$obj2{
  690.  
  691.                     $omClass EtvaNodePeer::getOMClass();
  692.  
  693.                     $cls substr('.'.$omClassstrrpos('.'.$omClass'.'1);
  694.                     $obj2 new $cls();
  695.                     $obj2->hydrate($row$startcol);
  696.                     EtvaNodePeer::addInstanceToPool($obj2$key2);
  697.                 // if obj2 already loaded
  698.  
  699.                 // Add the $obj1 (EtvaLogicalvolume) to $obj2 (EtvaNode)
  700.                 $obj2->addEtvaLogicalvolume($obj1);
  701.  
  702.             // if joined row was not null
  703.  
  704.             $results[$obj1;
  705.         }
  706.         $stmt->closeCursor();
  707.         return $results;
  708.     }
  709.  
  710.  
  711.     /**
  712.      * Returns the number of rows matching criteria, joining all related tables
  713.      *
  714.      * @param      Criteria $c 
  715.      * @param      boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
  716.      * @param      PropelPDO $con 
  717.      * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
  718.      * @return     int Number of matching rows.
  719.      */
  720.     public static function doCountJoinAll(Criteria $criteria$distinct falsePropelPDO $con null$join_behavior Criteria::LEFT_JOIN)
  721.     {
  722.         // we're going to modify criteria, so copy it first
  723.         $criteria clone $criteria;
  724.  
  725.         // We need to set the primary table name, since in the case that there are no WHERE columns
  726.         // it will be impossible for the BasePeer::createSelectSql() method to determine which
  727.         // tables go into the FROM clause.
  728.         $criteria->setPrimaryTableName(EtvaLogicalvolumePeer::TABLE_NAME);
  729.  
  730.         if ($distinct && !in_array(Criteria::DISTINCT$criteria->getSelectModifiers())) {
  731.             $criteria->setDistinct();
  732.         }
  733.  
  734.         if (!$criteria->hasSelectClause()) {
  735.             EtvaLogicalvolumePeer::addSelectColumns($criteria);
  736.         }
  737.  
  738.         $criteria->clearOrderByColumns()// ORDER BY won't ever affect the count
  739.  
  740.         // Set the correct dbName
  741.         $criteria->setDbName(self::DATABASE_NAME);
  742.  
  743.         if ($con === null{
  744.             $con Propel::getConnection(EtvaLogicalvolumePeer::DATABASE_NAMEPropel::CONNECTION_READ);
  745.         }
  746.  
  747.         $criteria->addJoin(array(EtvaLogicalvolumePeer::VOLUMEGROUP_ID,)array(EtvaVolumegroupPeer::ID,)$join_behavior);
  748.         $criteria->addJoin(array(EtvaLogicalvolumePeer::NODE_ID,)array(EtvaNodePeer::ID,)$join_behavior);
  749.  
  750.     foreach (sfMixer::getCallables('BaseEtvaLogicalvolumePeer:doCount:doCount'as $callable)
  751.     {
  752.       call_user_func($callable'BaseEtvaLogicalvolumePeer'$criteria$con);
  753.     }
  754.  
  755.  
  756.         $stmt BasePeer::doCount($criteria$con);
  757.  
  758.         if ($row $stmt->fetch(PDO::FETCH_NUM)) {
  759.             $count = (int) $row[0];
  760.         else {
  761.             $count 0// no rows returned; we infer that means 0 matches.
  762.         }
  763.         $stmt->closeCursor();
  764.         return $count;
  765.     }
  766.  
  767.     /**
  768.      * Selects a collection of EtvaLogicalvolume objects pre-filled with all related objects.
  769.      *
  770.      * @param      Criteria  $c 
  771.      * @param      PropelPDO $con 
  772.      * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
  773.      * @return     array Array of EtvaLogicalvolume objects.
  774.      * @throws     PropelException Any exceptions caught during processing will be
  775.      *          rethrown wrapped into a PropelException.
  776.      */
  777.     public static function doSelectJoinAll(Criteria $c$con null$join_behavior Criteria::LEFT_JOIN)
  778.     {
  779.  
  780.     foreach (sfMixer::getCallables('BaseEtvaLogicalvolumePeer:doSelectJoinAll:doSelectJoinAll'as $callable)
  781.     {
  782.       call_user_func($callable'BaseEtvaLogicalvolumePeer'$c$con);
  783.     }
  784.  
  785.  
  786.         $c clone $c;
  787.  
  788.         // Set the correct dbName if it has not been overridden
  789.         if ($c->getDbName(== Propel::getDefaultDB()) {
  790.             $c->setDbName(self::DATABASE_NAME);
  791.         }
  792.  
  793.         EtvaLogicalvolumePeer::addSelectColumns($c);
  794.         $startcol2 (EtvaLogicalvolumePeer::NUM_COLUMNS EtvaLogicalvolumePeer::NUM_LAZY_LOAD_COLUMNS);
  795.  
  796.         EtvaVolumegroupPeer::addSelectColumns($c);
  797.         $startcol3 $startcol2 (EtvaVolumegroupPeer::NUM_COLUMNS EtvaVolumegroupPeer::NUM_LAZY_LOAD_COLUMNS);
  798.  
  799.         EtvaNodePeer::addSelectColumns($c);
  800.         $startcol4 $startcol3 (EtvaNodePeer::NUM_COLUMNS EtvaNodePeer::NUM_LAZY_LOAD_COLUMNS);
  801.  
  802.         $c->addJoin(array(EtvaLogicalvolumePeer::VOLUMEGROUP_ID,)array(EtvaVolumegroupPeer::ID,)$join_behavior);
  803.         $c->addJoin(array(EtvaLogicalvolumePeer::NODE_ID,)array(EtvaNodePeer::ID,)$join_behavior);
  804.         $stmt BasePeer::doSelect($c$con);
  805.         $results array();
  806.  
  807.         while ($row $stmt->fetch(PDO::FETCH_NUM)) {
  808.             $key1 EtvaLogicalvolumePeer::getPrimaryKeyHashFromRow($row0);
  809.             if (null !== ($obj1 EtvaLogicalvolumePeer::getInstanceFromPool($key1))) {
  810.                 // We no longer rehydrate the object, since this can cause data loss.
  811.                 // See http://propel.phpdb.org/trac/ticket/509
  812.                 // $obj1->hydrate($row, 0, true); // rehydrate
  813.             else {
  814.                 $omClass EtvaLogicalvolumePeer::getOMClass();
  815.  
  816.                 $cls substr('.'.$omClassstrrpos('.'.$omClass'.'1);
  817.                 $obj1 new $cls();
  818.                 $obj1->hydrate($row);
  819.                 EtvaLogicalvolumePeer::addInstanceToPool($obj1$key1);
  820.             // if obj1 already loaded
  821.  
  822.             // Add objects for joined EtvaVolumegroup rows
  823.  
  824.             $key2 EtvaVolumegroupPeer::getPrimaryKeyHashFromRow($row$startcol2);
  825.             if ($key2 !== null{
  826.                 $obj2 EtvaVolumegroupPeer::getInstanceFromPool($key2);
  827.                 if (!$obj2{
  828.  
  829.                     $omClass EtvaVolumegroupPeer::getOMClass();
  830.  
  831.  
  832.                     $cls substr('.'.$omClassstrrpos('.'.$omClass'.'1);
  833.                     $obj2 new $cls();
  834.                     $obj2->hydrate($row$startcol2);
  835.                     EtvaVolumegroupPeer::addInstanceToPool($obj2$key2);
  836.                 // if obj2 loaded
  837.  
  838.                 // Add the $obj1 (EtvaLogicalvolume) to the collection in $obj2 (EtvaVolumegroup)
  839.                 $obj2->addEtvaLogicalvolume($obj1);
  840.             // if joined row not null
  841.  
  842.             // Add objects for joined EtvaNode rows
  843.  
  844.             $key3 EtvaNodePeer::getPrimaryKeyHashFromRow($row$startcol3);
  845.             if ($key3 !== null{
  846.                 $obj3 EtvaNodePeer::getInstanceFromPool($key3);
  847.                 if (!$obj3{
  848.  
  849.                     $omClass EtvaNodePeer::getOMClass();
  850.  
  851.  
  852.                     $cls substr('.'.$omClassstrrpos('.'.$omClass'.'1);
  853.                     $obj3 new $cls();
  854.                     $obj3->hydrate($row$startcol3);
  855.                     EtvaNodePeer::addInstanceToPool($obj3$key3);
  856.                 // if obj3 loaded
  857.  
  858.                 // Add the $obj1 (EtvaLogicalvolume) to the collection in $obj3 (EtvaNode)
  859.                 $obj3->addEtvaLogicalvolume($obj1);
  860.             // if joined row not null
  861.  
  862.             $results[$obj1;
  863.         }
  864.         $stmt->closeCursor();
  865.         return $results;
  866.     }
  867.  
  868.  
  869.     /**
  870.      * Returns the number of rows matching criteria, joining the related EtvaVolumegroup table
  871.      *
  872.      * @param      Criteria $c 
  873.      * @param      boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
  874.      * @param      PropelPDO $con 
  875.      * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
  876.      * @return     int Number of matching rows.
  877.      */
  878.     public static function doCountJoinAllExceptEtvaVolumegroup(Criteria $criteria$distinct falsePropelPDO $con null$join_behavior Criteria::LEFT_JOIN)
  879.     {
  880.         // we're going to modify criteria, so copy it first
  881.         $criteria clone $criteria;
  882.  
  883.         if ($distinct && !in_array(Criteria::DISTINCT$criteria->getSelectModifiers())) {
  884.             $criteria->setDistinct();
  885.         }
  886.  
  887.         if (!$criteria->hasSelectClause()) {
  888.             EtvaLogicalvolumePeer::addSelectColumns($criteria);
  889.         }
  890.  
  891.         $criteria->clearOrderByColumns()// ORDER BY won't ever affect the count
  892.  
  893.         // Set the correct dbName
  894.         $criteria->setDbName(self::DATABASE_NAME);
  895.  
  896.         if ($con === null{
  897.             $con Propel::getConnection(EtvaLogicalvolumePeer::DATABASE_NAMEPropel::CONNECTION_READ);
  898.         }
  899.     
  900.                 $criteria->addJoin(array(EtvaLogicalvolumePeer::NODE_ID,)array(EtvaNodePeer::ID,)$join_behavior);
  901.  
  902.     foreach (sfMixer::getCallables('BaseEtvaLogicalvolumePeer:doCount:doCount'as $callable)
  903.     {
  904.       call_user_func($callable'BaseEtvaLogicalvolumePeer'$criteria$con);
  905.     }
  906.  
  907.  
  908.         $stmt BasePeer::doCount($criteria$con);
  909.  
  910.         if ($row $stmt->fetch(PDO::FETCH_NUM)) {
  911.             $count = (int) $row[0];
  912.         else {
  913.             $count 0// no rows returned; we infer that means 0 matches.
  914.         }
  915.         $stmt->closeCursor();
  916.         return $count;
  917.     }
  918.  
  919.  
  920.     /**
  921.      * Returns the number of rows matching criteria, joining the related EtvaNode table
  922.      *
  923.      * @param      Criteria $c 
  924.      * @param      boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
  925.      * @param      PropelPDO $con 
  926.      * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
  927.      * @return     int Number of matching rows.
  928.      */
  929.     public static function doCountJoinAllExceptEtvaNode(Criteria $criteria$distinct falsePropelPDO $con null$join_behavior Criteria::LEFT_JOIN)
  930.     {
  931.         // we're going to modify criteria, so copy it first
  932.         $criteria clone $criteria;
  933.  
  934.         if ($distinct && !in_array(Criteria::DISTINCT$criteria->getSelectModifiers())) {
  935.             $criteria->setDistinct();
  936.         }
  937.  
  938.         if (!$criteria->hasSelectClause()) {
  939.             EtvaLogicalvolumePeer::addSelectColumns($criteria);
  940.         }
  941.  
  942.         $criteria->clearOrderByColumns()// ORDER BY won't ever affect the count
  943.  
  944.         // Set the correct dbName
  945.         $criteria->setDbName(self::DATABASE_NAME);
  946.  
  947.         if ($con === null{
  948.             $con Propel::getConnection(EtvaLogicalvolumePeer::DATABASE_NAMEPropel::CONNECTION_READ);
  949.         }
  950.     
  951.                 $criteria->addJoin(array(EtvaLogicalvolumePeer::VOLUMEGROUP_ID,)array(EtvaVolumegroupPeer::ID,)$join_behavior);
  952.  
  953.     foreach (sfMixer::getCallables('BaseEtvaLogicalvolumePeer:doCount:doCount'as $callable)
  954.     {
  955.       call_user_func($callable'BaseEtvaLogicalvolumePeer'$criteria$con);
  956.     }
  957.  
  958.  
  959.         $stmt BasePeer::doCount($criteria$con);
  960.  
  961.         if ($row $stmt->fetch(PDO::FETCH_NUM)) {
  962.             $count = (int) $row[0];
  963.         else {
  964.             $count 0// no rows returned; we infer that means 0 matches.
  965.         }
  966.         $stmt->closeCursor();
  967.         return $count;
  968.     }
  969.  
  970.  
  971.     /**
  972.      * Selects a collection of EtvaLogicalvolume objects pre-filled with all related objects except EtvaVolumegroup.
  973.      *
  974.      * @param      Criteria  $c 
  975.      * @param      PropelPDO $con 
  976.      * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
  977.      * @return     array Array of EtvaLogicalvolume objects.
  978.      * @throws     PropelException Any exceptions caught during processing will be
  979.      *          rethrown wrapped into a PropelException.
  980.      */
  981.     public static function doSelectJoinAllExceptEtvaVolumegroup(Criteria $c$con null$join_behavior Criteria::LEFT_JOIN)
  982.     {
  983.  
  984.     foreach (sfMixer::getCallables('BaseEtvaLogicalvolumePeer:doSelectJoinAllExcept:doSelectJoinAllExcept'as $callable)
  985.     {
  986.       call_user_func($callable'BaseEtvaLogicalvolumePeer'$c$con);
  987.     }
  988.  
  989.  
  990.         $c clone $c;
  991.  
  992.         // Set the correct dbName if it has not been overridden
  993.         // $c->getDbName() will return the same object if not set to another value
  994.         // so == check is okay and faster
  995.         if ($c->getDbName(== Propel::getDefaultDB()) {
  996.             $c->setDbName(self::DATABASE_NAME);
  997.         }
  998.  
  999.         EtvaLogicalvolumePeer::addSelectColumns($c);
  1000.         $startcol2 (EtvaLogicalvolumePeer::NUM_COLUMNS EtvaLogicalvolumePeer::NUM_LAZY_LOAD_COLUMNS);
  1001.  
  1002.         EtvaNodePeer::addSelectColumns($c);
  1003.         $startcol3 $startcol2 (EtvaNodePeer::NUM_COLUMNS EtvaNodePeer::NUM_LAZY_LOAD_COLUMNS);
  1004.  
  1005.                 $c->addJoin(array(EtvaLogicalvolumePeer::NODE_ID,)array(EtvaNodePeer::ID,)$join_behavior);
  1006.  
  1007.         $stmt BasePeer::doSelect($c$con);
  1008.         $results array();
  1009.  
  1010.         while ($row $stmt->fetch(PDO::FETCH_NUM)) {
  1011.             $key1 EtvaLogicalvolumePeer::getPrimaryKeyHashFromRow($row0);
  1012.             if (null !== ($obj1 EtvaLogicalvolumePeer::getInstanceFromPool($key1))) {
  1013.                 // We no longer rehydrate the object, since this can cause data loss.
  1014.                 // See http://propel.phpdb.org/trac/ticket/509
  1015.                 // $obj1->hydrate($row, 0, true); // rehydrate
  1016.             else {
  1017.                 $omClass EtvaLogicalvolumePeer::getOMClass();
  1018.  
  1019.                 $cls substr('.'.$omClassstrrpos('.'.$omClass'.'1);
  1020.                 $obj1 new $cls();
  1021.                 $obj1->hydrate($row);
  1022.                 EtvaLogicalvolumePeer::addInstanceToPool($obj1$key1);
  1023.             // if obj1 already loaded
  1024.  
  1025.                 // Add objects for joined EtvaNode rows
  1026.  
  1027.                 $key2 EtvaNodePeer::getPrimaryKeyHashFromRow($row$startcol2);
  1028.                 if ($key2 !== null{
  1029.                     $obj2 EtvaNodePeer::getInstanceFromPool($key2);
  1030.                     if (!$obj2{
  1031.     
  1032.                         $omClass EtvaNodePeer::getOMClass();
  1033.  
  1034.  
  1035.                     $cls substr('.'.$omClassstrrpos('.'.$omClass'.'1);
  1036.                     $obj2 new $cls();
  1037.                     $obj2->hydrate($row$startcol2);
  1038.                     EtvaNodePeer::addInstanceToPool($obj2$key2);
  1039.                 // if $obj2 already loaded
  1040.  
  1041.                 // Add the $obj1 (EtvaLogicalvolume) to the collection in $obj2 (EtvaNode)
  1042.                 $obj2->addEtvaLogicalvolume($obj1);
  1043.  
  1044.             // if joined row is not null
  1045.  
  1046.             $results[$obj1;
  1047.         }
  1048.         $stmt->closeCursor();
  1049.         return $results;
  1050.     }
  1051.  
  1052.  
  1053.     /**
  1054.      * Selects a collection of EtvaLogicalvolume objects pre-filled with all related objects except EtvaNode.
  1055.      *
  1056.      * @param      Criteria  $c 
  1057.      * @param      PropelPDO $con 
  1058.      * @param      String    $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
  1059.      * @return     array Array of EtvaLogicalvolume objects.
  1060.      * @throws     PropelException Any exceptions caught during processing will be
  1061.      *          rethrown wrapped into a PropelException.
  1062.      */
  1063.     public static function doSelectJoinAllExceptEtvaNode(Criteria $c$con null$join_behavior Criteria::LEFT_JOIN)
  1064.     {
  1065.         $c clone $c;
  1066.  
  1067.         // Set the correct dbName if it has not been overridden
  1068.         // $c->getDbName() will return the same object if not set to another value
  1069.         // so == check is okay and faster
  1070.         if ($c->getDbName(== Propel::getDefaultDB()) {
  1071.             $c->setDbName(self::DATABASE_NAME);
  1072.         }
  1073.  
  1074.         EtvaLogicalvolumePeer::addSelectColumns($c);
  1075.         $startcol2 (EtvaLogicalvolumePeer::NUM_COLUMNS EtvaLogicalvolumePeer::NUM_LAZY_LOAD_COLUMNS);
  1076.  
  1077.         EtvaVolumegroupPeer::addSelectColumns($c);
  1078.         $startcol3 $startcol2 (EtvaVolumegroupPeer::NUM_COLUMNS EtvaVolumegroupPeer::NUM_LAZY_LOAD_COLUMNS);
  1079.  
  1080.                 $c->addJoin(array(EtvaLogicalvolumePeer::VOLUMEGROUP_ID,)array(EtvaVolumegroupPeer::ID,)$join_behavior);
  1081.  
  1082.         $stmt BasePeer::doSelect($c$con);
  1083.         $results array();
  1084.  
  1085.         while ($row $stmt->fetch(PDO::FETCH_NUM)) {
  1086.             $key1 EtvaLogicalvolumePeer::getPrimaryKeyHashFromRow($row0);
  1087.             if (null !== ($obj1 EtvaLogicalvolumePeer::getInstanceFromPool($key1))) {
  1088.                 // We no longer rehydrate the object, since this can cause data loss.
  1089.                 // See http://propel.phpdb.org/trac/ticket/509
  1090.                 // $obj1->hydrate($row, 0, true); // rehydrate
  1091.             else {
  1092.                 $omClass EtvaLogicalvolumePeer::getOMClass();
  1093.  
  1094.                 $cls substr('.'.$omClassstrrpos('.'.$omClass'.'1);
  1095.                 $obj1 new $cls();
  1096.                 $obj1->hydrate($row);
  1097.                 EtvaLogicalvolumePeer::addInstanceToPool($obj1$key1);
  1098.             // if obj1 already loaded
  1099.  
  1100.                 // Add objects for joined EtvaVolumegroup rows
  1101.  
  1102.                 $key2 EtvaVolumegroupPeer::getPrimaryKeyHashFromRow($row$startcol2);
  1103.                 if ($key2 !== null{
  1104.                     $obj2 EtvaVolumegroupPeer::getInstanceFromPool($key2);
  1105.                     if (!$obj2{
  1106.     
  1107.                         $omClass EtvaVolumegroupPeer::getOMClass();
  1108.  
  1109.  
  1110.                     $cls substr('.'.$omClassstrrpos('.'.$omClass'.'1);
  1111.                     $obj2 new $cls();
  1112.                     $obj2->hydrate($row$startcol2);
  1113.                     EtvaVolumegroupPeer::addInstanceToPool($obj2$key2);
  1114.                 // if $obj2 already loaded
  1115.  
  1116.                 // Add the $obj1 (EtvaLogicalvolume) to the collection in $obj2 (EtvaVolumegroup)
  1117.                 $obj2->addEtvaLogicalvolume($obj1);
  1118.  
  1119.             // if joined row is not null
  1120.  
  1121.             $results[$obj1;
  1122.         }
  1123.         $stmt->closeCursor();
  1124.         return $results;
  1125.     }
  1126.  
  1127.  
  1128.   static public function getUniqueColumnNames()
  1129.   {
  1130.     return array();
  1131.   }
  1132.     /**
  1133.      * Returns the TableMap related to this peer.
  1134.      * This method is not needed for general use but a specific application could have a need.
  1135.      * @return     TableMap 
  1136.      * @throws     PropelException Any exceptions caught during processing will be
  1137.      *          rethrown wrapped into a PropelException.
  1138.      */
  1139.     public static function getTableMap()
  1140.     {
  1141.         return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
  1142.     }
  1143.  
  1144.     /**
  1145.      * The class that the Peer will make instances of.
  1146.      *
  1147.      * This uses a dot-path notation which is tranalted into a path
  1148.      * relative to a location on the PHP include_path.
  1149.      * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
  1150.      *
  1151.      * @return     string path.to.ClassName
  1152.      */
  1153.     public static function getOMClass()
  1154.     {
  1155.         return EtvaLogicalvolumePeer::CLASS_DEFAULT;
  1156.     }
  1157.  
  1158.     /**
  1159.      * Method perform an INSERT on the database, given a EtvaLogicalvolume or Criteria object.
  1160.      *
  1161.      * @param      mixed $values Criteria or EtvaLogicalvolume object containing data that is used to create the INSERT statement.
  1162.      * @param      PropelPDO $con the PropelPDO connection to use
  1163.      * @return     mixed The new primary key.
  1164.      * @throws     PropelException Any exceptions caught during processing will be
  1165.      *          rethrown wrapped into a PropelException.
  1166.      */
  1167.     public static function doInsert($valuesPropelPDO $con null)
  1168.     {
  1169.  
  1170.     foreach (sfMixer::getCallables('BaseEtvaLogicalvolumePeer:doInsert:pre'as $callable)
  1171.     {
  1172.       $ret call_user_func($callable'BaseEtvaLogicalvolumePeer'$values$con);
  1173.       if (false !== $ret)
  1174.       {
  1175.         return $ret;
  1176.       }
  1177.     }
  1178.  
  1179.  
  1180.         if ($con === null{
  1181.             $con Propel::getConnection(EtvaLogicalvolumePeer::DATABASE_NAMEPropel::CONNECTION_WRITE);
  1182.         }
  1183.  
  1184.         if ($values instanceof Criteria{
  1185.             $criteria clone $values// rename for clarity
  1186.         else {
  1187.             $criteria $values->buildCriteria()// build Criteria from EtvaLogicalvolume object
  1188.         }
  1189.  
  1190.         if ($criteria->containsKey(EtvaLogicalvolumePeer::ID&& $criteria->keyContainsValue(EtvaLogicalvolumePeer::ID) ) {
  1191.             throw new PropelException('Cannot insert a value for auto-increment primary key ('.EtvaLogicalvolumePeer::ID.')');
  1192.         }
  1193.  
  1194.  
  1195.         // Set the correct dbName
  1196.         $criteria->setDbName(self::DATABASE_NAME);
  1197.  
  1198.         try {
  1199.             // use transaction because $criteria could contain info
  1200.             // for more than one table (I guess, conceivably)
  1201.             $con->beginTransaction();
  1202.             $pk BasePeer::doInsert($criteria$con);
  1203.             $con->commit();
  1204.         catch(PropelException $e{
  1205.             $con->rollBack();
  1206.             throw $e;
  1207.         }
  1208.  
  1209.         
  1210.     foreach (sfMixer::getCallables('BaseEtvaLogicalvolumePeer:doInsert:post'as $callable)
  1211.     {
  1212.       call_user_func($callable'BaseEtvaLogicalvolumePeer'$values$con$pk);
  1213.     }
  1214.  
  1215.     return $pk;
  1216.     }
  1217.  
  1218.     /**
  1219.      * Method perform an UPDATE on the database, given a EtvaLogicalvolume or Criteria object.
  1220.      *
  1221.      * @param      mixed $values Criteria or EtvaLogicalvolume object containing data that is used to create the UPDATE statement.
  1222.      * @param      PropelPDO $con The connection to use (specify PropelPDO connection object to exert more control over transactions).
  1223.      * @return     int The number of affected rows (if supported by underlying database driver).
  1224.      * @throws     PropelException Any exceptions caught during processing will be
  1225.      *          rethrown wrapped into a PropelException.
  1226.      */
  1227.     public static function doUpdate($valuesPropelPDO $con null)
  1228.     {
  1229.  
  1230.     foreach (sfMixer::getCallables('BaseEtvaLogicalvolumePeer:doUpdate:pre'as $callable)
  1231.     {
  1232.       $ret call_user_func($callable'BaseEtvaLogicalvolumePeer'$values$con);
  1233.       if (false !== $ret)
  1234.       {
  1235.         return $ret;
  1236.       }
  1237.     }
  1238.  
  1239.  
  1240.         if ($con === null{
  1241.             $con Propel::getConnection(EtvaLogicalvolumePeer::DATABASE_NAMEPropel::CONNECTION_WRITE);
  1242.         }
  1243.  
  1244.         $selectCriteria new Criteria(self::DATABASE_NAME);
  1245.  
  1246.         if ($values instanceof Criteria{
  1247.             $criteria clone $values// rename for clarity
  1248.  
  1249.             $comparison $criteria->getComparison(EtvaLogicalvolumePeer::ID);
  1250.             $selectCriteria->add(EtvaLogicalvolumePeer::ID$criteria->remove(EtvaLogicalvolumePeer::ID)$comparison);
  1251.  
  1252.         else // $values is EtvaLogicalvolume object
  1253.             $criteria $values->buildCriteria()// gets full criteria
  1254.             $selectCriteria $values->buildPkeyCriteria()// gets criteria w/ primary key(s)
  1255.         }
  1256.  
  1257.         // set the correct dbName
  1258.         $criteria->setDbName(self::DATABASE_NAME);
  1259.  
  1260.         $ret BasePeer::doUpdate($selectCriteria$criteria$con);
  1261.     
  1262.  
  1263.     foreach (sfMixer::getCallables('BaseEtvaLogicalvolumePeer:doUpdate:post'as $callable)
  1264.     {
  1265.       call_user_func($callable'BaseEtvaLogicalvolumePeer'$values$con$ret);
  1266.     }
  1267.  
  1268.     return $ret;
  1269.   }
  1270.  
  1271.     /**
  1272.      * Method to DELETE all rows from the logicalvolume table.
  1273.      *
  1274.      * @return     int The number of affected rows (if supported by underlying database driver).
  1275.      */
  1276.     public static function doDeleteAll($con null)
  1277.     {
  1278.         if ($con === null{
  1279.             $con Propel::getConnection(EtvaLogicalvolumePeer::DATABASE_NAMEPropel::CONNECTION_WRITE);
  1280.         }
  1281.         $affectedRows 0// initialize var to track total num of affected rows
  1282.         try {
  1283.             // use transaction because $criteria could contain info
  1284.             // for more than one table or we could emulating ON DELETE CASCADE, etc.
  1285.             $con->beginTransaction();
  1286.             $affectedRows += BasePeer::doDeleteAll(EtvaLogicalvolumePeer::TABLE_NAME$con);
  1287.             $con->commit();
  1288.             return $affectedRows;
  1289.         catch (PropelException $e{
  1290.             $con->rollBack();
  1291.             throw $e;
  1292.         }
  1293.     }
  1294.  
  1295.     /**
  1296.      * Method perform a DELETE on the database, given a EtvaLogicalvolume or Criteria object OR a primary key value.
  1297.      *
  1298.      * @param      mixed $values Criteria or EtvaLogicalvolume object or primary key or array of primary keys
  1299.      *               which is used to create the DELETE statement
  1300.      * @param      PropelPDO $con the connection to use
  1301.      * @return     int     The number of affected rows (if supported by underlying database driver).  This includes CASCADE-related rows
  1302.      *                 if supported by native driver or if emulated using Propel.
  1303.      * @throws     PropelException Any exceptions caught during processing will be
  1304.      *          rethrown wrapped into a PropelException.
  1305.      */
  1306.      public static function doDelete($valuesPropelPDO $con null)
  1307.      {
  1308.         if ($con === null{
  1309.             $con Propel::getConnection(EtvaLogicalvolumePeer::DATABASE_NAMEPropel::CONNECTION_WRITE);
  1310.         }
  1311.  
  1312.         if ($values instanceof Criteria{
  1313.             // invalidate the cache for all objects of this type, since we have no
  1314.             // way of knowing (without running a query) what objects should be invalidated
  1315.             // from the cache based on this Criteria.
  1316.             EtvaLogicalvolumePeer::clearInstancePool();
  1317.  
  1318.             // rename for clarity
  1319.             $criteria clone $values;
  1320.         elseif ($values instanceof EtvaLogicalvolume{
  1321.             // invalidate the cache for this single object
  1322.             EtvaLogicalvolumePeer::removeInstanceFromPool($values);
  1323.             // create criteria based on pk values
  1324.             $criteria $values->buildPkeyCriteria();
  1325.         else {
  1326.             // it must be the primary key
  1327.  
  1328.  
  1329.  
  1330.             $criteria new Criteria(self::DATABASE_NAME);
  1331.             $criteria->add(EtvaLogicalvolumePeer::ID(array) $valuesCriteria::IN);
  1332.  
  1333.             foreach ((array) $values as $singleval{
  1334.                 // we can invalidate the cache for this single object
  1335.                 EtvaLogicalvolumePeer::removeInstanceFromPool($singleval);
  1336.             }
  1337.         }
  1338.  
  1339.         // Set the correct dbName
  1340.         $criteria->setDbName(self::DATABASE_NAME);
  1341.  
  1342.         $affectedRows 0// initialize var to track total num of affected rows
  1343.  
  1344.         try {
  1345.             // use transaction because $criteria could contain info
  1346.             // for more than one table or we could emulating ON DELETE CASCADE, etc.
  1347.             $con->beginTransaction();
  1348.             
  1349.             $affectedRows += BasePeer::doDelete($criteria$con);
  1350.  
  1351.             $con->commit();
  1352.             return $affectedRows;
  1353.         catch (PropelException $e{
  1354.             $con->rollBack();
  1355.             throw $e;
  1356.         }
  1357.     }
  1358.  
  1359.     /**
  1360.      * Validates all modified columns of given EtvaLogicalvolume object.
  1361.      * If parameter $columns is either a single column name or an array of column names
  1362.      * than only those columns are validated.
  1363.      *
  1364.      * NOTICE: This does not apply to primary or foreign keys for now.
  1365.      *
  1366.      * @param      EtvaLogicalvolume $obj The object to validate.
  1367.      * @param      mixed $cols Column name or array of column names.
  1368.      *
  1369.      * @return     mixed TRUE if all columns are valid or the error message of the first invalid column.
  1370.      */
  1371.     public static function doValidate(EtvaLogicalvolume $obj$cols null)
  1372.     {
  1373.         $columns array();
  1374.  
  1375.         if ($cols{
  1376.             $dbMap Propel::getDatabaseMap(EtvaLogicalvolumePeer::DATABASE_NAME);
  1377.             $tableMap $dbMap->getTable(EtvaLogicalvolumePeer::TABLE_NAME);
  1378.  
  1379.             if (is_array($cols)) {
  1380.                 $cols array($cols);
  1381.             }
  1382.  
  1383.             foreach ($cols as $colName{
  1384.                 if ($tableMap->containsColumn($colName)) {
  1385.                     $get 'get' $tableMap->getColumn($colName)->getPhpName();
  1386.                     $columns[$colName$obj->$get();
  1387.                 }
  1388.             }
  1389.         else {
  1390.  
  1391.         }
  1392.  
  1393.         $res =  BasePeer::doValidate(EtvaLogicalvolumePeer::DATABASE_NAMEEtvaLogicalvolumePeer::TABLE_NAME$columns);
  1394.     if ($res !== true{
  1395.         $request sfContext::getInstance()->getRequest();
  1396.         foreach ($res as $failed{
  1397.             $col EtvaLogicalvolumePeer::translateFieldname($failed->getColumn()BasePeer::TYPE_COLNAMEBasePeer::TYPE_PHPNAME);
  1398.         }
  1399.     }
  1400.  
  1401.     return $res;
  1402.     }
  1403.  
  1404.     /**
  1405.      * Retrieve a single object by pkey.
  1406.      *
  1407.      * @param      int $pk the primary key.
  1408.      * @param      PropelPDO $con the connection to use
  1409.      * @return     EtvaLogicalvolume 
  1410.      */
  1411.     public static function retrieveByPK($pkPropelPDO $con null)
  1412.     {
  1413.  
  1414.         if (null !== ($obj EtvaLogicalvolumePeer::getInstanceFromPool((string) $pk))) {
  1415.             return $obj;
  1416.         }
  1417.  
  1418.         if ($con === null{
  1419.             $con Propel::getConnection(EtvaLogicalvolumePeer::DATABASE_NAMEPropel::CONNECTION_READ);
  1420.         }
  1421.  
  1422.         $criteria new Criteria(EtvaLogicalvolumePeer::DATABASE_NAME);
  1423.         $criteria->add(EtvaLogicalvolumePeer::ID$pk);
  1424.  
  1425.         $v EtvaLogicalvolumePeer::doSelect($criteria$con);
  1426.  
  1427.         return !empty($v$v[0null;
  1428.     }
  1429.  
  1430.     /**
  1431.      * Retrieve multiple objects by pkey.
  1432.      *
  1433.      * @param      array $pks List of primary keys
  1434.      * @param      PropelPDO $con the connection to use
  1435.      * @throws     PropelException Any exceptions caught during processing will be
  1436.      *          rethrown wrapped into a PropelException.
  1437.      */
  1438.     public static function retrieveByPKs($pksPropelPDO $con null)
  1439.     {
  1440.         if ($con === null{
  1441.             $con Propel::getConnection(EtvaLogicalvolumePeer::DATABASE_NAMEPropel::CONNECTION_READ);
  1442.         }
  1443.  
  1444.         $objs null;
  1445.         if (empty($pks)) {
  1446.             $objs array();
  1447.         else {
  1448.             $criteria new Criteria(EtvaLogicalvolumePeer::DATABASE_NAME);
  1449.             $criteria->add(EtvaLogicalvolumePeer::ID$pksCriteria::IN);
  1450.             $objs EtvaLogicalvolumePeer::doSelect($criteria$con);
  1451.         }
  1452.         return $objs;
  1453.     }
  1454.  
  1455. // BaseEtvaLogicalvolumePeer
  1456.  
  1457. // This is the static code needed to register the MapBuilder for this table with the main Propel class.
  1458. //
  1459. // NOTE: This static code cannot call methods on the EtvaLogicalvolumePeer class, because it is not defined yet.
  1460. // If you need to use overridden methods, you can add this code to the bottom of the EtvaLogicalvolumePeer class:
  1461. //
  1462. // Propel::getDatabaseMap(EtvaLogicalvolumePeer::DATABASE_NAME)->addTableBuilder(EtvaLogicalvolumePeer::TABLE_NAME, EtvaLogicalvolumePeer::getMapBuilder());
  1463. //
  1464. // Doing so will effectively overwrite the registration below.
  1465.  
  1466. Propel::getDatabaseMap(BaseEtvaLogicalvolumePeer::DATABASE_NAME)->addTableBuilder(BaseEtvaLogicalvolumePeer::TABLE_NAMEBaseEtvaLogicalvolumePeer::getMapBuilder());

Documentation generated on Fri, 19 Jun 2009 10:46:34 +0100 by phpDocumentor 1.4.2