* @package taoDelivery */ class TrackedStorage implements ServiceFileStorage, ServiceLocatorAwareInterface { use ServiceLocatorAwareTrait; private $ids = []; private $storage; /** * @param boolean $public * @return \tao_models_classes_service_StorageDirectory */ public function spawnDirectory($public = false) { $directory = $this->getInternalStorage()->spawnDirectory($public); $this->ids[] = $directory->getId(); return $directory; } /** * Returns the id used for this storage * @return array */ public function getSpawnedDirectoryIds() { return $this->ids; } /** * {@inheritDoc} * @see tao_models_classes_service_FileStorage::import() */ public function import($id, $directoryPath) { $this->ids[] = $id; return $this->getInternalStorage()->import($id, $directoryPath); } /** * {@inheritDoc} * @see tao_models_classes_service_FileStorage::getDirectoryById() */ public function getDirectoryById($id) { return $this->getInternalStorage()->getDirectoryById($id); } /** * @return ServiceFileStorage */ protected function getInternalStorage() { if (is_null($this->storage)) { $this->storage = $this->getServiceLocator()->get(ServiceFileStorage::SERVICE_ID); } return $this->storage; } }