/**
  * Constructs a new Google Translate API client.
  * 
  * @param array|string $sourceText A single string or an array of strings to translate.
  * @param Adapter $adapter The adapter used to make the API request.
  */
 public function __construct($sourceText = null, Adapter $adapter = null)
 {
     if ($sourceText !== null) {
         $this->setSourceText($sourceText);
     }
     parent::__construct($adapter);
 }
Ejemplo n.º 2
0
 /**
  * Constructs a new Google CustomSearch API client.
  * 
  * @param string $query The search expression.
  * @param Adapter $adapter The adapter used to make the API request.
  */
 public function __construct($query = null, Adapter $adapter = null)
 {
     if ($query !== null) {
         $this->setQuery($query);
     }
     parent::__construct($adapter);
 }