|
15 | 15 | use RecursiveIteratorIterator; |
16 | 16 | use Traversable; |
17 | 17 | use Zend\Stdlib\ArrayUtils; |
| 18 | +use Zend\Stdlib\ErrorHandler; |
18 | 19 |
|
19 | 20 | /** |
20 | 21 | * Zend_Navigation_Container |
@@ -154,7 +155,7 @@ public function addPages($pages) |
154 | 155 | ); |
155 | 156 | } |
156 | 157 |
|
157 | | - // Because adding a page to a container removes it from the original |
| 158 | + // Because adding a page to a container removes it from the original |
158 | 159 | // (see {@link Page\AbstractPage::setParent()}), iteration of the |
159 | 160 | // original container will break. As such, we need to iterate the |
160 | 161 | // container into an array first. |
@@ -237,7 +238,7 @@ public function removePages() |
237 | 238 | * Checks if the container has the given page |
238 | 239 | * |
239 | 240 | * @param Page\AbstractPage $page page to look for |
240 | | - * @param bool $recursive [optional] whether to search recursively. |
| 241 | + * @param bool $recursive [optional] whether to search recursively. |
241 | 242 | * Default is false. |
242 | 243 | * @return bool whether page is in container |
243 | 244 | */ |
@@ -348,7 +349,10 @@ public function findBy($property, $value, $all = false) |
348 | 349 | */ |
349 | 350 | public function __call($method, $arguments) |
350 | 351 | { |
351 | | - if (@preg_match('/(find(?:One|All)?By)(.+)/', $method, $match)) { |
| 352 | + ErrorHandler::start(E_WARNING); |
| 353 | + $result = preg_match('/(find(?:One|All)?By)(.+)/', $method, $match); |
| 354 | + ErrorHandler::stop(); |
| 355 | + if ($result) { |
352 | 356 | return $this->{$match[1]}($match[2], $arguments[0]); |
353 | 357 | } |
354 | 358 |
|
|
0 commit comments