Esempio n. 1
0
 public function hydrate($data)
 {
     if ($data['error'] === UPLOAD_ERR_OK) {
         $input = new File\Input($data);
         if ($this->preUpload) {
             $input = call_user_func($this->preUpload, $input);
         }
         $newValue = $this->container->upload($input);
         if ($this->value && $this->container->has($this->value)) {
             try {
                 $this->container->delete($this->value);
             } catch (\Exception $ex) {
                 $this->container->delete($newValue);
                 throw $ex;
             }
         }
         $this->value = $newValue;
         return $this->value;
     }
     return $this->value;
 }
Esempio n. 2
0
 /**
  * @param string $id
  */
 public function delete($id)
 {
     return $this->container->delete($id);
 }
Esempio n. 3
0
 /**
  * @param string $id
  *
  * @return boolean
  */
 public function has($id)
 {
     return $this->container->has($id);
 }