Closed nekromoff closed 9 years ago
fixed by adding this function so it's easy to fetch by spreadsheet URL / ID:
/**
* Gets a spreadhseet from the feed by its ID.
*
* @param string $title
*
* @return \Google\Spreadsheet\Spreadsheet|null
*/
public function getByID($ID)
{
foreach($this->xml->entry as $entry) {
if($entry->id->__toString() == $ID) {
return new Spreadsheet($entry);
}
}
return null;
}
I've just tested this and it works fine:
$service = new SpreadsheetService(); $spreadsheetFeed = $service->getSpreadsheets(); $spreadsheet = $spreadsheetFeed->getByTitle("Darčekové kódy"); echo $spreadsheet->getTitle()."\n";
It outputs the title correctly in utf-8.
Also there is no need to fetch a list of spreadsheets if you know the id of the spreadsheet you want. This method is already available in the SpreadsheetService class.
DarÄekové kódy instead of Darčekové kódy
therefore I am unable to match correct UTF-8 and this function returns null.