/**
* This function should be called for the life cycle events @ORM\PostPersist() and @ORM\PostUpdate()
*/
public function upload()
{
$file = $this->getFile();
parent::upload();
if (static::GENERATE_THUMBNAILS && $file instanceof UploadedFile) {
Model::generateThumbnails(FRONTEND_FILES_PATH . '/' . $this->getTrimmedUploadDir(), $this->getAbsolutePath('source'));
}
}