Пример #1
0
 /**
  * @param string $hash
  * @return UserModel
  */
 public function getByHash($hash)
 {
     if ($hash instanceof UserModel) {
         return $hash;
     }
     return parent::getByHash($hash);
 }
Пример #2
0
 public function __construct(NotificationModel $containerModel)
 {
     $this->model = $containerModel;
     parent::__construct($containerModel);
 }
Пример #3
0
 /**
  * @param $identifier
  * @param array $attributes Update attributes
  * @return \stdClass Updated project model
  */
 public function update($identifier, array $attributes)
 {
     $model = $this->getByHash($identifier);
     if ($attributes['status'] == 1) {
         //ignore submission if already submitted. For the case where state returns to status 1
         if ($model->submitted_at != null) {
             unset($attributes['submitted_at']);
         }
     } else {
         if ($attributes['status'] == 2) {
             //ignore review if already reviewed. For the case where the state returns to status 2
             if ($model->reviewed_on != null) {
                 unset($attributes['reviewed_on']);
             }
         }
     }
     $updated = parent::update($model->id, $attributes);
     return $updated;
 }
Пример #4
0
 /**
  * @param            $key
  * @param            $value
  * @param Repository $transform
  * @return \stdClass
  */
 protected function transformByRepository($key, $value, EloquentRepository $transform)
 {
     try {
         $value = $transform->getByHash($value);
         $this->keys[$key] = $value;
     } catch (NotFoundModelException $e) {
         throw new BadRequestHttpException("{$value} not found.");
     }
     return $value;
 }
Пример #5
0
 public function __construct(UploadModel $model)
 {
     $this->model = $model;
     parent::__construct($model);
 }
Пример #6
0
 public function __construct(Model $model)
 {
     parent::__construct($model);
 }
Пример #7
0
 public function __construct(ActivityModel $model)
 {
     $this->model = $model;
     parent::__construct($model);
 }