Ejemplo n.º 1
0
 public function save(array $options = [])
 {
     if (empty($this->public_key) || empty($this->private_key)) {
         $this->generateKeys();
     }
     return parent::save($options);
 }
Ejemplo n.º 2
0
 /**
  * Save the model to the database.
  *
  * @param  array  $options
  * @return bool
  */
 public function save(array $options = [])
 {
     // If only a date of resolution is set, assume it's successful.
     if ($this->date_resolved && !$this->resolution_id) {
         $this->resolution_id = JobResolution::SUCCEEDED;
     }
     parent::save($options);
 }
Ejemplo n.º 3
0
 public function __get($key)
 {
     static $collections = ['speakers', 'sponsors', 'communitySponsors', 'talks', 'rooms', 'hotels', 'jobs', 'individualSponsors'];
     if (in_array($key, $collections, true)) {
         $data = $this->database->get($key);
         foreach ($data as &$item) {
             $item = new Model($item, $this->database);
         }
         return new Collection($data);
     }
     return parent::__get($key);
 }
Ejemplo n.º 4
0
 /**
  * @return array
  */
 public function toArray()
 {
     return parent::toArray() + ['inventories' => $this->inventories, 'users' => $this->users, 'hookUrl' => config('app.url') . action('HookController@pull', [$this->id], false)];
 }
Ejemplo n.º 5
0
 function __construct()
 {
     parent::__construct();
 }
Ejemplo n.º 6
0
 public function index()
 {
     $model = new Model();
     $view = new Principal();
     $view->mostrar($model->get());
 }
Ejemplo n.º 7
0
 public function toArray()
 {
     return parent::toArray() + ["remote" => sprintf("%s/git/%s/%s", env('APP_URL'), $this->repo->id, $this->name)];
 }
Ejemplo n.º 8
0
 /**
  * @return array
  */
 public function getDates()
 {
     return array_merge(parent::getDates(), ['started_at']);
 }
Ejemplo n.º 9
0
 /**
  * @param string $attr
  * @param string $value
  * @param string $attrs
  * @return bool|Nette\Database\IRow|Nette\Database\Row
  */
 public function findBy($attr, $value, $attrs = 'id, username, email, first_name, last_name, password, role')
 {
     return parent::findBy($attr, $value, $attrs);
 }