public function __construct($name, $path, $url, $extension)
 {
     parent::__construct($name, $path, $url, $extension);
     $this->type = self::NAME;
     $fileName = basename($this->path);
     // extension of thumb is alway jpg !
     $fileNameWithoutExtension = substr($this->path, 0, strrpos($path, '.'));
     $this->thumbNailPath = dirname($fileNameWithoutExtension) . '/thumb/' . basename($fileNameWithoutExtension) . '.jpg';
     $this->thumbNailUrl = dirname($this->url) . '/thumb/' . utf8_encode(basename($fileNameWithoutExtension)) . '.jpg';
 }
Exemplo n.º 2
0
function bindFileEntity($fileEntity)
{
    if ($fileEntity != null) {
        $fileDto = new FileDto();
        $fileDto->setFileId($fileEntity->getFileId());
        $fileDto->setGuid($fileEntity->getGuid());
        $fileDto->setName($fileEntity->getName());
        $fileDto->setEffFrm($fileEntity->getEffFrm());
        return $fileDto;
    } else {
        return null;
    }
}