find() public method

Execute a query for a single record by ID.
public find ( integer $id, array $columns = ['*'] ) : mixed | static
$id integer
$columns array
return mixed | static
 /**
  * Find notification by id
  *
  * @param $notification_id
  * @return \Illuminate\Database\Eloquent\Collection|\Illuminate\Database\Eloquent\Model|static
  */
 public function find($notification_id)
 {
     return $this->notification->find($notification_id);
 }
 /**
  * Find an entry.
  *
  * @param                           $identifier
  * @param  array                    $columns
  * @return Presenter|EntryPresenter
  */
 public function find($identifier, array $columns = ['*'])
 {
     return (new Decorator())->decorate($this->query->find($identifier, $columns));
 }
Ejemplo n.º 3
0
 /**
  * Find record by its primary key.
  *
  * @param int $id
  *
  * @return Model
  */
 public function find($id)
 {
     $this->buildQuery();
     return $this->query->find($id);
 }
Ejemplo n.º 4
0
 /**
  * Execute a query for a single record by ID.
  *
  * @param int   $id      ID
  * @param array $columns get columns
  * @return mixed|static
  */
 public function find($id, $columns = ['*'])
 {
     if ($this->dynamic === false) {
         return parent::find($id, $columns);
     }
     if ($this->proxy === true) {
         $this->getProxyManager()->first($this);
     }
     return parent::find($id, $columns);
 }