You are here

function rules_condition_fc_complete in Field Complete 7

1 string reference to 'rules_condition_fc_complete'
fc_rules_condition_info in ./fc.rules.inc
Implements hook_rules_condition_info().

File

./fc.rules.inc, line 49
Field Complete - Provides field-based completeness for any entity -rules.

Code

function rules_condition_fc_complete(EntityDrupalWrapper $wrapper) {

  // Fetch the raw entity
  $entity = $wrapper
    ->value();

  // Fetch/re-calculate the entity's completeness if necessary
  if (empty($entity->fc)) {
    $entity->fc = fcComplete::load($wrapper
      ->type(), $entity);
  }
  return (bool) $entity->fc->complete;
}