1 | <?php |
||
13 | class ORMContext |
||
|
|||
14 | { |
||
15 | |||
16 | private $dbContext; |
||
17 | private static $instance; |
||
18 | private $cache; |
||
19 | private $modelFactory; |
||
20 | |||
21 | private function __construct(ModelFactoryInterface $modelFactory, DbContext $dbContext, Cache $cache) |
||
27 | 36 | ||
28 | 36 | public static function initialize(ModelFactoryInterface $modelFactory, DbContext $dbContext, Cache $cache) : ORMContext |
|
33 | 36 | ||
34 | 36 | /** |
|
35 | * A helper for loading a method described as a string. |
||
36 | * @param string $path Model name as string |
||
37 | * @return \nibii\RecordWrapper |
||
38 | * @throws NibiiException |
||
39 | */ |
||
40 | public function load($path) |
||
49 | |||
50 | /** |
||
51 | * Returns a class name for junction models needed to perform joint queries. |
||
52 | * @param string $classA |
||
53 | * @param string $classB |
||
54 | * @return string |
||
55 | */ |
||
56 | public function joinModels($classA, $classB) |
||
61 | 4 | ||
62 | 4 | /** |
|
63 | * @param RecordWrapper $instance |
||
64 | */ |
||
65 | public function getModelTable($instance) |
||
70 | 36 | ||
71 | 36 | /*public function getClassName($model, $context = null) |
|
72 | { |
||
73 | return $this->container->singleton(interfaces\ModelClassResolverInterface::class) |
||
74 | 14 | ->getModelClassName($model, $context); |
|
75 | }*/ |
||
76 | 14 | ||
77 | 14 | /** |
|
78 | * @param string $class |
||
79 | */ |
||
80 | public function getModelName($class) |
||
84 | |||
85 | 28 | public static function getInstance() |
|
92 | |||
93 | 36 | public function getCache() |
|
97 | |||
98 | 36 | public function getConfig() |
|
102 | |||
103 | 28 | /** |
|
104 | * |
||
105 | * @return \ntentan\atiaa\DbContext |
||
106 | */ |
||
107 | public function getDbContext() |
||
111 | |||
112 | public function __destruct() |
||
116 | |||
117 | } |
||
118 |