/** * 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 Tag (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->setApproved($this->approved); 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->getPostTags() as $relObj) { $copyObj->addPostTag($relObj->copy($deepCopy)); } } // if ($deepCopy) $copyObj->setNew(true); $copyObj->setId(NULL); // this is a pkey 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 Post (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->setBlogId($this->blog_id); $copyObj->setCreatedAt($this->created_at); $copyObj->setYear($this->year); $copyObj->setMonth($this->month); $copyObj->setTitle($this->title); $copyObj->setLink($this->link); $copyObj->setContent($this->content); $copyObj->setContentMore($this->content_more); $copyObj->setShortened($this->shortened); $copyObj->setDeleted($this->deleted); 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->getPostTags() as $relObj) { $copyObj->addPostTag($relObj->copy($deepCopy)); } } // if ($deepCopy) $copyObj->setNew(true); $copyObj->setId(NULL); // this is a pkey column, so set to default value }