/** * @return LibraryCollection */ public function getList() { $collection = new LibraryCollection(); if (!file_exists($this->vendorsDir . '/../composer.json')) { return $collection; } $data = json_decode(file_get_contents($this->vendorsDir . '/../composer.json')); if (empty($data->require)) { return $collection; } foreach ($data->require as $name => $version) { $collection->add(new Library($name, $version)); } return $collection; }
/** * Delete all images from a folder * @param Folder $Folder - Folder object * @return bool - true if successful, else false */ public function deleteImagesFromFolder(Folder $Folder){ $LibraryCollection = new LibraryCollection($this->CTCTRequest); return $LibraryCollection->deleteImagesFromFolder($this->CTCTRequest->baseUri.$Folder->link.'/images'); }
/** * {@inheritdoc} * @throws LogicException If collection is frozen for mutations. */ public function offsetUnset($offset) { if ($this->frozen) { throw new LogicException('Library collection can not be mutated in this context.'); } parent::offsetUnset($offset); }