/** * 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 Category (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->setName($this->name); $copyObj->setDescription($this->description); $copyObj->setParent($this->parent); $copyObj->setPrefix($this->prefix); $copyObj->setUpdatedAt($this->updated_at); $copyObj->setStatus($this->status); 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->getCoursess() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addCourses($relObj->copy($deepCopy)); } } foreach ($this->getExpertCategorys() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addExpertCategory($relObj->copy($deepCopy)); } } foreach ($this->getUserQuestionTags() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addUserQuestionTag($relObj->copy($deepCopy)); } } } // if ($deepCopy) $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 User (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->setEmail($this->email); $copyObj->setPassword($this->password); $copyObj->setPoints($this->points); $copyObj->setCreatedAt($this->created_at); $copyObj->setLastActivityAt($this->last_activity_at); $copyObj->setType($this->type); $copyObj->setHidden($this->hidden); $copyObj->setName($this->name); $copyObj->setGender($this->gender); $copyObj->setHometown($this->hometown); $copyObj->setHomePhone($this->home_phone); $copyObj->setMobilePhone($this->mobile_phone); $copyObj->setBirthdate($this->birthdate); $copyObj->setAddress($this->address); $copyObj->setRelationshipStatus($this->relationship_status); $copyObj->setShowEmail($this->show_email); $copyObj->setShowGender($this->show_gender); $copyObj->setShowHometown($this->show_hometown); $copyObj->setShowHomePhone($this->show_home_phone); $copyObj->setShowMobilePhone($this->show_mobile_phone); $copyObj->setShowBirthdate($this->show_birthdate); $copyObj->setShowAddress($this->show_address); $copyObj->setShowRelationshipStatus($this->show_relationship_status); $copyObj->setPasswordRecoverKey($this->password_recover_key); $copyObj->setCookieKey($this->cookie_key); $copyObj->setCredit($this->credit); $copyObj->setInvisible($this->invisible); $copyObj->setNotification($this->notification); $copyObj->setPhoneNumber($this->phone_number); $copyObj->setLogin($this->login); $copyObj->setCreditCard($this->credit_card); $copyObj->setCreditCardToken($this->credit_card_token); $copyObj->setFirstCharge($this->first_charge); $copyObj->setWhereFindUs($this->where_find_us); 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->getExperts() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addExpert($relObj->copy($deepCopy)); } } foreach ($this->getExpertCategorys() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addExpertCategory($relObj->copy($deepCopy)); } } foreach ($this->getHistorys() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addHistory($relObj->copy($deepCopy)); } } foreach ($this->getItemRatings() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addItemRating($relObj->copy($deepCopy)); } } foreach ($this->getOfferVoucher1s() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addOfferVoucher1($relObj->copy($deepCopy)); } } foreach ($this->getPurchaseDetails() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addPurchaseDetail($relObj->copy($deepCopy)); } } foreach ($this->getShoppingCarts() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addShoppingCart($relObj->copy($deepCopy)); } } foreach ($this->getShoutsRelatedByPosterId() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addShoutRelatedByPosterId($relObj->copy($deepCopy)); } } foreach ($this->getShoutsRelatedByRecipientId() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addShoutRelatedByRecipientId($relObj->copy($deepCopy)); } } foreach ($this->getUserAwardss() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addUserAwards($relObj->copy($deepCopy)); } } $relObj = $this->getUserGtalk(); if ($relObj) { $copyObj->setUserGtalk($relObj->copy($deepCopy)); } $relObj = $this->getUserFb(); if ($relObj) { $copyObj->setUserFb($relObj->copy($deepCopy)); } foreach ($this->getUserRates() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addUserRate($relObj->copy($deepCopy)); } } $relObj = $this->getUserTutor(); if ($relObj) { $copyObj->setUserTutor($relObj->copy($deepCopy)); } foreach ($this->getUserQuestionTags() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addUserQuestionTag($relObj->copy($deepCopy)); } } foreach ($this->getStudentQuestionsRelatedByStudentId() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addStudentQuestionRelatedByStudentId($relObj->copy($deepCopy)); } } foreach ($this->getStudentQuestionsRelatedByTutorId() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addStudentQuestionRelatedByTutorId($relObj->copy($deepCopy)); } } foreach ($this->getWhiteboardSessions() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addWhiteboardSession($relObj->copy($deepCopy)); } } } // if ($deepCopy) $copyObj->setNew(true); $copyObj->setId(NULL); // this is a auto-increment column, so set to default value }