mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-20 02:55:13 +00:00
Add constructor, ditch ArrayObject
This commit is contained in:
parent
c8b4d54d37
commit
56c25b1c8d
1 changed files with 13 additions and 0 deletions
|
@ -47,6 +47,19 @@ class ASObject
|
|||
public $canSearch;
|
||||
public $commentPolicy;
|
||||
|
||||
public function __construct($array = null)
|
||||
{
|
||||
if ($array && is_array($array)) {
|
||||
foreach ($array as $key => $value) {
|
||||
if ($key === '@context') {
|
||||
$key = 'ldcontext';
|
||||
}
|
||||
if (property_exists($this,$key)) {
|
||||
$this->{$key} = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue