dateUpd = new \DateTime(); } /** * @param int $length * @return bool|string * @throws \Exception */ private function generateHumanHash($length = 64){ $hash = ""; while(strlen($hash) < $length){ $hash .= hash('sha512', random_bytes($length)); } return substr($hash, 0,$length); } /** * generate and return a guid for the current request * * @return string */ public function generateGuid(){ $md5 = $this->generateHumanHash(64); $newFileName = time().$md5; $this->guid = $newFileName; return $newFileName; } /** * Get id * * @return int */ public function getId() { return $this->id; } /** * Set guid * * @param string $guid * * @return UploadRequestItem */ public function setGuid($guid) { $this->guid = $guid; return $this; } /** * Get guid * * @return string */ public function getGuid() { return $this->guid; } /** * Set filename * * @param string $filename * * @return UploadRequestItem */ public function setFilename($filename) { $this->filename = $filename; return $this; } /** * Get filename * * @return string */ public function getFilename() { return $this->filename; } /** * Set folderTargetGuid * * @param string $folderTargetGuid * * @return UploadRequestItem */ public function setFolderTargetGuid($folderTargetGuid) { $this->folderTargetGuid = $folderTargetGuid; return $this; } /** * Get folderTargetGuid * * @return string */ public function getFolderTargetGuid() { return $this->folderTargetGuid; } /** * Set filesize * * @param integer $filesize * * @return UploadRequestItem */ public function setFilesize($filesize) { $this->filesize = $filesize; return $this; } /** * Get filesize * * @return int */ public function getFilesize() { return $this->filesize; } /** * Set dateUpd * * @param \DateTime $dateUpd * * @return UploadRequestItem */ public function setDateUpd($dateUpd) { $this->dateUpd = $dateUpd; return $this; } /** * Get dateUpd * * @return \DateTime */ public function getDateUpd() { return $this->dateUpd; } /** * Set remoteIp * * @param string $remoteIp * * @return UploadRequestItem */ public function setRemoteIp($remoteIp) { $this->remoteIp = $remoteIp; return $this; } /** * Get remoteIp * * @return string */ public function getRemoteIp() { return $this->remoteIp; } /** * @param UserFileOwnerInterface $userFileOwnerInterface * @return UploadRequestItem */ public function setUserFileOwnerInterface(UserFileOwnerInterface $userFileOwnerInterface): UploadRequestItem { $this->userFileOwnerInterface = $userFileOwnerInterface; return $this; } /** * @return UserFileOwnerInterface */ public function getUserFileOwnerInterface(): UserFileOwnerInterface { return $this->userFileOwnerInterface; } /** * @param string $sourceParams * @return UploadRequestItem */ public function setSourceParams(string $sourceParams): UploadRequestItem { $this->sourceParams = $sourceParams; return $this; } /** * @return string */ public function getSourceParams(): string { return $this->sourceParams; } }