Ejemplo n.º 1
0
 /**
  * Filter the query by a related Expedientearchivo object
  *
  * @param   Expedientearchivo|PropelObjectCollection $expedientearchivo  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 filterByExpedientearchivo($expedientearchivo, $comparison = null)
 {
     if ($expedientearchivo instanceof Expedientearchivo) {
         return $this->addUsingAlias(ExpedientePeer::IDEXPEDIENTE, $expedientearchivo->getIdexpediente(), $comparison);
     } elseif ($expedientearchivo instanceof PropelObjectCollection) {
         return $this->useExpedientearchivoQuery()->filterByPrimaryKeys($expedientearchivo->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByExpedientearchivo() only accepts arguments of type Expedientearchivo or PropelCollection');
     }
 }
 /**
  * Exclude object from result
  *
  * @param   Expedientearchivo $expedientearchivo Object to remove from the list of results
  *
  * @return ExpedientearchivoQuery The current query, for fluid interface
  */
 public function prune($expedientearchivo = null)
 {
     if ($expedientearchivo) {
         $this->addUsingAlias(ExpedientearchivoPeer::IDEXPEDIENTEARCHIVO, $expedientearchivo->getIdexpedientearchivo(), Criteria::NOT_EQUAL);
     }
     return $this;
 }
Ejemplo n.º 3
0
 /**
  * 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 Expedientearchivo $obj A Expedientearchivo 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->getIdexpedientearchivo();
         }
         // if key === null
         ExpedientearchivoPeer::$instances[$key] = $obj;
     }
 }
Ejemplo n.º 4
0
 /**
  * @param	Expedientearchivo $expedientearchivo The expedientearchivo object to add.
  */
 protected function doAddExpedientearchivo($expedientearchivo)
 {
     $this->collExpedientearchivos[] = $expedientearchivo;
     $expedientearchivo->setEmpleado($this);
 }
Ejemplo n.º 5
0
 public function dropzoneAction()
 {
     $idexpediente = $this->params()->fromRoute('idexpediente');
     $storeFolder = $_SERVER['DOCUMENT_ROOT'] . '/files/expedientes';
     $request = $this->getRequest();
     if ($request->isPost()) {
         $files = $request->getFiles();
         $tempFile = $files['file']['tmp_name'];
         $targetFile = $storeFolder . '/' . $idexpediente . '/' . $_FILES['file']['name'];
         if (!file_exists($storeFolder . '/' . $idexpediente)) {
             mkdir($storeFolder . '/' . $idexpediente, 0777, true);
         }
         move_uploaded_file($tempFile, $targetFile);
         //Guardamos en nuestra base de datos
         $entity = new \Expedientearchivo();
         $entity->setIdexpediente($idexpediente);
         $entity->setExpedientearchivoArchivo('/files/expedientes' . '/' . $idexpediente . '/' . $_FILES['file']['name']);
         $entity->setExpedientearchivoSize($_FILES['file']['size']);
         $entity->save();
         return $this->getResponse()->setContent(json_encode(array('response' => true, 'id' => $entity->getExpedientearchivoArchivo())));
     }
     echo '<pre>';
     var_dump($idexpediente);
     echo '</pre>';
     exit;
 }