/** * 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 \Rigs (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->setTitle($this->getTitle()); 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->getRatingHeaderss() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addRatingHeaders($relObj->copy($deepCopy)); } } foreach ($this->getRigAttributeValuess() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addRigAttributeValues($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 \Games (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->setTitle($this->getTitle()); $copyObj->setDescription($this->getDescription()); $copyObj->setPublisherId($this->getPublisherId()); $copyObj->setDeveloperId($this->getDeveloperId()); $copyObj->setGbId($this->getGbId()); $copyObj->setGbUrl($this->getGbUrl()); $copyObj->setGbImage($this->getGbImage()); $copyObj->setGbThumb($this->getGbThumb()); 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->getGameLinkss() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addGameLinks($relObj->copy($deepCopy)); } } foreach ($this->getGamePlatformss() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addGamePlatforms($relObj->copy($deepCopy)); } } foreach ($this->getRatingHeaderss() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addRatingHeaders($relObj->copy($deepCopy)); } } foreach ($this->getUserReviewss() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addUserReviews($relObj->copy($deepCopy)); } } } // if ($deepCopy) if ($makeNew) { $copyObj->setNew(true); $copyObj->setId(NULL); // this is a auto-increment column, so set to default value } }