/** * 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 Admision (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->setIdpaciente($this->getIdpaciente()); $copyObj->setIdmedico($this->getIdmedico()); $copyObj->setIdcuarto($this->getIdcuarto()); $copyObj->setAdmisionFechaadmision($this->getAdmisionFechaadmision()); $copyObj->setAdmisionFechasalida($this->getAdmisionFechasalida()); $copyObj->setAdmisionDiagnostico($this->getAdmisionDiagnostico()); $copyObj->setAdmisionObservaciones($this->getAdmisionObservaciones()); $copyObj->setAdmisionStatus($this->getAdmisionStatus()); $copyObj->setAdmisionTotal($this->getAdmisionTotal()); $copyObj->setAdmisionPagadaen($this->getAdmisionPagadaen()); $copyObj->setAdmisionTipodepago($this->getAdmisionTipodepago()); $copyObj->setAdmisionReferenciapago($this->getAdmisionReferenciapago()); $copyObj->setAdmisionFacturada($this->getAdmisionFacturada()); $copyObj->setAdmisionRegistrada($this->getAdmisionRegistrada()); if ($deepCopy && !$this->startCopy) { // important: temporarily setNew(false) because this affects the behavior of // the getter/setter methods for fkey referrer objects. $copyObj->setNew(false); // store object hash to prevent cycle $this->startCopy = true; foreach ($this->getAdmisionanticipos() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addAdmisionanticipo($relObj->copy($deepCopy)); } } foreach ($this->getCargoadmisions() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addCargoadmision($relObj->copy($deepCopy)); } } foreach ($this->getFacturas() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addFactura($relObj->copy($deepCopy)); } } //unflag object copy $this->startCopy = false; } // if ($deepCopy) if ($makeNew) { $copyObj->setNew(true); $copyObj->setIdadmision(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 Servicio (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->setServicioNombre($this->getServicioNombre()); $copyObj->setServicioDescripcion($this->getServicioDescripcion()); $copyObj->setServicioPrecio($this->getServicioPrecio()); $copyObj->setServicioIva($this->getServicioIva()); if ($deepCopy && !$this->startCopy) { // important: temporarily setNew(false) because this affects the behavior of // the getter/setter methods for fkey referrer objects. $copyObj->setNew(false); // store object hash to prevent cycle $this->startCopy = true; foreach ($this->getCargoadmisions() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addCargoadmision($relObj->copy($deepCopy)); } } foreach ($this->getCargoconsultas() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addCargoconsulta($relObj->copy($deepCopy)); } } foreach ($this->getCargoventas() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addCargoventa($relObj->copy($deepCopy)); } } //unflag object copy $this->startCopy = false; } // if ($deepCopy) if ($makeNew) { $copyObj->setNew(true); $copyObj->setIdservicio(NULL); // this is a auto-increment column, so set to default value } }