Chris@0: &$alterable, Chris@0: * 'unalterable' => $unalterable, Chris@0: * 'foo' => 'bar', Chris@0: * ); Chris@0: * $this->alter('mymodule_data', $alterable1, $alterable2, $context); Chris@0: * @endcode Chris@0: * Chris@0: * Note that objects are always passed by reference in PHP5. If it is Chris@0: * absolutely required that no implementation alters a passed object in Chris@0: * $context, then an object needs to be cloned: Chris@0: * @code Chris@0: * $context = array( Chris@0: * 'unalterable_object' => clone $object, Chris@0: * ); Chris@0: * $this->alter('mymodule_data', $data, $context); Chris@0: * @endcode Chris@0: * Chris@0: * @param string|array $type Chris@0: * A string describing the type of the alterable $data. 'form', 'links', Chris@0: * 'node_content', and so on are several examples. Alternatively can be an Chris@0: * array, in which case $theme_TYPE_alter() is invoked for each value in the Chris@0: * array. When Form API is using $this->alter() to Chris@0: * execute both $theme_form_alter() and $theme_form_FORM_ID_alter() Chris@0: * implementations, it passes array('form', 'form_' . $form_id) for $type. Chris@0: * @param mixed $data Chris@0: * The variable that will be passed to $theme_TYPE_alter() implementations Chris@0: * to be altered. The type of this variable depends on the value of the Chris@0: * $type argument. For example, when altering a 'form', $data will be a Chris@0: * structured array. When altering a 'profile', $data will be an object. Chris@0: * @param mixed $context1 Chris@0: * (optional) An additional variable that is passed by reference. Chris@0: * @param mixed $context2 Chris@0: * (optional) An additional variable that is passed by reference. If more Chris@0: * context needs to be provided to implementations, then this should be an Chris@0: * associative array as described above. Chris@0: * Chris@0: * @see \Drupal\Core\Extension\ModuleHandlerInterface Chris@0: */ Chris@0: public function alter($type, &$data, &$context1 = NULL, &$context2 = NULL); Chris@0: Chris@0: /** Chris@0: * Provides an alter hook for a specific theme. Chris@0: * Chris@0: * Similar to ::alter, it also invokes the alter hooks for the base themes. Chris@0: * Chris@0: * @param \Drupal\Core\Theme\ActiveTheme $theme Chris@0: * A manually specified theme. Chris@0: * @param string|array $type Chris@0: * A string describing the type of the alterable $data. Chris@0: * @param mixed $data Chris@0: * The variable that will be passed to $theme_TYPE_alter() implementations Chris@0: * @param mixed $context1 Chris@0: * (optional) An additional variable that is passed by reference. Chris@0: * @param mixed $context2 Chris@0: * (optional) An additional variable that is passed by reference. Chris@0: * Chris@0: * @see ::alter Chris@0: */ Chris@0: public function alterForTheme(ActiveTheme $theme, $type, &$data, &$context1 = NULL, &$context2 = NULL); Chris@0: Chris@0: }