Example #1
0
 /**
  * @param	Pacientefacturacion $pacientefacturacion The pacientefacturacion object to add.
  */
 protected function doAddPacientefacturacion($pacientefacturacion)
 {
     $this->collPacientefacturacions[] = $pacientefacturacion;
     $pacientefacturacion->setPaciente($this);
 }
Example #2
0
 /**
  * Filter the query by a related Pacientefacturacion object
  *
  * @param   Pacientefacturacion|PropelObjectCollection $pacientefacturacion  the related object to use as filter
  * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return                 PacienteQuery The current query, for fluid interface
  * @throws PropelException - if the provided filter is invalid.
  */
 public function filterByPacientefacturacion($pacientefacturacion, $comparison = null)
 {
     if ($pacientefacturacion instanceof Pacientefacturacion) {
         return $this->addUsingAlias(PacientePeer::IDPACIENTE, $pacientefacturacion->getIdpaciente(), $comparison);
     } elseif ($pacientefacturacion instanceof PropelObjectCollection) {
         return $this->usePacientefacturacionQuery()->filterByPrimaryKeys($pacientefacturacion->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByPacientefacturacion() only accepts arguments of type Pacientefacturacion or PropelCollection');
     }
 }
 /**
  * Exclude object from result
  *
  * @param   Pacientefacturacion $pacientefacturacion Object to remove from the list of results
  *
  * @return PacientefacturacionQuery The current query, for fluid interface
  */
 public function prune($pacientefacturacion = null)
 {
     if ($pacientefacturacion) {
         $this->addUsingAlias(PacientefacturacionPeer::IDPACIENTEFACTURACION, $pacientefacturacion->getIdpacientefacturacion(), Criteria::NOT_EQUAL);
     }
     return $this;
 }
Example #4
0
 public function nuevoAction()
 {
     $request = $this->getRequest();
     //Intanciamos nuestro formulario
     $pacienteForm = new PacienteForm();
     if ($request->isPost()) {
         //Si hicieron POST
         //Instanciamos nuestro filtro
         $pacienteFilter = new PacienteFilter();
         //Le ponemos nuestro filtro a nuesto fromulario
         $pacienteForm->setInputFilter($pacienteFilter->getInputFilter());
         //Le ponemos los datos a nuestro formulario
         $pacienteForm->setData($request->getPost());
         //Validamos nuestro formulario
         if ($pacienteForm->isValid()) {
             //Instanciamos un nuevo objeto de nuestro objeto Paciente
             $paciente = new Paciente();
             //Recorremos nuestro formulario y seteamos los valores a nuestro objeto Paciente
             foreach ($pacienteForm->getData() as $pacienteKey => $pacienteValue) {
                 if ($pacienteKey != 'pacientefacturacion_rfc') {
                     $paciente->setByName($pacienteKey, $pacienteValue, \BasePeer::TYPE_FIELDNAME);
                 }
             }
             //Guardamos en nuestra base de datos
             $paciente->save();
             // Si nos mandan RFC
             if ($request->getPost()->pacientefacturacion_rfc != null) {
                 $pacientefacturacion = new \Pacientefacturacion();
                 $pacientefacturacion->setIdpaciente($paciente->getIdpaciente());
                 $pacientefacturacion->setPacientefacturacionCalle($paciente->getPacienteCalle());
                 $pacientefacturacion->setPacientefacturacionNoexterior($paciente->getPacienteNoexterior());
                 $pacientefacturacion->setPacientefacturacionNointerior($paciente->getPacienteNointerior());
                 $pacientefacturacion->setPacientefacturacionColonia($paciente->getPacienteColonia());
                 $pacientefacturacion->setPacientefacturacionCiudad($paciente->getPacienteCiudad());
                 $pacientefacturacion->setPacientefacturacionCodigopostal($paciente->getPacienteCodigopostal());
                 $pacientefacturacion->setPacientefacturacionEstado($paciente->getPacienteEstado());
                 $pacientefacturacion->setPacientefacturacionPais($paciente->getPacientePais());
                 $pacientefacturacion->setPacientefacturacionRfc($request->getPost()->pacientefacturacion_rfc);
                 $pacientefacturacion->save();
             }
             //Agregamos un mensaje
             $this->flashMessenger()->addMessage('Paciente guardado exitosamente!');
             $pacienteQuery = PacienteQuery::create()->filterByIdpaciente($paciente->getIdpaciente())->findOne();
             return new ViewModel(array('pacienteQuery' => $pacienteQuery, 'pacienteForm' => $pacienteForm, 'flashMessages' => $this->flashMessenger()->getMessages()));
             //Redireccionamos a nuestro list
             //return $this->redirect()->toRoute('pacientes');
         }
     }
     return new ViewModel(array('pacienteForm' => $pacienteForm));
 }
 /**
  * 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 Pacientefacturacion $obj A Pacientefacturacion 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->getIdpacientefacturacion();
         }
         // if key === null
         PacientefacturacionPeer::$instances[$key] = $obj;
     }
 }
Example #6
0
 public function nuevodatosfacturacionAction()
 {
     $request = $this->getRequest();
     if ($request->isPost()) {
         $post_data = $request->getPost();
         $pacientefactuacion = new \Pacientefacturacion();
         foreach ($post_data as $key => $value) {
             $pacientefactuacion->setByName($key, $value, \BasePeer::TYPE_FIELDNAME);
         }
         $pacientefactuacion->save();
         return $this->getResponse()->setContent(\Zend\Json\Json::encode(array('response' => true, 'data' => $pacientefactuacion->toArray(\BasePeer::TYPE_FIELDNAME))));
     }
     $viewModel = new ViewModel();
     $viewModel->setTerminal(true);
     return $viewModel;
 }
Example #7
0
 /**
  * Filter the query by a related Pacientefacturacion object
  *
  * @param   Pacientefacturacion|PropelObjectCollection $pacientefacturacion The related object(s) to use as filter
  * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return                 FacturaQuery The current query, for fluid interface
  * @throws PropelException - if the provided filter is invalid.
  */
 public function filterByPacientefacturacion($pacientefacturacion, $comparison = null)
 {
     if ($pacientefacturacion instanceof Pacientefacturacion) {
         return $this->addUsingAlias(FacturaPeer::IDDATOSFACTURACION, $pacientefacturacion->getIdpacientefacturacion(), $comparison);
     } elseif ($pacientefacturacion instanceof PropelObjectCollection) {
         if (null === $comparison) {
             $comparison = Criteria::IN;
         }
         return $this->addUsingAlias(FacturaPeer::IDDATOSFACTURACION, $pacientefacturacion->toKeyValue('PrimaryKey', 'Idpacientefacturacion'), $comparison);
     } else {
         throw new PropelException('filterByPacientefacturacion() only accepts arguments of type Pacientefacturacion or PropelCollection');
     }
 }
Example #8
0
 /**
  * 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->aAdmision instanceof Persistent) {
             $this->aAdmision->clearAllReferences($deep);
         }
         if ($this->aConsulta instanceof Persistent) {
             $this->aConsulta->clearAllReferences($deep);
         }
         if ($this->aPacientefacturacion instanceof Persistent) {
             $this->aPacientefacturacion->clearAllReferences($deep);
         }
         if ($this->aVenta instanceof Persistent) {
             $this->aVenta->clearAllReferences($deep);
         }
         $this->alreadyInClearAllReferencesDeep = false;
     }
     // if ($deep)
     $this->aAdmision = null;
     $this->aConsulta = null;
     $this->aPacientefacturacion = null;
     $this->aVenta = null;
 }