We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 9ad5f2a + b5ca14f commit fb82cdcCopy full SHA for fb82cdc
src/Google/Spreadsheet/SpreadsheetFeed.php
@@ -100,4 +100,24 @@ public function getByTitle($title)
100
throw new SpreadsheetNotFoundException();
101
}
102
103
+ /**
104
+ * Gets a spreadhseet from the feed by its ID in google drive.
105
+ *
106
+ * @param string $id
107
108
+ * @return Spreadsheet
109
110
+ * @throws SpreadsheetNotFoundException
111
+ */
112
+ public function getById($id)
113
+ {
114
+ foreach($this->xml->entry as $entry) {
115
+ if($entry->id->__toString() == $id) {
116
+ return new Spreadsheet($entry);
117
+ }
118
119
+
120
+ throw new SpreadsheetNotFoundException();
121
122
123
0 commit comments