/** * Exclude object from result * * @param Expedienteanticipo $expedienteanticipo Object to remove from the list of results * * @return ExpedienteanticipoQuery The current query, for fluid interface */ public function prune($expedienteanticipo = null) { if ($expedienteanticipo) { $this->addUsingAlias(ExpedienteanticipoPeer::IDEXPEDIENTEANTICIPO, $expedienteanticipo->getIdexpedienteanticipo(), Criteria::NOT_EQUAL); } return $this; }
/** * Filter the query by a related Expedienteanticipo object * * @param Expedienteanticipo|PropelObjectCollection $expedienteanticipo 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 filterByExpedienteanticipo($expedienteanticipo, $comparison = null) { if ($expedienteanticipo instanceof Expedienteanticipo) { return $this->addUsingAlias(ExpedientePeer::IDEXPEDIENTE, $expedienteanticipo->getIdexpediente(), $comparison); } elseif ($expedienteanticipo instanceof PropelObjectCollection) { return $this->useExpedienteanticipoQuery()->filterByPrimaryKeys($expedienteanticipo->getPrimaryKeys())->endUse(); } else { throw new PropelException('filterByExpedienteanticipo() only accepts arguments of type Expedienteanticipo or PropelCollection'); } }
/** * @param Expedienteanticipo $expedienteanticipo The expedienteanticipo object to add. */ protected function doAddExpedienteanticipo($expedienteanticipo) { $this->collExpedienteanticipos[] = $expedienteanticipo; $expedienteanticipo->setExpediente($this); }
public function nuevoanticipoAction() { $request = $this->getRequest(); if ($request->isPost()) { $post_data = $request->getPost(); $post_files = $request->getFiles(); $entity = new \Expedienteanticipo(); foreach ($post_data as $key => $value) { if (\ExpedienteanticipoPeer::getTableMap()->hasColumn($key) && !empty($value) && $key != 'expedienteanticipo_fecha') { $entity->setByName($key, $value, \BasePeer::TYPE_FIELDNAME); } } //LA FECHA $expedienteanticipo_fecha = \DateTime::createFromFormat('d/m/Y', $post_data['expedienteanticipo_fecha']); $entity->setExpedienteanticipoFecha($expedienteanticipo_fecha); $entity->save(); //El comprobante if (!empty($post_files['expedienteanticipo_comprobante']['name'])) { $target_path = "/files/expedientesanticipos/"; $target_path = $target_path . $entity->getIdexpedienteanticipo() . '_' . basename($post_files['expedienteanticipo_comprobante']['name']); if (move_uploaded_file($_FILES['expedienteanticipo_comprobante']['tmp_name'], $_SERVER['DOCUMENT_ROOT'] . $target_path)) { $entity->setExpedienteanticipoComprobante($target_path); $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('id'); $moneda = $this->params()->fromQuery('moneda'); $expediente = \ExpedienteQuery::create()->findPk($idexpediente); $form = new \Admin\Clientes\Form\ExpedienteanticipoForm($idexpediente, $moneda); //Enviamos a la vista $view_model = new ViewModel(); $view_model->setTerminal(true)->setVariable('form', $form)->setVariable('entity', $expediente)->setTemplate('/clientes/expedientes/modal/nuevoanticipo'); 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 Expedienteanticipo $obj A Expedienteanticipo 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->getIdexpedienteanticipo(); } // if key === null ExpedienteanticipoPeer::$instances[$key] = $obj; } }