Phue\Client::getTransport PHP 메소드

getTransport() 공개 메소드

Get transport
public getTransport ( ) : Phue\Transport\TransportInterface
리턴 Phue\Transport\TransportInterface Transport
    public function getTransport()
    {
        // Set transport if haven't
        if ($this->transport === null) {
            $this->setTransport(new Http($this));
        }
        return $this->transport;
    }

Usage Example

예제 #1
0
파일: GetLights.php 프로젝트: sqmk/phue
 /**
  * Send command
  *
  * @param Client $client
  *            Phue Client
  *
  * @return Light[] List of Light objects
  */
 public function send(Client $client)
 {
     // Get response
     $response = $client->getTransport()->sendRequest("/api/{$client->getUsername()}/lights");
     $lights = array();
     foreach ($response as $lightId => $attributes) {
         $lights[$lightId] = new Light($lightId, $attributes, $client);
     }
     return $lights;
 }
All Usage Examples Of Phue\Client::getTransport