2017-11-21 23:15:32 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace TclUpdates;
|
|
|
|
|
|
|
|
class GotuObject
|
|
|
|
{
|
|
|
|
private $attrs = array();
|
|
|
|
|
|
|
|
public function __construct()
|
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2017-12-10 15:55:02 +00:00
|
|
|
public function __isset($attr)
|
|
|
|
{
|
|
|
|
return array_key_exists($attr, $this->attrs);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function __get($attr)
|
|
|
|
{
|
|
|
|
if (!$this->__isset($attr)) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
return $this->attrs[$attr];
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getAttrs()
|
|
|
|
{
|
|
|
|
return $this->attrs;
|
|
|
|
}
|
|
|
|
|
2017-11-21 23:15:32 +00:00
|
|
|
public static function fromXmlParser(XmlParser $xp)
|
|
|
|
{
|
|
|
|
if (!$xp->validateGOTU()) {
|
2017-12-10 15:55:02 +00:00
|
|
|
return null;
|
2017-11-21 23:15:32 +00:00
|
|
|
}
|
|
|
|
$g = new self();
|
2017-12-12 00:50:56 +00:00
|
|
|
$attrs = $xp->getAttrs();
|
|
|
|
if ($attrs['fv'] == 'AAA000') {
|
|
|
|
$attrs['fv'] = null;
|
|
|
|
}
|
|
|
|
$g->attrs = $attrs;
|
2017-11-21 23:15:32 +00:00
|
|
|
return $g;
|
|
|
|
}
|
|
|
|
}
|