| @@ 169-181 (lines=13) @@ | ||
| 166 | /** |
|
| 167 | * @inheritdoc |
|
| 168 | */ |
|
| 169 | public function incrementItemsByTag($tagName, $step = 1) |
|
| 170 | { |
|
| 171 | if (is_string($tagName) && is_int($step)) { |
|
| 172 | foreach ($this->getItemsByTag($tagName) as $item) { |
|
| 173 | $item->increment($step); |
|
| 174 | $this->saveDeferred($item); |
|
| 175 | } |
|
| 176 | ||
| 177 | return $this->commit(); |
|
| 178 | } else { |
|
| 179 | throw new InvalidArgumentException('$tagName must be a string and $step an integer'); |
|
| 180 | } |
|
| 181 | } |
|
| 182 | ||
| 183 | /** |
|
| 184 | * @inheritdoc |
|
| @@ 202-214 (lines=13) @@ | ||
| 199 | /** |
|
| 200 | * @inheritdoc |
|
| 201 | */ |
|
| 202 | public function decrementItemsByTag($tagName, $step = 1) |
|
| 203 | { |
|
| 204 | if (is_string($tagName) && is_int($step)) { |
|
| 205 | foreach ($this->getItemsByTag($tagName) as $item) { |
|
| 206 | $item->decrement($step); |
|
| 207 | $this->saveDeferred($item); |
|
| 208 | } |
|
| 209 | ||
| 210 | return $this->commit(); |
|
| 211 | } else { |
|
| 212 | throw new InvalidArgumentException('$tagName must be a string and $step an integer'); |
|
| 213 | } |
|
| 214 | } |
|
| 215 | ||
| 216 | /** |
|
| 217 | * @inheritdoc |
|
| @@ 235-247 (lines=13) @@ | ||
| 232 | /** |
|
| 233 | * @inheritdoc |
|
| 234 | */ |
|
| 235 | public function appendItemsByTag($tagName, $data) |
|
| 236 | { |
|
| 237 | if (is_string($tagName)) { |
|
| 238 | foreach ($this->getItemsByTag($tagName) as $item) { |
|
| 239 | $item->append($data); |
|
| 240 | $this->saveDeferred($item); |
|
| 241 | } |
|
| 242 | ||
| 243 | return $this->commit(); |
|
| 244 | } else { |
|
| 245 | throw new InvalidArgumentException('$tagName must be a string'); |
|
| 246 | } |
|
| 247 | } |
|
| 248 | ||
| 249 | /** |
|
| 250 | * @inheritdoc |
|
| @@ 268-280 (lines=13) @@ | ||
| 265 | /** |
|
| 266 | * @inheritdoc |
|
| 267 | */ |
|
| 268 | public function prependItemsByTag($tagName, $data) |
|
| 269 | { |
|
| 270 | if (is_string($tagName)) { |
|
| 271 | foreach ($this->getItemsByTag($tagName) as $item) { |
|
| 272 | $item->prepend($data); |
|
| 273 | $this->saveDeferred($item); |
|
| 274 | } |
|
| 275 | ||
| 276 | return $this->commit(); |
|
| 277 | } else { |
|
| 278 | throw new InvalidArgumentException('$tagName must be a string'); |
|
| 279 | } |
|
| 280 | } |
|
| 281 | ||
| 282 | /** |
|
| 283 | * @inheritdoc |
|