You are here

public function CommerceFileLicenseEntity::set_status in Commerce File 7

Status

  • Read / Write

File

includes/commerce_file_license.entity.inc, line 268
Provides a base class for CommerceFileLicenseEntity.

Class

CommerceFileLicenseEntity
A Commerce File License entity class.

Code

public function set_status($value) {
  $statuses = commerce_file_license_statuses();
  if (!isset($statuses[$value])) {
    throw new Exception("Invalid Status: Attempted to set license status to an invalid value of '{$value}'.");
  }

  // update status
  $this->status = $value;

  // update state to corresponding state of status
  $this
    ->set_state($statuses[$value]['state']);
  return $this;
}