/** * 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 \Models\Category (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->setUserId($this->getUserId()); $copyObj->setName($this->getName()); $copyObj->setColor($this->getColor()); $copyObj->setCreatedAt($this->getCreatedAt()); $copyObj->setUpdatedAt($this->getUpdatedAt()); 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->getNotes() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addNote($relObj->copy($deepCopy)); } } foreach ($this->getShareds() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addShared($relObj->copy($deepCopy)); } } } // 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 \Models\Note (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->setUserId($this->getUserId()); $copyObj->setImportance($this->getImportance()); $copyObj->setTitle($this->getTitle()); $copyObj->setDeadline($this->getDeadline()); $copyObj->setCategoryId($this->getCategoryId()); $copyObj->setState($this->getState()); $copyObj->setRepeatAfter($this->getRepeatAfter()); $copyObj->setDoneAt($this->getDoneAt()); $copyObj->setPublic($this->getPublic()); $copyObj->setDescription($this->getDescription()); $copyObj->setCreatedAt($this->getCreatedAt()); $copyObj->setUpdatedAt($this->getUpdatedAt()); 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->getSubNotes() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addSubNote($relObj->copy($deepCopy)); } } foreach ($this->getFiles() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addFile($relObj->copy($deepCopy)); } } foreach ($this->getNotifications() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addNotification($relObj->copy($deepCopy)); } } foreach ($this->getComments() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addComment($relObj->copy($deepCopy)); } } foreach ($this->getShareds() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addShared($relObj->copy($deepCopy)); } } } // 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 \Models\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->setNick($this->getNick()); $copyObj->setEmail($this->getEmail()); $copyObj->setRights($this->getRights()); $copyObj->setEmailConfirmedAt($this->getEmailConfirmedAt()); $copyObj->setPassword($this->getPassword()); $copyObj->setPasswordResetToken($this->getPasswordResetToken()); $copyObj->setSigninCount($this->getSigninCount()); $copyObj->setEmailConfirmToken($this->getEmailConfirmToken()); $copyObj->setAvatarPath($this->getAvatarPath()); $copyObj->setLastSigninAt($this->getLastSigninAt()); $copyObj->setCreatedAt($this->getCreatedAt()); $copyObj->setUpdatedAt($this->getUpdatedAt()); 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->getNotes() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addNote($relObj->copy($deepCopy)); } } foreach ($this->getCategories() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addCategory($relObj->copy($deepCopy)); } } foreach ($this->getNotificationsRelatedByUserId() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addNotificationRelatedByUserId($relObj->copy($deepCopy)); } } foreach ($this->getNotificationsRelatedByOriginTypeOriginId() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addNotificationRelatedByOriginTypeOriginId($relObj->copy($deepCopy)); } } foreach ($this->getComments() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addComment($relObj->copy($deepCopy)); } } foreach ($this->getIdentities() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addIdentity($relObj->copy($deepCopy)); } } foreach ($this->getUserGroups() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addUserGroup($relObj->copy($deepCopy)); } } foreach ($this->getShareds() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addShared($relObj->copy($deepCopy)); } } } // if ($deepCopy) if ($makeNew) { $copyObj->setNew(true); $copyObj->setId(NULL); // this is a auto-increment column, so set to default value } }