public function testGetByTitle() { $xml = file_get_contents(__DIR__ . '/xml/spreadsheet-feed.xml'); $spreadsheetFeed = new SpreadsheetFeed($xml); $this->assertTrue($spreadsheetFeed->getByTitle('Test Spreadsheet') instanceof Spreadsheet); $this->assertTrue(is_null($spreadsheetFeed->getByTitle('No Spreadsheet'))); }
public function getLastUpdatedAt($spreadsheetName, $worksheetName, $format = 'Y-m-d H:i:s') { $spreadsheet = $this->spreadsheetFeed->getByTitle($spreadsheetName); if (is_null($spreadsheet)) { throw new FriendlySpreadSheetException(sprintf('Spreadsheet %s is not found', $spreadsheetName)); } $worksheetFeed = $spreadsheet->getWorksheets(); $worksheet = $worksheetFeed->getByTitle($worksheetName); if (is_null($worksheet)) { throw new FriendlySpreadSheetException(sprintf('Worksheet %s is not found', $worksheetName)); } return $worksheet->getUpdated()->format($format); }