/** * 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 Users (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->setUsername($this->username); $copyObj->setPassword($this->password); $copyObj->setFname($this->fname); $copyObj->setLname($this->lname); $copyObj->setEmail($this->email); $copyObj->setSalt($this->salt); $copyObj->setActive($this->active); $copyObj->setJoinDate($this->join_date); 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->getUserBikess() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addUserBikes($relObj->copy($deepCopy)); } } foreach ($this->getUserEquipements() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addUserEquipement($relObj->copy($deepCopy)); } } $relObj = $this->getUserInformation(); if ($relObj) { $copyObj->setUserInformation($relObj->copy($deepCopy)); } $relObj = $this->getUserProfile(); if ($relObj) { $copyObj->setUserProfile($relObj->copy($deepCopy)); } foreach ($this->getUserRidess() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addUserRides($relObj->copy($deepCopy)); } } } // if ($deepCopy) $copyObj->setNew(true); $copyObj->setUserId(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 UserBikes (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->setBikeYear($this->bike_year); $copyObj->setBikeMake($this->bike_make); $copyObj->setBikeModel($this->bike_model); $copyObj->setEquipFunction($this->equip_function); $copyObj->setDescription($this->description); 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->getUserEquipements() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addUserEquipement($relObj->copy($deepCopy)); } } foreach ($this->getUserStatss() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addUserStats($relObj->copy($deepCopy)); } } } // if ($deepCopy) $copyObj->setNew(true); $copyObj->setUserBikeId(NULL); // this is a auto-increment column, so set to default value }