Elastica\Connection::setEnabled PHP Method

setEnabled() public method

Enables a connection.
public setEnabled ( boolean $enabled = true )
$enabled boolean OPTIONAL (default = true)
    public function setEnabled($enabled = true)
    {
        return $this->setParam('enabled', $enabled);
    }

Usage Example

Example #1
0
 /**
  * @group unit
  */
 public function testEnabledDisable()
 {
     $connection = new Connection();
     $this->assertTrue($connection->isEnabled());
     $connection->setEnabled(false);
     $this->assertFalse($connection->isEnabled());
     $connection->setEnabled(true);
     $this->assertTrue($connection->isEnabled());
 }
All Usage Examples Of Elastica\Connection::setEnabled