Implemented repository mapper, and venta show
This commit is contained in:
9
app/common/Define/Repository/Factory.php
Normal file
9
app/common/Define/Repository/Factory.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
namespace Incoviba\Common\Define\Repository;
|
||||
|
||||
interface Factory
|
||||
{
|
||||
public function setCallable(callable $callable): Factory;
|
||||
public function setArgs(array $args): Factory;
|
||||
public function run(): mixed;
|
||||
}
|
15
app/common/Define/Repository/Mapper.php
Normal file
15
app/common/Define/Repository/Mapper.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
namespace Incoviba\Common\Define\Repository;
|
||||
|
||||
interface Mapper
|
||||
{
|
||||
public function setProperty(string $property): Mapper;
|
||||
public function setFunction(callable $function): Mapper;
|
||||
public function setFactory(Factory $factory): Mapper;
|
||||
public function setDefault(mixed $value): Mapper;
|
||||
|
||||
public function hasProperty(): bool;
|
||||
public function hasFunction(): bool;
|
||||
public function hasFactory(): bool;
|
||||
public function hasDefault(): bool;
|
||||
}
|
10
app/common/Define/Repository/MapperParser.php
Normal file
10
app/common/Define/Repository/MapperParser.php
Normal file
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
namespace Incoviba\Common\Define\Repository;
|
||||
|
||||
interface MapperParser
|
||||
{
|
||||
public function register(string $column, ?Mapper $mapper = null): MapperParser;
|
||||
public function getColumns(): array;
|
||||
public function hasMapper(string $column): bool;
|
||||
public function getMapper(string $column): Mapper;
|
||||
}
|
Reference in New Issue
Block a user