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

Source for file BaseEtvaMac.php

Documentation is available at BaseEtvaMac.php

  1. <?php
  2.  
  3. /**
  4.  * Base class that represents a row from the 'mac' 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 BaseEtvaMac extends BaseObject  implements Persistent {
  15.  
  16.  
  17.   const PEER = 'EtvaMacPeer';
  18.  
  19.     /**
  20.      * The Peer class.
  21.      * Instance provides a convenient way of calling static methods on a class
  22.      * that calling code may not be able to identify.
  23.      * @var        EtvaMacPeer 
  24.      */
  25.     protected static $peer;
  26.  
  27.     /**
  28.      * The value for the id field.
  29.      * @var        int 
  30.      */
  31.     protected $id;
  32.  
  33.     /**
  34.      * The value for the mac field.
  35.      * @var        string 
  36.      */
  37.     protected $mac;
  38.  
  39.     /**
  40.      * The value for the in_use field.
  41.      * Note: this column has a database default value of: 0
  42.      * @var        int 
  43.      */
  44.     protected $in_use;
  45.  
  46.     /**
  47.      * Flag to prevent endless save loop, if this object is referenced
  48.      * by another object which falls in this transaction.
  49.      * @var        boolean 
  50.      */
  51.     protected $alreadyInSave = false;
  52.  
  53.     /**
  54.      * Flag to prevent endless validation loop, if this object is referenced
  55.      * by another object which falls in this transaction.
  56.      * @var        boolean 
  57.      */
  58.     protected $alreadyInValidation = false;
  59.  
  60.     /**
  61.      * Initializes internal state of BaseEtvaMac object.
  62.      * @see        applyDefaults()
  63.      */
  64.     public function __construct()
  65.     {
  66.         parent::__construct();
  67.         $this->applyDefaultValues();
  68.     }
  69.  
  70.     /**
  71.      * Applies default values to this object.
  72.      * This method should be called from the object's constructor (or
  73.      * equivalent initialization method).
  74.      * @see        __construct()
  75.      */
  76.     public function applyDefaultValues()
  77.     {
  78.         $this->in_use = 0;
  79.     }
  80.  
  81.     /**
  82.      * Get the [id] column value.
  83.      * 
  84.      * @return     int 
  85.      */
  86.     public function getId()
  87.     {
  88.         return $this->id;
  89.     }
  90.  
  91.     /**
  92.      * Get the [mac] column value.
  93.      * 
  94.      * @return     string 
  95.      */
  96.     public function getMac()
  97.     {
  98.         return $this->mac;
  99.     }
  100.  
  101.     /**
  102.      * Get the [in_use] column value.
  103.      * 
  104.      * @return     int 
  105.      */
  106.     public function getInUse()
  107.     {
  108.         return $this->in_use;
  109.     }
  110.  
  111.     /**
  112.      * Set the value of [id] column.
  113.      * 
  114.      * @param      int $v new value
  115.      * @return     EtvaMac The current object (for fluent API support)
  116.      */
  117.     public function setId($v)
  118.     {
  119.         if ($v !== null{
  120.             $v = (int) $v;
  121.         }
  122.  
  123.         if ($this->id !== $v{
  124.             $this->id = $v;
  125.             $this->modifiedColumns[EtvaMacPeer::ID;
  126.         }
  127.  
  128.         return $this;
  129.     // setId()
  130.  
  131.     /**
  132.      * Set the value of [mac] column.
  133.      * 
  134.      * @param      string $v new value
  135.      * @return     EtvaMac The current object (for fluent API support)
  136.      */
  137.     public function setMac($v)
  138.     {
  139.         if ($v !== null{
  140.             $v = (string) $v;
  141.         }
  142.  
  143.         if ($this->mac !== $v{
  144.             $this->mac = $v;
  145.             $this->modifiedColumns[EtvaMacPeer::MAC;
  146.         }
  147.  
  148.         return $this;
  149.     // setMac()
  150.  
  151.     /**
  152.      * Set the value of [in_use] column.
  153.      * 
  154.      * @param      int $v new value
  155.      * @return     EtvaMac The current object (for fluent API support)
  156.      */
  157.     public function setInUse($v)
  158.     {
  159.         if ($v !== null{
  160.             $v = (int) $v;
  161.         }
  162.  
  163.         if ($this->in_use !== $v || $v === 0{
  164.             $this->in_use = $v;
  165.             $this->modifiedColumns[EtvaMacPeer::IN_USE;
  166.         }
  167.  
  168.         return $this;
  169.     // setInUse()
  170.  
  171.     /**
  172.      * Indicates whether the columns in this object are only set to default values.
  173.      *
  174.      * This method can be used in conjunction with isModified() to indicate whether an object is both
  175.      * modified _and_ has some values set which are non-default.
  176.      *
  177.      * @return     boolean Whether the columns in this object are only been set with default values.
  178.      */
  179.     public function hasOnlyDefaultValues()
  180.     {
  181.             // First, ensure that we don't have any columns that have been modified which aren't default columns.
  182.             if (array_diff($this->modifiedColumnsarray(EtvaMacPeer::IN_USE))) {
  183.                 return false;
  184.             }
  185.  
  186.             if ($this->in_use !== 0{
  187.                 return false;
  188.             }
  189.  
  190.         // otherwise, everything was equal, so return TRUE
  191.         return true;
  192.     // hasOnlyDefaultValues()
  193.  
  194.     /**
  195.      * Hydrates (populates) the object variables with values from the database resultset.
  196.      *
  197.      * An offset (0-based "start column") is specified so that objects can be hydrated
  198.      * with a subset of the columns in the resultset rows.  This is needed, for example,
  199.      * for results of JOIN queries where the resultset row includes columns from two or
  200.      * more tables.
  201.      *
  202.      * @param      array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM)
  203.      * @param      int $startcol 0-based offset column which indicates which restultset column to start with.
  204.      * @param      boolean $rehydrate Whether this object is being re-hydrated from the database.
  205.      * @return     int next starting column
  206.      * @throws     PropelException  - Any caught Exception will be rewrapped as a PropelException.
  207.      */
  208.     public function hydrate($row$startcol 0$rehydrate false)
  209.     {
  210.         try {
  211.  
  212.             $this->id = ($row[$startcol 0!== null? (int) $row[$startcol 0null;
  213.             $this->mac = ($row[$startcol 1!== null? (string) $row[$startcol 1null;
  214.             $this->in_use = ($row[$startcol 2!== null? (int) $row[$startcol 2null;
  215.             $this->resetModified();
  216.  
  217.             $this->setNew(false);
  218.  
  219.             if ($rehydrate{
  220.                 $this->ensureConsistency();
  221.             }
  222.  
  223.             // FIXME - using NUM_COLUMNS may be clearer.
  224.             return $startcol 3// 3 = EtvaMacPeer::NUM_COLUMNS - EtvaMacPeer::NUM_LAZY_LOAD_COLUMNS).
  225.  
  226.         catch (Exception $e{
  227.             throw new PropelException("Error populating EtvaMac object"$e);
  228.         }
  229.     }
  230.  
  231.     /**
  232.      * Checks and repairs the internal consistency of the object.
  233.      *
  234.      * This method is executed after an already-instantiated object is re-hydrated
  235.      * from the database.  It exists to check any foreign keys to make sure that
  236.      * the objects related to the current object are correct based on foreign key.
  237.      *
  238.      * You can override this method in the stub class, but you should always invoke
  239.      * the base method from the overridden method (i.e. parent::ensureConsistency()),
  240.      * in case your model changes.
  241.      *
  242.      * @throws     PropelException
  243.      */
  244.     public function ensureConsistency()
  245.     {
  246.  
  247.     // ensureConsistency
  248.  
  249.     /**
  250.      * Reloads this object from datastore based on primary key and (optionally) resets all associated objects.
  251.      *
  252.      * This will only work if the object has been saved and has a valid primary key set.
  253.      *
  254.      * @param      boolean $deep (optional) Whether to also de-associated any related objects.
  255.      * @param      PropelPDO $con (optional) The PropelPDO connection to use.
  256.      * @return     void 
  257.      * @throws     PropelException - if this object is deleted, unsaved or doesn't have pk match in db
  258.      */
  259.     public function reload($deep falsePropelPDO $con null)
  260.     {
  261.         if ($this->isDeleted()) {
  262.             throw new PropelException("Cannot reload a deleted object.");
  263.         }
  264.  
  265.         if ($this->isNew()) {
  266.             throw new PropelException("Cannot reload an unsaved object.");
  267.         }
  268.  
  269.         if ($con === null{
  270.             $con Propel::getConnection(EtvaMacPeer::DATABASE_NAMEPropel::CONNECTION_READ);
  271.         }
  272.  
  273.         // We don't need to alter the object instance pool; we're just modifying this instance
  274.         // already in the pool.
  275.  
  276.         $stmt EtvaMacPeer::doSelectStmt($this->buildPkeyCriteria()$con);
  277.         $row $stmt->fetch(PDO::FETCH_NUM);
  278.         $stmt->closeCursor();
  279.         if (!$row{
  280.             throw new PropelException('Cannot find matching row in the database to reload object values.');
  281.         }
  282.         $this->hydrate($row0true)// rehydrate
  283.  
  284.         if ($deep{  // also de-associate any related objects?
  285.  
  286.         // if (deep)
  287.     }
  288.  
  289.     /**
  290.      * Removes this object from datastore and sets delete attribute.
  291.      *
  292.      * @param      PropelPDO $con 
  293.      * @return     void 
  294.      * @throws     PropelException
  295.      * @see        BaseObject::setDeleted()
  296.      * @see        BaseObject::isDeleted()
  297.      */
  298.     public function delete(PropelPDO $con null)
  299.     {
  300.  
  301.     foreach (sfMixer::getCallables('BaseEtvaMac:delete:pre'as $callable)
  302.     {
  303.       $ret call_user_func($callable$this$con);
  304.       if ($ret)
  305.       {
  306.         return;
  307.       }
  308.     }
  309.  
  310.  
  311.         if ($this->isDeleted()) {
  312.             throw new PropelException("This object has already been deleted.");
  313.         }
  314.  
  315.         if ($con === null{
  316.             $con Propel::getConnection(EtvaMacPeer::DATABASE_NAMEPropel::CONNECTION_WRITE);
  317.         }
  318.         
  319.         $con->beginTransaction();
  320.         try {
  321.             EtvaMacPeer::doDelete($this$con);
  322.             $this->setDeleted(true);
  323.             $con->commit();
  324.         catch (PropelException $e{
  325.             $con->rollBack();
  326.             throw $e;
  327.         }
  328.     
  329.  
  330.     foreach (sfMixer::getCallables('BaseEtvaMac:delete:post'as $callable)
  331.     {
  332.       call_user_func($callable$this$con);
  333.     }
  334.  
  335.   }
  336.     /**
  337.      * Persists this object to the database.
  338.      *
  339.      * If the object is new, it inserts it; otherwise an update is performed.
  340.      * All modified related objects will also be persisted in the doSave()
  341.      * method.  This method wraps all precipitate database operations in a
  342.      * single transaction.
  343.      *
  344.      * @param      PropelPDO $con 
  345.      * @return     int The number of rows affected by this insert/update and any referring fk objects' save() operations.
  346.      * @throws     PropelException
  347.      * @see        doSave()
  348.      */
  349.     public function save(PropelPDO $con null)
  350.     {
  351.  
  352.     foreach (sfMixer::getCallables('BaseEtvaMac:save:pre'as $callable)
  353.     {
  354.       $affectedRows call_user_func($callable$this$con);
  355.       if (is_int($affectedRows))
  356.       {
  357.         return $affectedRows;
  358.       }
  359.     }
  360.  
  361.  
  362.         if ($this->isDeleted()) {
  363.             throw new PropelException("You cannot save an object that has been deleted.");
  364.         }
  365.  
  366.         if ($con === null{
  367.             $con Propel::getConnection(EtvaMacPeer::DATABASE_NAMEPropel::CONNECTION_WRITE);
  368.         }
  369.         
  370.         $con->beginTransaction();
  371.         try {
  372.             $affectedRows $this->doSave($con);
  373.             $con->commit();
  374.     foreach (sfMixer::getCallables('BaseEtvaMac:save:post'as $callable)
  375.     {
  376.       call_user_func($callable$this$con$affectedRows);
  377.     }
  378.  
  379.             EtvaMacPeer::addInstanceToPool($this);
  380.             return $affectedRows;
  381.         catch (PropelException $e{
  382.             $con->rollBack();
  383.             throw $e;
  384.         }
  385.     }
  386.  
  387.     /**
  388.      * Performs the work of inserting or updating the row in the database.
  389.      *
  390.      * If the object is new, it inserts it; otherwise an update is performed.
  391.      * All related objects are also updated in this method.
  392.      *
  393.      * @param      PropelPDO $con 
  394.      * @return     int The number of rows affected by this insert/update and any referring fk objects' save() operations.
  395.      * @throws     PropelException
  396.      * @see        save()
  397.      */
  398.     protected function doSave(PropelPDO $con)
  399.     {
  400.         $affectedRows 0// initialize var to track total num of affected rows
  401.         if (!$this->alreadyInSave{
  402.             $this->alreadyInSave = true;
  403.  
  404.             if ($this->isNew() ) {
  405.                 $this->modifiedColumns[EtvaMacPeer::ID;
  406.             }
  407.  
  408.             // If this object has been modified, then save it to the database.
  409.             if ($this->isModified()) {
  410.                 if ($this->isNew()) {
  411.                     $pk EtvaMacPeer::doInsert($this$con);
  412.                     $affectedRows += 1// we are assuming that there is only 1 row per doInsert() which
  413.                                          // should always be true here (even though technically
  414.                                          // BasePeer::doInsert() can insert multiple rows).
  415.  
  416.                     $this->setId($pk);  //[IMV] update autoincrement primary key
  417.  
  418.                     $this->setNew(false);
  419.                 else {
  420.                     $affectedRows += EtvaMacPeer::doUpdate($this$con);
  421.                 }
  422.  
  423.                 $this->resetModified()// [HL] After being saved an object is no longer 'modified'
  424.             }
  425.  
  426.             $this->alreadyInSave = false;
  427.  
  428.         }
  429.         return $affectedRows;
  430.     // doSave()
  431.  
  432.     /**
  433.      * Array of ValidationFailed objects.
  434.      * @var        array ValidationFailed[]
  435.      */
  436.     protected $validationFailures = array();
  437.  
  438.     /**
  439.      * Gets any ValidationFailed objects that resulted from last call to validate().
  440.      *
  441.      *
  442.      * @return     array ValidationFailed[]
  443.      * @see        validate()
  444.      */
  445.     public function getValidationFailures()
  446.     {
  447.         return $this->validationFailures;
  448.     }
  449.  
  450.     /**
  451.      * Validates the objects modified field values and all objects related to this table.
  452.      *
  453.      * If $columns is either a column name or an array of column names
  454.      * only those columns are validated.
  455.      *
  456.      * @param      mixed $columns Column name or an array of column names.
  457.      * @return     boolean Whether all columns pass validation.
  458.      * @see        doValidate()
  459.      * @see        getValidationFailures()
  460.      */
  461.     public function validate($columns null)
  462.     {
  463.         $res $this->doValidate($columns);
  464.         if ($res === true{
  465.             $this->validationFailures = array();
  466.             return true;
  467.         else {
  468.             $this->validationFailures = $res;
  469.             return false;
  470.         }
  471.     }
  472.  
  473.     /**
  474.      * This function performs the validation work for complex object models.
  475.      *
  476.      * In addition to checking the current object, all related objects will
  477.      * also be validated.  If all pass then <code>true</code> is returned; otherwise
  478.      * an aggreagated array of ValidationFailed objects will be returned.
  479.      *
  480.      * @param      array $columns Array of column names to validate.
  481.      * @return     mixed <code>true</code> if all validations pass; array of <code>ValidationFailed</code> objets otherwise.
  482.      */
  483.     protected function doValidate($columns null)
  484.     {
  485.         if (!$this->alreadyInValidation{
  486.             $this->alreadyInValidation = true;
  487.             $retval null;
  488.  
  489.             $failureMap array();
  490.  
  491.  
  492.             if (($retval EtvaMacPeer::doValidate($this$columns)) !== true{
  493.                 $failureMap array_merge($failureMap$retval);
  494.             }
  495.  
  496.  
  497.  
  498.             $this->alreadyInValidation = false;
  499.         }
  500.  
  501.         return (!empty($failureMap$failureMap true);
  502.     }
  503.  
  504.     /**
  505.      * Retrieves a field from the object by name passed in as a string.
  506.      *
  507.      * @param      string $name name
  508.      * @param      string $type The type of fieldname the $name is of:
  509.      *                      one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
  510.      *                      BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
  511.      * @return     mixed Value of field.
  512.      */
  513.     public function getByName($name$type BasePeer::TYPE_PHPNAME)
  514.     {
  515.         $pos EtvaMacPeer::translateFieldName($name$typeBasePeer::TYPE_NUM);
  516.         $field $this->getByPosition($pos);
  517.         return $field;
  518.     }
  519.  
  520.     /**
  521.      * Retrieves a field from the object by Position as specified in the xml schema.
  522.      * Zero-based.
  523.      *
  524.      * @param      int $pos position in xml schema
  525.      * @return     mixed Value of field at $pos
  526.      */
  527.     public function getByPosition($pos)
  528.     {
  529.         switch($pos{
  530.             case 0:
  531.                 return $this->getId();
  532.                 break;
  533.             case 1:
  534.                 return $this->getMac();
  535.                 break;
  536.             case 2:
  537.                 return $this->getInUse();
  538.                 break;
  539.             default:
  540.                 return null;
  541.                 break;
  542.         // switch()
  543.     }
  544.  
  545.     /**
  546.      * Exports the object as an array.
  547.      *
  548.      * You can specify the key type of the array by passing one of the class
  549.      * type constants.
  550.      *
  551.      * @param      string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
  552.      *                         BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. Defaults to BasePeer::TYPE_PHPNAME.
  553.      * @param      boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns.  Defaults to TRUE.
  554.      * @return     an associative array containing the field names (as keys) and field values
  555.      */
  556.     public function toArray($keyType BasePeer::TYPE_PHPNAME$includeLazyLoadColumns true)
  557.     {
  558.         $keys EtvaMacPeer::getFieldNames($keyType);
  559.         $result array(
  560.             $keys[0=> $this->getId(),
  561.             $keys[1=> $this->getMac(),
  562.             $keys[2=> $this->getInUse(),
  563.         );
  564.         return $result;
  565.     }
  566.  
  567.     /**
  568.      * Sets a field from the object by name passed in as a string.
  569.      *
  570.      * @param      string $name peer name
  571.      * @param      mixed $value field value
  572.      * @param      string $type The type of fieldname the $name is of:
  573.      *                      one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
  574.      *                      BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
  575.      * @return     void 
  576.      */
  577.     public function setByName($name$value$type BasePeer::TYPE_PHPNAME)
  578.     {
  579.         $pos EtvaMacPeer::translateFieldName($name$typeBasePeer::TYPE_NUM);
  580.         return $this->setByPosition($pos$value);
  581.     }
  582.  
  583.     /**
  584.      * Sets a field from the object by Position as specified in the xml schema.
  585.      * Zero-based.
  586.      *
  587.      * @param      int $pos position in xml schema
  588.      * @param      mixed $value field value
  589.      * @return     void 
  590.      */
  591.     public function setByPosition($pos$value)
  592.     {
  593.         switch($pos{
  594.             case 0:
  595.                 $this->setId($value);
  596.                 break;
  597.             case 1:
  598.                 $this->setMac($value);
  599.                 break;
  600.             case 2:
  601.                 $this->setInUse($value);
  602.                 break;
  603.         // switch()
  604.     }
  605.  
  606.     /**
  607.      * Populates the object using an array.
  608.      *
  609.      * This is particularly useful when populating an object from one of the
  610.      * request arrays (e.g. $_POST).  This method goes through the column
  611.      * names, checking to see whether a matching key exists in populated
  612.      * array. If so the setByName() method is called for that column.
  613.      *
  614.      * You can specify the key type of the array by additionally passing one
  615.      * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME,
  616.      * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
  617.      * The default key type is the column's phpname (e.g. 'AuthorId')
  618.      *
  619.      * @param      array  $arr     An array to populate the object from.
  620.      * @param      string $keyType The type of keys the array uses.
  621.      * @return     void 
  622.      */
  623.     public function fromArray($arr$keyType BasePeer::TYPE_PHPNAME)
  624.     {
  625.         $keys EtvaMacPeer::getFieldNames($keyType);
  626.  
  627.         if (array_key_exists($keys[0]$arr)) $this->setId($arr[$keys[0]]);
  628.         if (array_key_exists($keys[1]$arr)) $this->setMac($arr[$keys[1]]);
  629.         if (array_key_exists($keys[2]$arr)) $this->setInUse($arr[$keys[2]]);
  630.     }
  631.  
  632.     /**
  633.      * Build a Criteria object containing the values of all modified columns in this object.
  634.      *
  635.      * @return     Criteria The Criteria object containing all modified values.
  636.      */
  637.     public function buildCriteria()
  638.     {
  639.         $criteria new Criteria(EtvaMacPeer::DATABASE_NAME);
  640.  
  641.         if ($this->isColumnModified(EtvaMacPeer::ID)) $criteria->add(EtvaMacPeer::ID$this->id);
  642.         if ($this->isColumnModified(EtvaMacPeer::MAC)) $criteria->add(EtvaMacPeer::MAC$this->mac);
  643.         if ($this->isColumnModified(EtvaMacPeer::IN_USE)) $criteria->add(EtvaMacPeer::IN_USE$this->in_use);
  644.  
  645.         return $criteria;
  646.     }
  647.  
  648.     /**
  649.      * Builds a Criteria object containing the primary key for this object.
  650.      *
  651.      * Unlike buildCriteria() this method includes the primary key values regardless
  652.      * of whether or not they have been modified.
  653.      *
  654.      * @return     Criteria The Criteria object containing value(s) for primary key(s).
  655.      */
  656.     public function buildPkeyCriteria()
  657.     {
  658.         $criteria new Criteria(EtvaMacPeer::DATABASE_NAME);
  659.  
  660.         $criteria->add(EtvaMacPeer::ID$this->id);
  661.  
  662.         return $criteria;
  663.     }
  664.  
  665.     /**
  666.      * Returns the primary key for this object (row).
  667.      * @return     int 
  668.      */
  669.     public function getPrimaryKey()
  670.     {
  671.         return $this->getId();
  672.     }
  673.  
  674.     /**
  675.      * Generic method to set the primary key (id column).
  676.      *
  677.      * @param      int $key Primary key.
  678.      * @return     void 
  679.      */
  680.     public function setPrimaryKey($key)
  681.     {
  682.         $this->setId($key);
  683.     }
  684.  
  685.     /**
  686.      * Sets contents of passed object to values from current object.
  687.      *
  688.      * If desired, this method can also make copies of all associated (fkey referrers)
  689.      * objects.
  690.      *
  691.      * @param      object $copyObj An object of EtvaMac (or compatible) type.
  692.      * @param      boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
  693.      * @throws     PropelException
  694.      */
  695.     public function copyInto($copyObj$deepCopy false)
  696.     {
  697.  
  698.         $copyObj->setMac($this->mac);
  699.  
  700.         $copyObj->setInUse($this->in_use);
  701.  
  702.  
  703.         $copyObj->setNew(true);
  704.  
  705.         $copyObj->setId(NULL)// this is a auto-increment column, so set to default value
  706.  
  707.     }
  708.  
  709.     /**
  710.      * Makes a copy of this object that will be inserted as a new row in table when saved.
  711.      * It creates a new object filling in the simple attributes, but skipping any primary
  712.      * keys that are defined for the table.
  713.      *
  714.      * If desired, this method can also make copies of all associated (fkey referrers)
  715.      * objects.
  716.      *
  717.      * @param      boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
  718.      * @return     EtvaMac Clone of current object.
  719.      * @throws     PropelException
  720.      */
  721.     public function copy($deepCopy false)
  722.     {
  723.         // we use get_class(), because this might be a subclass
  724.         $clazz get_class($this);
  725.         $copyObj new $clazz();
  726.         $this->copyInto($copyObj$deepCopy);
  727.         return $copyObj;
  728.     }
  729.  
  730.     /**
  731.      * Returns a peer instance associated with this om.
  732.      *
  733.      * Since Peer classes are not to have any instance attributes, this method returns the
  734.      * same instance for all member of this class. The method could therefore
  735.      * be static, but this would prevent one from overriding the behavior.
  736.      *
  737.      * @return     EtvaMacPeer 
  738.      */
  739.     public function getPeer()
  740.     {
  741.         if (self::$peer === null{
  742.             self::$peer new EtvaMacPeer();
  743.         }
  744.         return self::$peer;
  745.     }
  746.  
  747.     /**
  748.      * Resets all collections of referencing foreign keys.
  749.      *
  750.      * This method is a user-space workaround for PHP's inability to garbage collect objects
  751.      * with circular references.  This is currently necessary when using Propel in certain
  752.      * daemon or large-volumne/high-memory operations.
  753.      *
  754.      * @param      boolean $deep Whether to also clear the references on all associated objects.
  755.      */
  756.     public function clearAllReferences($deep false)
  757.     {
  758.         if ($deep{
  759.         // if ($deep)
  760.  
  761.     }
  762.  
  763.  
  764.   public function __call($method$arguments)
  765.   {
  766.     if (!$callable sfMixer::getCallable('BaseEtvaMac:'.$method))
  767.     {
  768.       throw new sfException(sprintf('Call to undefined method BaseEtvaMac::%s'$method));
  769.     }
  770.  
  771.     array_unshift($arguments$this);
  772.  
  773.     return call_user_func_array($callable$arguments);
  774.   }
  775.  
  776.  
  777. // BaseEtvaMac

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