| @@ 24-75 (lines=52) @@ | ||
| 21 | * @author Ivannis Suárez Jerez <[email protected]> |
|
| 22 | * @author Karel Osorio Ramírez <[email protected]> |
|
| 23 | */ |
|
| 24 | abstract class LazyList extends LazyCollection implements ListInterface |
|
| 25 | { |
|
| 26 | /** |
|
| 27 | * {@inheritdoc} |
|
| 28 | */ |
|
| 29 | public function add($element) |
|
| 30 | { |
|
| 31 | $this->lazyInitialize(); |
|
| 32 | ||
| 33 | $this->collection()->add($element); |
|
| 34 | } |
|
| 35 | ||
| 36 | /** |
|
| 37 | * {@inheritdoc} |
|
| 38 | */ |
|
| 39 | public function addAll($elements) |
|
| 40 | { |
|
| 41 | $this->lazyInitialize(); |
|
| 42 | ||
| 43 | $this->collection()->addAll($elements); |
|
| 44 | } |
|
| 45 | ||
| 46 | /** |
|
| 47 | * {@inheritdoc} |
|
| 48 | */ |
|
| 49 | public function remove($element) |
|
| 50 | { |
|
| 51 | $this->lazyInitialize(); |
|
| 52 | ||
| 53 | return $this->collection()->remove($element); |
|
| 54 | } |
|
| 55 | ||
| 56 | /** |
|
| 57 | * {@inheritdoc} |
|
| 58 | */ |
|
| 59 | public function removeAll($elements) |
|
| 60 | { |
|
| 61 | $this->lazyInitialize(); |
|
| 62 | ||
| 63 | return $this->collection()->removeAll($elements); |
|
| 64 | } |
|
| 65 | ||
| 66 | /** |
|
| 67 | * {@inheritdoc} |
|
| 68 | */ |
|
| 69 | public function findOne(SpecificationInterface $criteria) |
|
| 70 | { |
|
| 71 | $this->lazyInitialize(); |
|
| 72 | ||
| 73 | return $this->collection()->findOne($criteria); |
|
| 74 | } |
|
| 75 | } |
|
| 76 | ||
| @@ 24-75 (lines=52) @@ | ||
| 21 | * @author Ivannis Suárez Jerez <[email protected]> |
|
| 22 | * @author Karel Osorio Ramírez <[email protected]> |
|
| 23 | */ |
|
| 24 | abstract class LazySet extends LazyCollection implements SetInterface |
|
| 25 | { |
|
| 26 | /** |
|
| 27 | * {@inheritdoc} |
|
| 28 | */ |
|
| 29 | public function add($element) |
|
| 30 | { |
|
| 31 | $this->lazyInitialize(); |
|
| 32 | ||
| 33 | $this->collection()->add($element); |
|
| 34 | } |
|
| 35 | ||
| 36 | /** |
|
| 37 | * {@inheritdoc} |
|
| 38 | */ |
|
| 39 | public function addAll($elements) |
|
| 40 | { |
|
| 41 | $this->lazyInitialize(); |
|
| 42 | ||
| 43 | $this->collection()->addAll($elements); |
|
| 44 | } |
|
| 45 | ||
| 46 | /** |
|
| 47 | * {@inheritdoc} |
|
| 48 | */ |
|
| 49 | public function remove($element) |
|
| 50 | { |
|
| 51 | $this->lazyInitialize(); |
|
| 52 | ||
| 53 | return $this->collection()->remove($element); |
|
| 54 | } |
|
| 55 | ||
| 56 | /** |
|
| 57 | * {@inheritdoc} |
|
| 58 | */ |
|
| 59 | public function removeAll($elements) |
|
| 60 | { |
|
| 61 | $this->lazyInitialize(); |
|
| 62 | ||
| 63 | return $this->collection()->removeAll($elements); |
|
| 64 | } |
|
| 65 | ||
| 66 | /** |
|
| 67 | * {@inheritdoc} |
|
| 68 | */ |
|
| 69 | public function findOne(SpecificationInterface $criteria) |
|
| 70 | { |
|
| 71 | $this->lazyInitialize(); |
|
| 72 | ||
| 73 | return $this->collection()->findOne($criteria); |
|
| 74 | } |
|
| 75 | } |
|
| 76 | ||