Fix API result, add PHPDoc and cleanup object construction

Fix missing getters
fix data array
fix missing "$" for template-variables
Remove lazy-loaded parent notification instance (for now..)
This commit is contained in:
nupplaPhil 2020-01-25 20:00:58 +01:00
parent 4c5856da2b
commit 74f3a2f90c
No known key found for this signature in database
GPG key ID: D8365C3D36B77D90
7 changed files with 203 additions and 218 deletions

View file

@ -46,8 +46,6 @@ class Notification extends BaseModel
{
/** @var \Friendica\Repository\Notification */
private $repo;
/** @var $this */
private $parentInst;
public function __construct(Database $dba, LoggerInterface $logger, \Friendica\Repository\Notification $repo, array $data = [])
{
@ -118,28 +116,6 @@ class Notification extends BaseModel
}
}
public function __get($name)
{
$this->checkValid();
$return = null;
switch ($name) {
case 'parent':
if (!empty($this->parent)) {
$this->parentInst = $this->parentInst ?? $this->repo->getByID($this->parent);
$return = $this->parentInst;
}
break;
default:
$return = parent::__get($name);
break;
}
return $return;
}
public function __set($name, $value)
{
parent::__set($name, $value);