Skip to content

Commit

Permalink
Updated getModel()
Browse files Browse the repository at this point in the history
  • Loading branch information
FarhanShares authored Jun 13, 2020
1 parent 84aa7eb commit 51a6681
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,19 @@ protected function setTable(string $table): Model
}


protected function getModel(): Selection
/**
* Get the Context Active Table Selection for a model
* Similar to calling $this->db->table('table_name');
*
* @param string|null $table
* @return Selection
*/
protected function getModel(string $table = null): Selection
{
return $this->db->table(($this->table));
if ($table === null) {
return $this->db->table(($this->table));
}
return $this->db->table($table);
}


Expand Down

0 comments on commit 51a6681

Please sign in to comment.