Added check that the table variable is actually set

This commit is contained in:
Josh Sherman 2012-10-11 21:35:28 -04:00
parent ce61f797f3
commit e05dd7c79e
2 changed files with 12 additions and 0 deletions

View file

@ -293,6 +293,12 @@ class Model extends Object
*/
public function __construct($type_or_parameters = null, $parameters = null)
{
// Errors if a table is not set. You're welcome, Geoff.
if ($this->table == false)
{
throw new Exception('You must set the table variable');
}
// Runs the parent constructor so we have the config
parent::__construct();