MCPcopy Create free account
hub / github.com/Rello/analytics / listWorksheetNames

Method listWorksheetNames

lib/Datasource/LocalSpreadsheet.php:82–92  ·  view source on GitHub ↗

* List worksheet names without loading the workbook's cell data. */

(string $userId, string $path)

Source from the content-addressed store, hash-verified

80 * List worksheet names without loading the workbook's cell data.
81 */
82 public function listWorksheetNames(string $userId, string $path): array {
83 $file = $this->rootFolder->getUserFolder($userId)->get($path);
84 if (!$file instanceof \OCP\Files\File) {
85 throw new \InvalidArgumentException('Spreadsheet path is not a file');
86 }
87
88 include_once __DIR__ . '/../../vendor/autoload.php';
89 $fileName = $file->getStorage()->getLocalFile($file->getInternalPath());
90 $reader = IOFactory::createReader(IOFactory::identify($fileName));
91 return $reader->listWorksheetNames($fileName);
92 }
93
94 /**
95 * Read the Data

Calls 5

getUserFolderMethod · 0.80
getLocalFileMethod · 0.80
getStorageMethod · 0.80
getInternalPathMethod · 0.80
getMethod · 0.45