Example #1
0
 /**
  * Find a model by its primary key.
  *
  * @param  array  $id
  * @param  array  $columns
  * @return \Nova\Database\ORM\Model|Collection|static
  */
 public function findMany($id, $columns = array('*'))
 {
     if (empty($id)) {
         return $this->model->newCollection();
     }
     $this->query->whereIn($this->model->getQualifiedKeyName(), $id);
     return $this->get($columns);
 }
Example #2
0
 /**
  * Get the fully qualified parent key name.
  *
  * @return string
  */
 public function getQualifiedParentKeyName()
 {
     return $this->parent->getQualifiedKeyName();
 }
Example #3
0
 /**
  * Get the key for comparing against the parent key in "has" query.
  *
  * @return string
  */
 public function getHasCompareKey()
 {
     return $this->farParent->getQualifiedKeyName();
 }