You are here

public function AgreementHandlerInterface::agree in Agreement 3.0.x

Same name and namespace in other branches
  1. 8.2 src/AgreementHandlerInterface.php \Drupal\agreement\AgreementHandlerInterface::agree()

Accept the agreement for an user account.

Parameters

\Drupal\agreement\Entity\Agreement $agreement: The agreement that the user is agreeing to.

\Drupal\Core\Session\AccountProxyInterface $account: The user account to agree.

int $agreed: An optional integer to set the agreement status to. Defaults to 1.

Return value

bool|\Symfony\Component\HttpFoundation\Cookie TRUE if the operation was successful and the user is authenticated, a cookie if the operation was successful and the user is anonymous, otherwise FALSE.

1 method overrides AgreementHandlerInterface::agree()
AgreementHandler::agree in src/AgreementHandler.php
Accept the agreement for an user account.

File

src/AgreementHandlerInterface.php, line 65

Class

AgreementHandlerInterface
Agreement handler interface.

Namespace

Drupal\agreement

Code

public function agree(Agreement $agreement, AccountProxyInterface $account, $agreed = 1);