__construct() public method

Construct transport.
public __construct ( Connection $connection = null )
$connection Elastica\Connection Connection object
Example #1
0
 /**
  * Construct transport
  *
  * @param \Elastica\Connection $connection Connection object
  * @throws \Elastica\Exception\RuntimeException
  */
 public function __construct(Connection $connection = null)
 {
     parent::__construct($connection);
     if (!class_exists('Elasticsearch\\RestClient')) {
         throw new RuntimeException('Elasticsearch\\RestClient class not found. Check that suggested package munkie/elasticsearch-thrift-php is required in composer.json');
     }
 }
Example #2
0
 /**
  * Construct transport.
  */
 public function __construct(Connection $connection = null, HttpAdapterInterface $httpAdapter)
 {
     parent::__construct($connection);
     $this->httpAdapter = $httpAdapter;
 }