/** * 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 Production (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->setCreationDate($this->creation_date); $copyObj->setUpdateDate($this->update_date); $copyObj->setRoomId($this->room_id); 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->getElements() as $relObj) { $copyObj->addElement($relObj->copy($deepCopy)); } foreach ($this->getMessages() as $relObj) { $copyObj->addMessage($relObj->copy($deepCopy)); } foreach ($this->getHistorys() as $relObj) { $copyObj->addHistory($relObj->copy($deepCopy)); } foreach ($this->getProductionHistorys() as $relObj) { $copyObj->addProductionHistory($relObj->copy($deepCopy)); } foreach ($this->getOnlines() as $relObj) { $copyObj->addOnline($relObj->copy($deepCopy)); } } // if ($deepCopy) $copyObj->setNew(true); $copyObj->setProductionId(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 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->setName($this->name); $copyObj->setEmail($this->email); $copyObj->setPassword($this->password); $copyObj->setRoomcreator($this->roomcreator); 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->getRooms() as $relObj) { $copyObj->addRoom($relObj->copy($deepCopy)); } foreach ($this->getMessages() as $relObj) { $copyObj->addMessage($relObj->copy($deepCopy)); } foreach ($this->getHistorys() as $relObj) { $copyObj->addHistory($relObj->copy($deepCopy)); } foreach ($this->getProductionHistorys() as $relObj) { $copyObj->addProductionHistory($relObj->copy($deepCopy)); } foreach ($this->getOnlines() as $relObj) { $copyObj->addOnline($relObj->copy($deepCopy)); } foreach ($this->getPermissions() as $relObj) { $copyObj->addPermission($relObj->copy($deepCopy)); } } // if ($deepCopy) $copyObj->setNew(true); $copyObj->setUserId(NULL); // this is a pkey column, so set to default value }