/** * 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 User (or compatible) type. * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. * @param boolean $makeNew Whether to reset autoincrement PKs and make the object new. * @throws PropelException */ public function copyInto($copyObj, $deepCopy = false, $makeNew = true) { $copyObj->setUsername($this->getUsername()); $copyObj->setPassword($this->getPassword()); $copyObj->setSalt($this->getSalt()); $copyObj->setFirstname($this->getFirstname()); $copyObj->setLastname($this->getLastname()); $copyObj->setEmail($this->getEmail()); $copyObj->setPhone($this->getPhone()); $copyObj->setMemo($this->getMemo()); $copyObj->setActivated($this->getActivated()); $copyObj->setLastLogin($this->getLastLogin()); $copyObj->setNotificationChange($this->getNotificationChange()); $copyObj->setNotificationError($this->getNotificationError()); if ($deepCopy && !$this->startCopy) { // important: temporarily setNew(false) because this affects the behavior of // the getter/setter methods for fkey referrer objects. $copyObj->setNew(false); // store object hash to prevent cycle $this->startCopy = true; foreach ($this->getUserCustomerRelations() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addUserCustomerRelation($relObj->copy($deepCopy)); } } foreach ($this->getUserRoles() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addUserRole($relObj->copy($deepCopy)); } } //unflag object copy $this->startCopy = false; } // if ($deepCopy) if ($makeNew) { $copyObj->setNew(true); $copyObj->setId(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 Customer (or compatible) type. * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. * @param boolean $makeNew Whether to reset autoincrement PKs and make the object new. * @throws PropelException */ public function copyInto($copyObj, $deepCopy = false, $makeNew = true) { $copyObj->setName($this->getName()); $copyObj->setStreet($this->getStreet()); $copyObj->setZip($this->getZip()); $copyObj->setCity($this->getCity()); $copyObj->setCountryId($this->getCountryId()); $copyObj->setPhone($this->getPhone()); $copyObj->setFax($this->getFax()); $copyObj->setEmail($this->getEmail()); $copyObj->setLegalform($this->getLegalform()); $copyObj->setLogo($this->getLogo()); $copyObj->setCreated($this->getCreated()); $copyObj->setNotes($this->getNotes()); if ($deepCopy && !$this->startCopy) { // important: temporarily setNew(false) because this affects the behavior of // the getter/setter methods for fkey referrer objects. $copyObj->setNew(false); // store object hash to prevent cycle $this->startCopy = true; foreach ($this->getRemoteApps() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addRemoteApp($relObj->copy($deepCopy)); } } foreach ($this->getUserCustomerRelations() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addUserCustomerRelation($relObj->copy($deepCopy)); } } //unflag object copy $this->startCopy = false; } // if ($deepCopy) if ($makeNew) { $copyObj->setNew(true); $copyObj->setId(NULL); // this is a auto-increment column, so set to default value } }