You are here

public function fcComplete::fetch in Field Complete 7

File

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

Class

fcComplete
@file Field Complete - Provides field-based completeness for any entity - class.

Code

public function fetch() {
  $fc = db_select('fc', 'fc')
    ->fields('fc', array(
    'complete',
    'percentage',
    'completeness',
  ))
    ->condition('entity_type', $this->entity_type)
    ->condition('entity_id', $this->entity_id)
    ->condition('revision_id', $this->revision_id)
    ->execute()
    ->fetchObject();
  if (empty($fc)) {
    $this
      ->completeness();
  }
  else {
    $this->complete = $fc->complete;
    $this->percentage = $fc->percentage;
    $this->completeness = $fc->completeness;
  }
}