You are here

public function Profile::setActive in Profile 8

Sets whether the profile is active.

Parameters

bool $active: Whether the profile is active.

Return value

$this

Overrides ProfileInterface::setActive

Deprecated

in Profile 1.0-rc4. Use ::setPublished instead.

File

src/Entity/Profile.php, line 114

Class

Profile
Defines the profile entity class.

Namespace

Drupal\profile\Entity

Code

public function setActive($active) {
  if ((bool) $active) {
    $this
      ->setPublished();
  }
  else {
    $this
      ->setUnpublished();
  }
  return $this;
}