Merge pull request #47 from AoSiX/patch-1

Test if model class is instanciable
This commit is contained in:
Barry vd. Heuvel
2013-12-17 03:04:30 -08:00
@@ -141,7 +141,13 @@ class ModelsCommand extends Command {
$this->properties = array();
$this->methods = array();
if(class_exists($name)){
try{
try {
// handle abstract classes, interfaces, ...
$reflectionClass = new \ReflectionClass($name);
if (!$reflectionClass->IsInstantiable()) {
throw new \Exception($name . ' is not instanciable.');
}
$model = new $name();
$this->getPropertiesFromTable($model);
$this->getPropertiesFromMethods($model);