18 lines
380 B
PHP
18 lines
380 B
PHP
|
<?php
|
||
|
namespace App\Data\Entity;
|
||
|
|
||
|
class Base {
|
||
|
public function load($attributes) : bool
|
||
|
{
|
||
|
foreach ($attributes as $key => $value) {
|
||
|
if (property_exists($this, $key)) {
|
||
|
$this->$key = $value;
|
||
|
} else {
|
||
|
throw new \Exception("Entitiy has no property ".$key);
|
||
|
}
|
||
|
}
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
}
|