/** * Convert file entity to array format * * @param File $file * * @return array */ public function convertFileEntityToArray(File $file) { $params = $file->getParams(); $directory = $file->getDirectory(); $fileData = array('id' => $file->getId(), 'dirId' => $directory ? $directory->getId() : 0, 'name' => $file->getName(), 'src' => $file->getPath(), 'mime' => $params->getMime(), 'width' => $params->getWidth(), 'height' => $params->getHeight()); return $fileData; }