1 | <?php |
||
20 | class EntityManager extends Base |
||
21 | { |
||
22 | /** |
||
23 | * @var string The namespace name of data-mappers repository. |
||
24 | */ |
||
25 | protected $prefix; |
||
26 | |||
27 | /** |
||
28 | * @param \PDO $pdo |
||
29 | * @param string $prefix The data-mappers repository name. |
||
30 | */ |
||
31 | public function __construct(\PDO $pdo, $prefix = '\Pimf') |
||
36 | |||
37 | /** |
||
38 | * @param string $entity The name of the data-mapper class. |
||
39 | * |
||
40 | * @return Base |
||
41 | * @throws \BadMethodCallException If no entity fount at the repository. |
||
42 | */ |
||
43 | public function load($entity) |
||
61 | |||
62 | /** |
||
63 | * @return bool |
||
64 | */ |
||
65 | public function beginTransaction() |
||
69 | |||
70 | /** |
||
71 | * @return bool |
||
72 | */ |
||
73 | public function commitTransaction() |
||
77 | |||
78 | /** |
||
79 | * @return bool |
||
80 | */ |
||
81 | public function rollbackTransaction() |
||
85 | |||
86 | /** |
||
87 | * @param string $entity |
||
88 | * |
||
89 | * @return Base |
||
90 | */ |
||
91 | public function __get($entity) |
||
95 | |||
96 | /** |
||
97 | * @return Database |
||
98 | */ |
||
99 | public function getPDO() |
||
103 | } |
||
104 |