49 lines
1.1 KiB
PHP
49 lines
1.1 KiB
PHP
<?php
|
|
namespace ProVM\Concept\Model;
|
|
|
|
use ProVM\Concept\Model;
|
|
use Psr\Container\ContainerInterface;
|
|
|
|
interface Factory
|
|
{
|
|
/**
|
|
* @param ContainerInterface $container
|
|
* @return Factory
|
|
*/
|
|
public function setContainer(ContainerInterface $container): Factory;
|
|
|
|
/**
|
|
* @return ContainerInterface
|
|
*/
|
|
public function getContainer(): ContainerInterface;
|
|
|
|
/**
|
|
* Get Repository by class
|
|
* @param string $repository_class
|
|
* @return Repository
|
|
*/
|
|
public function get(string $repository_class): Repository;
|
|
|
|
/**
|
|
* Get Repository by Model class
|
|
* @param string $model_class
|
|
* @return Repository
|
|
*/
|
|
public function getByModel(string $model_class): Repository;
|
|
|
|
/**
|
|
* Fetch Model by Id
|
|
* @param string $model_class
|
|
* @param int $id
|
|
* @return Model
|
|
*/
|
|
public function fetchById(string $model_class, int $id): Model;
|
|
|
|
/**
|
|
* Fetch all Models
|
|
* @param string $model_class
|
|
* @return array
|
|
*/
|
|
public function fetchAll(string $model_class): array;
|
|
}
|