1 | <?php |
||
11 | trait OrmPersister |
||
12 | { |
||
13 | /** |
||
14 | * Include statement related functionality |
||
15 | */ |
||
16 | use OrmStatement; |
||
17 | |||
18 | /** |
||
19 | * Set the primary key value after persist |
||
20 | * |
||
21 | * @param string $class |
||
22 | * The name of class of entity |
||
23 | * @param \Nkey\Caribu\Model\AbstractModel $object |
||
24 | * The object where the primary key should be set |
||
25 | * @param mixed $primaryKey |
||
26 | * The primary key value |
||
27 | * @throws OrmException |
||
28 | */ |
||
29 | 10 | private static function setPrimaryKey($class, $object, $primaryKey) |
|
44 | |||
45 | /** |
||
46 | * Persist the mapped-by entities |
||
47 | * |
||
48 | * @param string $class |
||
49 | * The name of class of which the data has to be persisted |
||
50 | * @param \Nkey\Caribu\Model\AbstractModel $object |
||
51 | * The entity which contain mapped-by entries to persist |
||
52 | * |
||
53 | * @throws OrmException |
||
54 | */ |
||
55 | 11 | private static function persistMappedBy(string $class, \Nkey\Caribu\Model\AbstractModel $object) |
|
102 | |||
103 | /** |
||
104 | * Persist inner entity |
||
105 | * |
||
106 | * @param \ReflectionProperty $property |
||
107 | * The property which represents the inner entity |
||
108 | * @param string $class |
||
109 | * The result class name |
||
110 | * @param \Nkey\Caribu\Model\AbstractModel $object |
||
111 | * The object which holds the entity |
||
112 | * @param string $namespace |
||
113 | * The result class namespace |
||
114 | * @param bool $persist |
||
115 | * Whether to persist |
||
116 | * |
||
117 | * @throws OrmException |
||
118 | */ |
||
119 | 13 | private static function persistProperty(\ReflectionProperty $property, string $class, \Nkey\Caribu\Model\AbstractModel $object, string $namespace, bool $persist) |
|
145 | |||
146 | /** |
||
147 | * Persist the entity and all sub entities if necessary |
||
148 | * |
||
149 | * @param string $class |
||
150 | * The name of class of which the data has to be persisted |
||
151 | * @param \Nkey\Caribu\Model\AbstractModel $object |
||
152 | * The entity to persist |
||
153 | * |
||
154 | * @throws OrmException |
||
155 | */ |
||
156 | 13 | private static function persistAnnotated(string $class, \Nkey\Caribu\Model\AbstractModel $object) |
|
168 | } |
||
169 |