/** * 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 \Rig (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->getRigAttributeValues() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addRigAttributeValue($relObj->copy($deepCopy)); } } foreach ($this->getUserReviews() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addUserReview($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 \Game (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()); $copyObj->setAdminLock($this->getAdminLock()); 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->getGameLinks() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addGameLink($relObj->copy($deepCopy)); } } foreach ($this->getGamePlatforms() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addGamePlatform($relObj->copy($deepCopy)); } } foreach ($this->getRatingHeaders() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addRatingHeader($relObj->copy($deepCopy)); } } foreach ($this->getUserReviews() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addUserReview($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 \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->setRedditId($this->getRedditId()); $copyObj->setTrusted($this->getTrusted()); $copyObj->setAdmin($this->getAdmin()); $copyObj->setModerator($this->getModerator()); $copyObj->setProbation($this->getProbation()); $copyObj->setBanned($this->getBanned()); 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->getContestQueues() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addContestQueue($relObj->copy($deepCopy)); } } foreach ($this->getNews() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addNews($relObj->copy($deepCopy)); } } foreach ($this->getRigs() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addRig($relObj->copy($deepCopy)); } } foreach ($this->getUserAccesses() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addUserAccess($relObj->copy($deepCopy)); } } foreach ($this->getUserAttributeValues() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addUserAttributeValue($relObj->copy($deepCopy)); } } foreach ($this->getUserReviews() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addUserReview($relObj->copy($deepCopy)); } } } // if ($deepCopy) if ($makeNew) { $copyObj->setNew(true); $copyObj->setId(NULL); // this is a auto-increment column, so set to default value } }