You are here

protected function EntityReference_SelectionHandler_DDF::handleArgs in Dynamic dependent fields 7

Handles arguments for views.

Replaces tokens using token_replace().

Parameters

array $args: Usually $this->field['settings']['handler_settings']['view']['args'].

Return value

array The arguments to be send to the View.

Overrides EntityReference_SelectionHandler_Views::handleArgs

2 calls to EntityReference_SelectionHandler_DDF::handleArgs()
EntityReference_SelectionHandler_DDF::getReferencableEntities in modules/ddf_entityreference/plugins/selection/EntityReference_SelectionHandler_DDF.class.php
Implements EntityReferenceHandler::getReferencableEntities().
EntityReference_SelectionHandler_DDF::validateReferencableEntities in modules/ddf_entityreference/plugins/selection/EntityReference_SelectionHandler_DDF.class.php
Validate that entities can be referenced by this field.

File

modules/ddf_entityreference/plugins/selection/EntityReference_SelectionHandler_DDF.class.php, line 138

Class

EntityReference_SelectionHandler_DDF
Entity handler for Views.

Code

protected function handleArgs($args) {

  // Parameters for token_replace().
  $data = array();
  $options = array(
    'clear' => TRUE,
  );
  if ($this->entity) {
    $data = array(
      $this->entity_type_token => $this->entity,
    );
  }

  // Replace tokens for each argument.
  foreach ($args as $key => $arg) {
    $args[$key] = token_replace($arg, $data, $options);
  }
  return $args;
}