mirror of
https://github.com/friendica/friendica
synced 2025-04-24 02:30:13 +00:00
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:
parent
4c5856da2b
commit
74f3a2f90c
7 changed files with 203 additions and 218 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue