Fix model create annotations

[MAILPOET-2535]
This commit is contained in:
Pavel Dohnal
2019-11-19 10:21:13 +01:00
committed by Jack Kitterhing
parent e252118d2b
commit 25b2edab8a
2 changed files with 7 additions and 3 deletions

View File

@ -138,10 +138,14 @@ class Model extends \Sudzy\ValidModel {
} }
/** /**
* @return bool|static * @return static
*/ */
static function create() { static function create() {
return parent::create(); $created = parent::create();
if (is_bool($created)) {
throw new \Exception('ORM is not initialised');
}
return $created;
} }
/** /**

View File

@ -2,7 +2,7 @@
namespace Sudzy; namespace Sudzy;
/** /**
* @method static ORMWrapper|bool create($data=null) * @method static static|bool create($data=null)
*/ */
abstract class ValidModel extends \Model { abstract class ValidModel extends \Model {
protected $_validator = null; // Reference to Sudzy validator object protected $_validator = null; // Reference to Sudzy validator object