public function TransformerExtender::__construct in Facebook Instant Articles 7.2
Transformer constructor.
Adds Drupal hook to allow transformer rules to be added by other modules. We invoke the hook in a constructor - as opposed to inside transform() or a new invokeRules() method - because of the way Transformer is normally used.
Note the parent class does not have a constructor, so we do not call
parent::__construct();
.
See also
hook_fb_instant_articles_transformer_rules()
File
- src/
TransformerExtender.php, line 32 - Contains \Drupal\fb_instant_articles\TransformerExtender.
Class
- TransformerExtender
- Encapsulates Drupal-specific logic when using the Transformer class.
Namespace
Drupal\fb_instant_articlesCode
public function __construct() {
$rules = module_invoke_all('fb_instant_articles_transformer_rules');
drupal_alter('fb_instant_articles_transformer_rules', $rules);
$this
->addRules($rules);
}