/** * Sets contents of passed object to values from current object. * * If desired, this method can also make copies of all associated (fkey referrers) * objects. * * @param object $copyObj An object of UserEquipement (or compatible) type. * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. * @throws PropelException */ public function copyInto($copyObj, $deepCopy = false) { $copyObj->setUserId($this->user_id); $copyObj->setDescription($this->description); $copyObj->setBikeId($this->bike_id); $copyObj->setEquipFunction($this->equip_function); $copyObj->setPurchasePrice($this->purchase_price); $copyObj->setPurchaseDate($this->purchase_date); $copyObj->setMake($this->make); $copyObj->setModel($this->model); if ($deepCopy) { // important: temporarily setNew(false) because this affects the behavior of // the getter/setter methods for fkey referrer objects. $copyObj->setNew(false); foreach ($this->getUserStatEquips() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addUserStatEquip($relObj->copy($deepCopy)); } } } // if ($deepCopy) $copyObj->setNew(true); $copyObj->setEquipmentId(NULL); // this is a auto-increment column, so set to default value }
/** * Sets contents of passed object to values from current object. * * If desired, this method can also make copies of all associated (fkey referrers) * objects. * * @param object $copyObj An object of UserStats (or compatible) type. * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. * @throws PropelException */ public function copyInto($copyObj, $deepCopy = false) { $copyObj->setUserId($this->user_id); $copyObj->setRideDate($this->ride_date); $copyObj->setRideTime($this->ride_time); $copyObj->setAvgSpeed($this->avg_speed); $copyObj->setCaloriesBurned($this->calories_burned); $copyObj->setRideKey($this->ride_key); $copyObj->setBikeId($this->bike_id); $copyObj->setMileage($this->mileage); if ($deepCopy) { // important: temporarily setNew(false) because this affects the behavior of // the getter/setter methods for fkey referrer objects. $copyObj->setNew(false); foreach ($this->getUserStatEquips() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addUserStatEquip($relObj->copy($deepCopy)); } } } // if ($deepCopy) $copyObj->setNew(true); $copyObj->setStatNo(NULL); // this is a auto-increment column, so set to default value }