You are here

public function EntityLegalDocument::userHasAgreed in Entity Legal 7

Same name and namespace in other branches
  1. 7.2 entity_legal.entity.inc \EntityLegalDocument::userHasAgreed()

Check if the given user has agreed to the current version of this document.

Parameters

object $account: The Drupal user account to check. Default logged in user if not provided.

Return value

bool Whether or not the user has agreed to the current version.

File

./entity_legal.entity.inc, line 263
Entity API main classes used by entity_legal module.

Class

EntityLegalDocument
Legal Document entity with revision support.

Code

public function userHasAgreed($account = NULL) {
  if (empty($account)) {
    global $user;
    $account = $user;
  }
  return count($this
    ->getAcceptances($account)) > 0;
}