attributes as $attribute) { if (property_exists(Content::class, $attribute->name)) { $item->{$attribute->name} = $attribute->value; } } } /** * @param DOMNode|null $node * * @return Content */ public static function read(?DOMNode $node = null): Content { $content = new Content(); if ($node instanceof DOMNode) { self::_loadChildAttributes($content, $node); } return $content; } }