/** * 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 \App\Propel\Wishlist (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->setWishlistName($this->getWishlistName()); $copyObj->setWishlistComment($this->getWishlistComment()); $copyObj->setWishlistIsGeneral($this->getWishlistIsGeneral()); $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->getWishlistProducts() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addWishlistProduct($relObj->copy($deepCopy)); } } } // if ($deepCopy) if ($makeNew) { $copyObj->setNew(true); $copyObj->setWishlistId(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 \App\Propel\Product (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->setResourceId($this->getResourceId()); $copyObj->setProductName($this->getProductName()); $copyObj->setProductDescription($this->getProductDescription()); $copyObj->setCategoryId($this->getCategoryId()); $copyObj->setProviderId($this->getProviderId()); $copyObj->setUnitId($this->getUnitId()); $copyObj->setProductRange($this->getProductRange()); $copyObj->setProductPrice($this->getProductPrice()); $copyObj->setProductIsActive($this->getProductIsActive()); $copyObj->setProductPic($this->getProductPic()); $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->getOrderProducts() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addOrderProduct($relObj->copy($deepCopy)); } } foreach ($this->getProductHighlighteds() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addProductHighlighted($relObj->copy($deepCopy)); } } foreach ($this->getProductVariationTypes() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addProductVariationType($relObj->copy($deepCopy)); } } foreach ($this->getWishlistProducts() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addWishlistProduct($relObj->copy($deepCopy)); } } } // if ($deepCopy) if ($makeNew) { $copyObj->setNew(true); $copyObj->setProductId(NULL); // this is a auto-increment column, so set to default value } }