}
 public function addAdapter(AdapterInterface $adapter, $priority = 0)
 {
     $this->adapters[$adapter->getName()] = array('adapter' => $adapter, 'priority' => $priority, 'selected' => false);
     return $this->sortAdapters();
 /**
  * @param AdapterInterface $adapter
  * @param string|null      $message
  * @param \Exception|null  $previous
  */
 public function __construct(AdapterInterface $adapter, $message = null, \Exception $previous = null)
 {
     $this->adapter = $adapter;
     parent::__construct($message ?: 'Search failed with "' . $adapter->getName() . '" adapter.', $previous);
 }
Пример #3
0
 /**
  * Registers a finder engine implementation.
  *
  * @param AdapterInterface $adapter  An adapter instance
  * @param int              $priority Highest is selected first
  *
  * @return Finder The current Finder instance
  *
  * @deprecated since 2.8, to be removed in 3.0.
  */
 public function addAdapter(AdapterInterface $adapter, $priority = 0)
 {
     @trigger_error('The ' . __METHOD__ . ' method is deprecated since version 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
     $this->initDefaultAdapters();
     $this->adapters[$adapter->getName()] = array('adapter' => $adapter, 'priority' => $priority, 'selected' => false);
     return $this->sortAdapters();
 }