/** * 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 Proveedor (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->setNombre($this->getNombre()); $copyObj->setDireccion($this->getDireccion()); $copyObj->setCorreoEletronico($this->getCorreoEletronico()); $copyObj->setNombreContacto($this->getNombreContacto()); $copyObj->setTelefono($this->getTelefono()); $copyObj->setCiudad($this->getCiudad()); $copyObj->setObservacion($this->getObservacion()); $copyObj->setNit($this->getNit()); $copyObj->setRazonSocial($this->getRazonSocial()); $copyObj->setContacto($this->getContacto()); $copyObj->setReferencia($this->getReferencia()); $copyObj->setCorreo($this->getCorreo()); 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->getPedidoProveedors() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addPedidoProveedor($relObj->copy($deepCopy)); } } foreach ($this->getInventarios() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addInventario($relObj->copy($deepCopy)); } } foreach ($this->getFacturaDetalles() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addFacturaDetalle($relObj->copy($deepCopy)); } } foreach ($this->getMovimientos() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addMovimiento($relObj->copy($deepCopy)); } } //unflag object copy $this->startCopy = false; } // 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 Usuario (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->setUsuario($this->getUsuario()); $copyObj->setClave($this->getClave()); $copyObj->setNombre($this->getNombre()); $copyObj->setApellido($this->getApellido()); $copyObj->setPerfilId($this->getPerfilId()); $copyObj->setCreatedAt($this->getCreatedAt()); $copyObj->setUpdatedAt($this->getUpdatedAt()); $copyObj->setCreatedBy($this->getCreatedBy()); $copyObj->setUpdatedBy($this->getUpdatedBy()); 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->getPedidoProveedors() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addPedidoProveedor($relObj->copy($deepCopy)); } } foreach ($this->getTransaccions() as $relObj) { if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves $copyObj->addTransaccion($relObj->copy($deepCopy)); } } //unflag object copy $this->startCopy = false; } // if ($deepCopy) if ($makeNew) { $copyObj->setNew(true); $copyObj->setId(NULL); // this is a auto-increment column, so set to default value } }