You are here

public function Profile::setActive in Profile 2 8

Sets the published status of a profile.

Parameters

bool $actvie: TRUE to set this profile to active, FALSE to set it to inactive.

Return value

\Drupal\profile\ProfileInterface The called profile entity.

Overrides ProfileInterface::setActive

File

src/Entity/Profile.php, line 259
Contains \Drupal\profile\Entity\Profile.

Class

Profile
Defines the profile entity class.

Namespace

Drupal\profile\Entity

Code

public function setActive($active) {
  $this
    ->set('status', $active ? PROFILE_ACTIVE : PROFILE_NOT_ACTIVE);
  return $this;
}