/** * Resets all references to other model objects or collections of model objects. * * This method is a user-space workaround for PHP's inability to garbage collect * objects with circular references (even in PHP 5.3). This is currently necessary * when using Propel in certain daemon or large-volume/high-memory operations. * * @param boolean $deep Whether to also clear the references on all referrer objects. */ public function clearAllReferences($deep = false) { if ($deep && !$this->alreadyInClearAllReferencesDeep) { $this->alreadyInClearAllReferencesDeep = true; if ($this->aExpedienteservicio instanceof Persistent) { $this->aExpedienteservicio->clearAllReferences($deep); } if ($this->aServicioestado instanceof Persistent) { $this->aServicioestado->clearAllReferences($deep); } $this->alreadyInClearAllReferencesDeep = false; } // if ($deep) $this->aExpedienteservicio = null; $this->aServicioestado = null; }
/** * Exclude object from result * * @param Servicioestado $servicioestado Object to remove from the list of results * * @return ServicioestadoQuery The current query, for fluid interface */ public function prune($servicioestado = null) { if ($servicioestado) { $this->addUsingAlias(ServicioestadoPeer::IDSERVICIOESTADO, $servicioestado->getIdservicioestado(), Criteria::NOT_EQUAL); } return $this; }
/** * Adds an object to the instance pool. * * Propel keeps cached copies of objects in an instance pool when they are retrieved * from the database. In some cases -- especially when you override doSelect*() * methods in your stub classes -- you may need to explicitly add objects * to the cache in order to ensure that the same objects are always returned by doSelect*() * and retrieveByPK*() calls. * * @param Servicioestado $obj A Servicioestado object. * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). */ public static function addInstanceToPool($obj, $key = null) { if (Propel::isInstancePoolingEnabled()) { if ($key === null) { $key = (string) $obj->getIdservicioestado(); } // if key === null ServicioestadoPeer::$instances[$key] = $obj; } }
/** * Filter the query by a related Servicioestado object * * @param Servicioestado|PropelObjectCollection $servicioestado The related object(s) to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return ExpedientehistorialQuery The current query, for fluid interface * @throws PropelException - if the provided filter is invalid. */ public function filterByServicioestado($servicioestado, $comparison = null) { if ($servicioestado instanceof Servicioestado) { return $this->addUsingAlias(ExpedientehistorialPeer::IDESTADOSERVICIO, $servicioestado->getIdservicioestado(), $comparison); } elseif ($servicioestado instanceof PropelObjectCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this->addUsingAlias(ExpedientehistorialPeer::IDESTADOSERVICIO, $servicioestado->toKeyValue('PrimaryKey', 'Idservicioestado'), $comparison); } else { throw new PropelException('filterByServicioestado() only accepts arguments of type Servicioestado or PropelCollection'); } }
/** * @param Servicioestado $servicioestado The servicioestado object to add. */ protected function doAddServicioestado($servicioestado) { $this->collServicioestados[] = $servicioestado; $servicioestado->setServicio($this); }
public function editarhistorialAction() { $request = $this->getRequest(); if ($request->isPost()) { $post_data = $request->getPost(); $id = $post_data['idexpedientehistorial']; $entity = \ExpedientehistorialQuery::create()->findPk($id); foreach ($post_data as $key => $value) { if (\ExpedientehistorialPeer::getTableMap()->hasColumn($key) && !empty($value)) { $entity->setByName($key, $value, \BasePeer::TYPE_FIELDNAME); } } $entity->save(); //Validamos si se va enviar por correo al cliente if (isset($post_data['sendemail'])) { $cliente = $entity->getExpedienteservicio()->getExpediente()->getCliente(); $new_status = $entity->getServicioestado()->getServicioestadoNombre(); $folio = $entity->getExpedienteservicio()->getExpediente()->getExpedienteFolio(); $mailer = new \Shared\GeneralFunction\Itrademailer(); if ($mailer->changeStatusEmail($cliente, $folio, $new_status)) { $this->flashMessenger()->addSuccessMessage('Correo electronico enviado exitosamente!'); } } $this->flashMessenger()->addSuccessMessage('Registro guardado exitosamente!'); //REDIRECCIONAMOS A LA ENTIDAD QUE ACABAMOS DE CREAR return $this->redirect()->toUrl('/clientes/ver/' . $entity->getExpedienteservicio()->getExpediente()->getIdcliente() . '/expedientes/ver/' . $entity->getExpedienteservicio()->getIdexpediente()); } $id = $this->params()->fromQuery('id'); $entity = \ExpedientehistorialQuery::create()->findPk($id); $expedienteservicio = $entity->getExpedienteservicio(); $expediente = $expedienteservicio->getExpediente(); //Obtenemos los estatus disponibles dependiendo del servicio seleccionado $servicio_estatus = array(); $servicioestatus = \ServicioestadoQuery::create()->filterByIdservicio($expedienteservicio->getIdservicio())->find(); $estatus = new \Servicioestado(); foreach ($servicioestatus as $estatus) { $id = $estatus->getIdservicioestado(); $servicio_estatus[$id] = $estatus->getServicioestadoNombre(); } //Instanciamos nuestro formurmalario $form = new \Admin\Clientes\Form\HistorialForm($expedienteservicio->getIdexpedienteservicio(), $servicio_estatus); $form->setData($entity->toArray(\BasePeer::TYPE_FIELDNAME)); //Enviamos a la vista $view_model = new ViewModel(); $view_model->setTerminal(true)->setVariable('form', $form)->setVariable('entity', $expediente)->setTemplate('/clientes/expedientes/modal/editarhistorial'); return $view_model; echo '<pre>'; var_dump($entity->toArray()); echo '</pre>'; exit; }
/** * Filter the query by a related Servicioestado object * * @param Servicioestado|PropelObjectCollection $servicioestado the related object to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return ServicioQuery The current query, for fluid interface * @throws PropelException - if the provided filter is invalid. */ public function filterByServicioestado($servicioestado, $comparison = null) { if ($servicioestado instanceof Servicioestado) { return $this->addUsingAlias(ServicioPeer::IDSERVICIO, $servicioestado->getIdservicio(), $comparison); } elseif ($servicioestado instanceof PropelObjectCollection) { return $this->useServicioestadoQuery()->filterByPrimaryKeys($servicioestado->getPrimaryKeys())->endUse(); } else { throw new PropelException('filterByServicioestado() only accepts arguments of type Servicioestado or PropelCollection'); } }