You are here

public static function fcComplete::build in Field Complete 7

5 calls to fcComplete::build()
fcComplete::load in ./fc.inc
fc_entity_delete in ./fc.module
Implements hook_entity_delete().
fc_entity_insert in ./fc.module
Implements hook_entity_insert().
fc_entity_update in ./fc.module
Implements hook_entity_update().
fc_rebuild_process in ./fc.admin.inc
Rebuild the 'fc' table to incorporate all existing entities

File

./fc.inc, line 10
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 static function build($entity_type, $entity) {
  $info = entity_get_info($entity_type);
  $class = $info['fc handler class'];
  if (class_exists($class) && (is_subclass_of($class, 'fcComplete') || ($class = 'fcComplete'))) {
    return new $class($entity_type, $entity);
  }
  throw new Exception(t('fc handler class %class not found or not suitable', array(
    '%class' => $class,
  )));
}