mapped.php
583 Bytes
<?php
class Flora_Mapped
{
public $cachetime;
public function __construct($data, Flora_Api $api)
{
$ref = new ReflectionClass($this);
foreach ($data as $k => $v) {
if ($k{0} == "_") {
continue;
}
if (!$ref->hasProperty($k) && $api->getDebug()) {
throw new Exception("Not found " . get_class($this) . "::$" . $k . " property");
}
$this->$k = $v;
}
$this->onFillData($api);
}
protected function onFillData(Flora_Api $api)
{
}
}