コード例 #1
0
ファイル: SolrFacade.php プロジェクト: rmzamora/SolrBundle
 /**
  * @param MetaInformation $metaInformation
  * @param object $entity
  * @throws \BadMethodCallException if callback method not exists
  * @return boolean
  */
 private function addToIndex(MetaInformation $metaInformation, $entity)
 {
     if (!$metaInformation->hasSynchronizationFilter()) {
         return true;
     }
     $callback = $metaInformation->getSynchronizationCallback();
     if (!method_exists($entity, $callback)) {
         throw new \BadMethodCallException(sprintf('unknown method %s in entity %s', $callback, get_class($entity)));
     }
     return $entity->{$callback}();
 }