<?php
namespace App\Lidia\DownloadVersion; class Response extends \App\Lidia\ResponseAbstract { protected $filePart = NULL; public function setFilePart($filePart) { $this->filePart = $filePart; } public function getFilePart() { return $this->filePart; } public function getFilePartDecoded() { return base64_decode($this->filePart); } protected function doCheck(\App\MessagesCollector $msgs) { if ($this->status == 'ok' and !$this->filePart) { $msgs->addError(sprintf("The status is `%s`, but file part is not valid.", $this->status)); } if ($this->status == 'ok' and $this->filePart and !$this->getFilePartDecoded()) { $msgs->addError("The file part is not encoded correctly"); } } } 