/** * Creates a new record auth code and returns a hash value to send by email as an auth code. * * @param array $row The submitted form data * @return string The auth code */ protected function generateAuthCode($row) { /** @var \Tx\Authcode\Domain\Model\AuthCode $authCode */ $authCode = $this->objectManager->get('Tx\\Authcode\\Domain\\Model\\AuthCode'); $authCode->setReferenceTableUidField($this->uidField); $authCode->setReferenceTableHiddenField($this->hiddenField); $this->authCodeRepository->generateRecordAuthCode($authCode, $this->action, $this->table, $row[$this->uidField]); return $authCode->getAuthCode(); }
/** * Generates a new auth code based on the given row data and clears * all other auth codes that reference the same row * * @param array $row * @param string $action * @param string $table * @param string $uidField * @param string $hiddenField * @return string * @deprecated Since 0.7.0, will be removed in version 1.0.0, use AuthCodeRecordRepository instead. * @see \Tx\Authcode\Domain\Repository\AuthCodeRepository::generateRecordAuthCode() * */ public function generateAuthCode($row, $action, $table, $uidField, $hiddenField) { $authCode = $this->createAuthCode(); $authCode->setReferenceTableHiddenField($hiddenField); $authCode->setReferenceTableUidField($uidField); $authCode->setAdditionalData($row); $this->authCodeRepository->generateRecordAuthCode($authCode, $action, $table, $row[$uidField]); return $authCode->getAuthCode(); }