Implemented repository mapper, and venta show
This commit is contained in:
27
app/common/Implement/Repository/Factory.php
Normal file
27
app/common/Implement/Repository/Factory.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
namespace Incoviba\Common\Implement\Repository;
|
||||
|
||||
use Closure;
|
||||
use Incoviba\Common\Define;
|
||||
|
||||
class Factory implements Define\Repository\Factory
|
||||
{
|
||||
public Closure $callable;
|
||||
public array $args;
|
||||
|
||||
public function setCallable(callable $callable): Define\Repository\Factory
|
||||
{
|
||||
$this->callable = $callable(...);
|
||||
return $this;
|
||||
}
|
||||
public function setArgs(array $args): Define\Repository\Factory
|
||||
{
|
||||
$this->args = $args;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function run(): mixed
|
||||
{
|
||||
return call_user_func_array($this->callable, $this->args);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user