X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FBaseModel.php;h=41320d8bd5bcf528529b9a6f623babf9bfe84508;hb=d2ea3eabfb1f70324ff4fa7e7055e2c8a7dbc3d3;hp=4e4259170872ea23977c24ef7a425f52b4675575;hpb=92692218255145124fb553d6b61d1d9fed27da19;p=friendica.git diff --git a/src/BaseModel.php b/src/BaseModel.php index 4e42591708..41320d8bd5 100644 --- a/src/BaseModel.php +++ b/src/BaseModel.php @@ -1,4 +1,23 @@ . + * + */ namespace Friendica; @@ -12,7 +31,7 @@ use Psr\Log\LoggerInterface; * * @property int id */ -abstract class BaseModel +abstract class BaseModel extends BaseEntity { /** @var Database */ protected $dba; @@ -122,7 +141,7 @@ abstract class BaseModel protected function checkValid() { - if (empty($this->data['id'])) { + if (!isset($this->data['id']) || is_null($this->data['id'])) { throw new HTTPException\InternalServerErrorException(static::class . ' record uninitialized'); } }