1 EntityReferenceBehaviorHandler.inc public EntityReferenceBehaviorHandler::__construct($behavior)

Constructor for the behavior.

Parameters

$behavior: The name of the behavior plugin.

Overrides EntityReferenceBehaviorHandlerInterface::__construct

File

core/modules/entityreference/plugins/behavior/EntityReferenceBehaviorHandler.inc, line 157

Class

EntityReferenceBehaviorHandler
An abstract implementation of EntityReferenceBehaviorHandlerInterface.

Code

public function __construct($behavior) {
  $this->behavior = $behavior;

  $plugins = _entityreference_behavior_plugins();
  if (!empty($plugins[$behavior])) {
    $this->plugin = $plugins[$behavior];
  }
}