예제 #1
0
 public function insert($data, $callback = null)
 {
     if (is_null($callback)) {
         $callback = function ($user) {
             $user->api_token = makeApiKey();
             return $user;
         };
     }
     return parent::insert($data, $callback);
 }
예제 #2
0
파일: Media.php 프로젝트: rodrane/ravel
 public function insert($data, $callback = null)
 {
     $collection_id = (int) $data['collection_id'];
     if (isset($data[$this->uploadFieldName])) {
         $this->prepareMediaData($data);
         //check if media already exists
         if ($this->mediaNotExists($data)) {
             return parent::insert($data, $callback);
         } else {
             $this->mediaUpload($data);
         }
     } else {
         throw new Exception("No File Submitted", 406);
     }
 }
예제 #3
0
 public function insert($data, $callback = null)
 {
     $data['lang'] = $this->getLocale();
     return parent::insert($data, $callback);
 }
예제 #4
0
파일: Content.php 프로젝트: rodrane/ravel
 public function insert($data, $callback = null)
 {
     if (is_null($callback)) {
         $callback = function (&$model, $host) {
             $model->content_type = $host->getContentType();
             $model->author_id = $host->getAuthorId();
             $model->slug = $host->makeSlug($model->title);
             $model->lang = $host->getLocale();
             return $model;
         };
     }
     return parent::insert($data, $callback);
 }