Implemented repository mapper, and venta show
This commit is contained in:
@ -7,6 +7,19 @@ abstract class Model implements Define\Model
|
||||
{
|
||||
public int $id;
|
||||
|
||||
protected array $factories;
|
||||
|
||||
public function addFactory(string $property, Define\Repository\Factory $factory): Model
|
||||
{
|
||||
$this->factories[$property] = $factory;
|
||||
return $this;
|
||||
}
|
||||
|
||||
protected function runFactory(string $property): mixed
|
||||
{
|
||||
return $this->factories[$property]->run();
|
||||
}
|
||||
|
||||
public function jsonSerialize(): mixed
|
||||
{
|
||||
return [
|
||||
|
Reference in New Issue
Block a user