/** * Retrieves a FilterCollection instance from the given ObjectManager. * * @param \Doctrine\Common\Persistence\ObjectManager $om * @throws \Gedmo\Exception\InvalidArgumentException * @return mixed */ private function getFilterCollectionFromObjectManager(ObjectManager $om) { if (is_callable(array($om, 'getFilters'))) { return $om->getFilters(); } else { if (is_callable(array($om, 'getFilterCollection'))) { return $om->getFilterCollection(); } } throw new \Gedmo\Exception\InvalidArgumentException("ObjectManager does not support filters"); }