コード例 #1
0
ファイル: Inventory.php プロジェクト: AidasK/dogpro
 public function save(array $options = [])
 {
     if (empty($this->public_key) || empty($this->private_key)) {
         $this->generateKeys();
     }
     return parent::save($options);
 }
コード例 #2
0
ファイル: Job.php プロジェクト: samwilson/asset-manager
 /**
  * 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);
 }
コード例 #3
0
ファイル: Conference.php プロジェクト: andrewwoods/pnwphp.com
 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);
 }
コード例 #4
0
ファイル: Repo.php プロジェクト: AidasK/dogpro
 /**
  * @return array
  */
 public function toArray()
 {
     return parent::toArray() + ['inventories' => $this->inventories, 'users' => $this->users, 'hookUrl' => config('app.url') . action('HookController@pull', [$this->id], false)];
 }
コード例 #5
0
ファイル: testmodel.php プロジェクト: WeihuaGu/incolor
 function __construct()
 {
     parent::__construct();
 }
コード例 #6
0
ファイル: Home.php プロジェクト: rajinha92/php-mvc
 public function index()
 {
     $model = new Model();
     $view = new Principal();
     $view->mostrar($model->get());
 }
コード例 #7
0
ファイル: Inventory.php プロジェクト: dzirg44/dogpro
 public function toArray()
 {
     return parent::toArray() + ["remote" => sprintf("%s/git/%s/%s", env('APP_URL'), $this->repo->id, $this->name)];
 }
コード例 #8
0
ファイル: Release.php プロジェクト: dzirg44/dogpro
 /**
  * @return array
  */
 public function getDates()
 {
     return array_merge(parent::getDates(), ['started_at']);
 }
コード例 #9
0
ファイル: UserModel.php プロジェクト: janeczko/vpp
 /**
  * @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);
 }