This repository has been archived on 2024-07-27. You can view files and clone it, but cannot push or open issues or pull requests.
keksAccount/app/Data/Entitiy/Base.php

18 lines
380 B
PHP
Raw Permalink Normal View History

2019-12-02 13:26:32 +00:00
<?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;
}
}