You are here

public function CommerceFileLicenseEntity::is_unlimited in Commerce File 7

Returns true if all limits are unlimited

File

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

Class

CommerceFileLicenseEntity
A Commerce File License entity class.

Code

public function is_unlimited() {
  $limits = $this
    ->get_limits();

  // if no limits, then technically unlimited
  if (empty($limits)) {
    return TRUE;
  }

  // check if all limits are unlimited
  $unlimited_count = 0;
  foreach ($limits as $limit_value) {
    if ($this
      ->check_limit_is_unlimited($limit_value)) {
      $unlimited_count++;
    }
  }
  return $unlimited_count == count($limits);
}