1 | <?php |
||
25 | class IdentityMapper |
||
26 | { |
||
27 | /** |
||
28 | * @var FlexibleEntityInterface[] |
||
29 | */ |
||
30 | protected $instances = []; |
||
31 | |||
32 | /** |
||
33 | * getSignature |
||
34 | * |
||
35 | * Compute a unique signature upon entity's values in its primary key. If |
||
36 | * an empty primary key is provided, null is returned. |
||
37 | * |
||
38 | * @static |
||
39 | * @access public |
||
40 | * @param FlexibleEntityInterface $entity |
||
41 | * @param array $primary_key |
||
42 | * @return string |
||
43 | */ |
||
44 | public static function getSignature(FlexibleEntityInterface $entity, array $primary_key) |
||
52 | |||
53 | /** |
||
54 | * fetch |
||
55 | * |
||
56 | * Pool FlexibleEntityInterface instances and update them if necessary. |
||
57 | * |
||
58 | * @access public |
||
59 | * @param FlexibleEntityInterface $entity |
||
60 | * @param array $primary_key |
||
61 | * @return FlexibleEntityInterface |
||
62 | */ |
||
63 | public function fetch(FlexibleEntityInterface $entity, array $primary_key) |
||
80 | |||
81 | /** |
||
82 | * clear |
||
83 | * |
||
84 | * Flush instances from the identity mapper. |
||
85 | * |
||
86 | * @access public |
||
87 | * @return IdentityMapper $this |
||
88 | */ |
||
89 | public function clear() |
||
95 | } |
||
96 |