| @@ 233-249 (lines=17) @@ | ||
| 230 | /** | |
| 231 |      * {@inheritdoc} | |
| 232 | */ | |
| 233 | public function remove($key) | |
| 234 |     { | |
| 235 | $removed = parent::remove($key); | |
| 236 |         if (!$removed) { | |
| 237 | return $removed; | |
| 238 | } | |
| 239 | $this->changed(); | |
| 240 | if ($this->association !== null && | |
| 241 | $this->association['type'] & ApiMetadata::TO_MANY && | |
| 242 | $this->owner && | |
| 243 | $this->association['orphanRemoval'] | |
| 244 |         ) { | |
| 245 | $this->manager->getUnitOfWork()->scheduleOrphanRemoval($removed); | |
| 246 | } | |
| 247 | ||
| 248 | return $removed; | |
| 249 | } | |
| 250 | ||
| 251 | /** | |
| 252 |      * {@inheritdoc} | |
| @@ 474-483 (lines=10) @@ | ||
| 471 | * | |
| 472 | * @return array | |
| 473 | */ | |
| 474 | public function slice($offset, $length = null) | |
| 475 |     { | |
| 476 |         if (!$this->initialized && !$this->isDirty && $this->association['fetch'] === ApiMetadata::FETCH_EXTRA_LAZY) { | |
| 477 | $persister = $this->manager->getUnitOfWork()->getCollectionPersister($this->association); | |
| 478 | ||
| 479 | return $persister->slice($this, $offset, $length); | |
| 480 | } | |
| 481 | ||
| 482 | return parent::slice($offset, $length); | |
| 483 | } | |
| 484 | ||
| 485 | /** | |
| 486 | * Cleans up internal state of cloned persistent collection. | |