private function getFiles(Content $entity) { $fileManager = new FileManager($entity); $files = array(); $findFiles = $fileManager->getFileList(); foreach ($findFiles as $findFile) { $file = array('label' => $findFile->getName(), 'link' => $this->generateUrl('web_engine_cms_get_file', array('id' => $entity->getId(), 'filename' => $findFile->getName(), 'size' => ' ')), 'delete_' => $this->generateUrl('web_engine_cms_delete_file', array('id' => $entity->getId(), 'filename' => $findFile->getName()))); if ($findFile->getIsImage()) { $file['img'] = $this->generateUrl('web_engine_cms_get_file', array('id' => $entity->getId(), 'filename' => $findFile->getName(), 'size' => ' ')); } $files[] = $file; } return $files; }
function __construct(Content $entity) { $this->storageDirectory = dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'storage' . DIRECTORY_SEPARATOR . $entity->getId(); $this->content = $entity; $this->fileSystem = new Filesystem(); }