Skip to content

Commit

Permalink
Add method __call
Browse files Browse the repository at this point in the history
  • Loading branch information
davidecesarano committed Jun 18, 2021
1 parent 7a14c76 commit a563b7b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Embryo/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,17 @@ public static function __callStatic(string $method, $args)
$model = new static();
return $model->pdo->table($model->table)->$method(...$args);
}

/**
* Invoking inaccessible methods in
* an object context.
*
* @param string $method
* @param string[] $args
* @return mixed
*/
public function __call(string $method, $args)
{
return $this->pdo->table($this->table)->$method(...$args);
}
}

0 comments on commit a563b7b

Please sign in to comment.