| @@ 144-156 (lines=13) @@ | ||
| 141 | * |
|
| 142 | * @return WriteQueryInterface |
|
| 143 | */ |
|
| 144 | public function write($instance, $entity = null) |
|
| 145 | { |
|
| 146 | list($instance, $entity) = $this->reassignEntity($instance, $entity); |
|
| 147 | ||
| 148 | return new WriteQuery( |
|
| 149 | $this->connection, |
|
| 150 | $instance, |
|
| 151 | $this->models->get($entity), |
|
| 152 | $this->factory, |
|
| 153 | $this->accessor, |
|
| 154 | $this->dispatcher |
|
| 155 | ); |
|
| 156 | } |
|
| 157 | ||
| 158 | /** |
|
| 159 | * Sets update operation |
|
| @@ 166-178 (lines=13) @@ | ||
| 163 | * |
|
| 164 | * @return UpdateQueryInterface |
|
| 165 | */ |
|
| 166 | public function update($instance, $entity = null) |
|
| 167 | { |
|
| 168 | list($instance, $entity) = $this->reassignEntity($instance, $entity); |
|
| 169 | ||
| 170 | return new UpdateQuery( |
|
| 171 | $this->connection, |
|
| 172 | $instance, |
|
| 173 | $this->models->get($entity), |
|
| 174 | $this->factory, |
|
| 175 | $this->accessor, |
|
| 176 | $this->dispatcher |
|
| 177 | ); |
|
| 178 | } |
|
| 179 | ||
| 180 | /** |
|
| 181 | * Sets insert operation |
|
| @@ 188-200 (lines=13) @@ | ||
| 185 | * |
|
| 186 | * @return InsertQueryInterface |
|
| 187 | */ |
|
| 188 | public function insert($instance, $entity = null) |
|
| 189 | { |
|
| 190 | list($instance, $entity) = $this->reassignEntity($instance, $entity); |
|
| 191 | ||
| 192 | return new InsertQuery( |
|
| 193 | $this->connection, |
|
| 194 | $instance, |
|
| 195 | $this->models->get($entity), |
|
| 196 | $this->factory, |
|
| 197 | $this->accessor, |
|
| 198 | $this->dispatcher |
|
| 199 | ); |
|
| 200 | } |
|
| 201 | ||
| 202 | /** |
|
| 203 | * Sets delete operation |
|
| @@ 210-222 (lines=13) @@ | ||
| 207 | * |
|
| 208 | * @return DeleteQueryInterface |
|
| 209 | */ |
|
| 210 | public function delete($instance, $entity = null) |
|
| 211 | { |
|
| 212 | list($instance, $entity) = $this->reassignEntity($instance, $entity); |
|
| 213 | ||
| 214 | return new DeleteQuery( |
|
| 215 | $this->connection, |
|
| 216 | $instance, |
|
| 217 | $this->models->get($entity), |
|
| 218 | $this->factory, |
|
| 219 | $this->accessor, |
|
| 220 | $this->dispatcher |
|
| 221 | ); |
|
| 222 | } |
|
| 223 | ||
| 224 | /** |
|
| 225 | * Reassigns entity/instance variables if entity is object |
|