User::block

public User::block()

Blocks the user.

Return value

\Drupal\user\UserInterface The called user entity.

Overrides UserInterface::block

File

core/modules/user/src/Entity/User.php, line 296

Class

User
Defines the user entity class.

Namespace

Drupal\user\Entity

Code

public function block() {
  $this->get('status')->value = 0;
  return $this;
}
doc_Drupal
2016-10-29 09:52:04
Comments
Leave a Comment

Please login to continue.