function __construct(array $args = [], $ctype) { if (!in_array($ctype, Client::$contentTypes)) { throw new Client\ClientException('Invalid content type passed', Client\ClientException::CODE_INVALID_CONTENTYPE); } $args['ctype'] = $ctype; parent::__construct($args); }
function __construct($query, array $ctypes, array $args = []) { $args['ctypes'] = $ctypes; if ($query) { $args['search'] = $query; } parent::__construct($args); }
function __construct(array $args = [], array $types = []) { if ($types) { foreach ($types as $type) { if (!in_array($type, Client::$contentTypes)) { throw new Client\ClientException('Invalid content type passed', Client\ClientException::CODE_INVALID_CONTENTYPE); } } $args['ctypes'] = $types; } parent::__construct($args); }