/**
  * 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;
 }
示例#2
0
 /**
  * Filter the query by a related Expedienteservicio object
  *
  * @param   Expedienteservicio|PropelObjectCollection $expedienteservicio  the related object to use as filter
  * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return                 ExpedienteQuery The current query, for fluid interface
  * @throws PropelException - if the provided filter is invalid.
  */
 public function filterByExpedienteservicio($expedienteservicio, $comparison = null)
 {
     if ($expedienteservicio instanceof Expedienteservicio) {
         return $this->addUsingAlias(ExpedientePeer::IDEXPEDIENTE, $expedienteservicio->getIdexpediente(), $comparison);
     } elseif ($expedienteservicio instanceof PropelObjectCollection) {
         return $this->useExpedienteservicioQuery()->filterByPrimaryKeys($expedienteservicio->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByExpedienteservicio() only accepts arguments of type Expedienteservicio or PropelCollection');
     }
 }
 /**
  * Exclude object from result
  *
  * @param   Expedienteservicio $expedienteservicio Object to remove from the list of results
  *
  * @return ExpedienteservicioQuery The current query, for fluid interface
  */
 public function prune($expedienteservicio = null)
 {
     if ($expedienteservicio) {
         $this->addUsingAlias(ExpedienteservicioPeer::IDEXPEDIENTESERVICIO, $expedienteservicio->getIdexpedienteservicio(), Criteria::NOT_EQUAL);
     }
     return $this;
 }
 /**
  * Filter the query by a related Expedienteservicio object
  *
  * @param   Expedienteservicio|PropelObjectCollection $expedienteservicio 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 filterByExpedienteservicio($expedienteservicio, $comparison = null)
 {
     if ($expedienteservicio instanceof Expedienteservicio) {
         return $this->addUsingAlias(ExpedientehistorialPeer::IDEXPEDIENTESERVICIO, $expedienteservicio->getIdexpedienteservicio(), $comparison);
     } elseif ($expedienteservicio instanceof PropelObjectCollection) {
         if (null === $comparison) {
             $comparison = Criteria::IN;
         }
         return $this->addUsingAlias(ExpedientehistorialPeer::IDEXPEDIENTESERVICIO, $expedienteservicio->toKeyValue('PrimaryKey', 'Idexpedienteservicio'), $comparison);
     } else {
         throw new PropelException('filterByExpedienteservicio() only accepts arguments of type Expedienteservicio or PropelCollection');
     }
 }
示例#5
0
 /**
  * @param	Expedienteservicio $expedienteservicio The expedienteservicio object to add.
  */
 protected function doAddExpedienteservicio($expedienteservicio)
 {
     $this->collExpedienteservicios[] = $expedienteservicio;
     $expedienteservicio->setServicio($this);
 }
 public function nuevoservicioAction()
 {
     $request = $this->getRequest();
     if ($request->isPost()) {
         $post_data = $request->getPost();
         $entity = new \Expedienteservicio();
         foreach ($post_data as $key => $value) {
             if (\ExpedienteservicioPeer::getTableMap()->hasColumn($key) && !empty($value) && $key != 'expedienteservicio_fecha') {
                 $entity->setByName($key, $value, \BasePeer::TYPE_FIELDNAME);
             }
         }
         //LA FECHA
         $expedienteservicio_fecha = \DateTime::createFromFormat('d/m/Y', $post_data['expedienteservicio_fecha']);
         $entity->setExpedienteservicioFecha($expedienteservicio_fecha);
         $entity->save();
         $this->flashMessenger()->addSuccessMessage('Registro guardado exitosamente!');
         //REDIRECCIONAMOS A LA ENTIDAD QUE ACABAMOS DE CREAR
         return $this->redirect()->toUrl('/clientes/ver/' . $entity->getExpediente()->getIdcliente() . '/expedientes/ver/' . $entity->getIdexpediente());
     }
     $idexpediente = $this->params()->fromQuery('idexpediente');
     $expediente = \ExpedienteQuery::create()->findPk($idexpediente);
     $servicios_array = array();
     if ($expediente->getExpedienteTipo() == 'importacion') {
         $servicios = \ServicioQuery::create()->filterByServicioTipo('importacion')->find();
     } else {
         $servicios = \ServicioQuery::create()->filterByServicioTipo('exportacion')->find();
     }
     $servicio = new \Servicio();
     foreach ($servicios as $servicio) {
         $idservicio = $servicio->getIdservicio();
         $servicios_array[$idservicio] = $servicio->getServicioNombre();
     }
     //Instanciamos nuestro formulario
     $form = new \Admin\Clientes\Form\ServicioForm($idexpediente);
     //Enviamos a la vista
     $view_model = new ViewModel();
     $view_model->setTerminal(true)->setVariable('form', $form)->setVariable('entity', $expediente)->setTemplate('/clientes/expedientes/modal/nuevoservicio');
     return $view_model;
 }
 /**
  * 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 Expedienteservicio $obj A Expedienteservicio 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->getIdexpedienteservicio();
         }
         // if key === null
         ExpedienteservicioPeer::$instances[$key] = $obj;
     }
 }