publicKey = $this->generateToken(64); } /** * @param int $length * @return bool|string */ private function generateToken($length = 64){ $hash = ""; while(strlen($hash) < $length){ try { $hash .= hash('sha512', random_bytes($length)); } catch (\Exception $e) { $hash .= hash('sha512', mt_rand(0,$length*10000)); } } return substr($hash, 0,$length); } public function getId(): ?int { return $this->id; } public function getTypeUniqId(): ?string { return $this->typeUniqId; } public function setTypeUniqId(string $typeUniqId): self { $this->typeUniqId = $typeUniqId; return $this; } public function getName(): ?string { return $this->name; } public function setName(string $name): self { $this->name = $name; return $this; } public function getParametersName(): ?array { return $this->parametersName; } public function setParametersName(array $parametersName): self { $this->parametersName = $parametersName; return $this; } public function getCustom(): ?bool { return $this->custom; } public function setCustom(bool $custom): self { $this->custom = $custom; return $this; } public function getPublicKey(): ?string { return $this->publicKey; } public function setPublicKey(string $publicKey): self { $this->publicKey = $publicKey; return $this; } public function getCategory(): ?string { return $this->category; } public function setCategory(string $category): self { $this->category = $category; return $this; } /** * @return string */ public function getManager(): string { return $this->manager; } /** * @param string $manager * @return AGridModuleType */ public function setManager(string $manager): AGridModuleType { $this->manager = $manager; return $this; } /** * @return string */ public function getFunctionRenderingFront(): string { return $this->function_rendering_front; } /** * @param string $function_rendering_front * @return AGridModuleType */ public function setFunctionRenderingFront(string $function_rendering_front): AGridModuleType { $this->function_rendering_front = $function_rendering_front; return $this; } /** * @return string */ public function getFunctionRenderingBack(): string { return $this->function_rendering_back; } /** * @param string $function_rendering_back * @return AGridModuleType */ public function setFunctionRenderingBack(string $function_rendering_back): AGridModuleType { $this->function_rendering_back = $function_rendering_back; return $this; } }