Warning: This page has not been updated in over over a year and may be outdated or deprecated.
development:plugins:auto_injection_interfaces
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
vufind2:auto_injection_interfaces [2014/06/13 13:14] – external edit 127.0.0.1 | development:plugins:auto_injection_interfaces [2017/11/01 20:01] – [Auto Injection Interfaces] demiankatz | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Auto Injection Interfaces ====== | ====== Auto Injection Interfaces ====== | ||
- | Any VuFind plugin accessed through a [[general_plugin_information|standard plugin interface]] can implement certain " | + | Any VuFind plugin accessed through a [[development: |
Here are the relevant interfaces: | Here are the relevant interfaces: | ||
Line 9: | Line 9: | ||
* \VuFindHttp\HttpServiceAwareInterface - Get access to the VuFind\Http service | * \VuFindHttp\HttpServiceAwareInterface - Get access to the VuFind\Http service | ||
* \Zend\Log\LoggerAwareInterface - Get access to the VuFind\Logger service | * \Zend\Log\LoggerAwareInterface - Get access to the VuFind\Logger service | ||
- | * \Zend\ServiceManager\ServiceLocatorAwareInterface - Get access to the plugin manager that constructed the current object | + | * \Zend\ServiceManager\ServiceLocatorAwareInterface - Get access to the plugin manager that constructed the current object |
+ | * \ZfcRbac\Service\AuthorizationServiceAwareInterface - Get access to the authorization service (for permission checks) | ||
- | You can also implement a setPluginManager() method as an alternative to implementing the \Zend\ServiceManager\ServiceLocatorAwareInterface; | + | You can also implement a setPluginManager() method as an alternative to implementing the \Zend\ServiceManager\ServiceLocatorAwareInterface; |
+ | |||
+ | ===== Traits ===== | ||
+ | |||
+ | Starting with VuFind 2.4, Traits are provided which can be used in addition to interfaces to automatically implement interface-specific methods (and in some case, useful related utility methods). These Traits can help to reduce redundancy in your code: | ||
+ | |||
+ | * \VuFind\Db\Table\DbTableAwareTrait | ||
+ | * \VuFind\I18n\Translator\TranslatorAwareTrait | ||
+ | * \VuFindHttp\HttpServiceAwareTrait | ||
+ | * \VuFind\Log\LoggerAwareTrait | ||
+ | * \Zend\ServiceManager\ServiceLocatorAwareTrait | ||
+ | * \ZfcRbac\Service\AuthorizationServiceAwareInterface | ||
---- struct data ---- | ---- struct data ---- | ||
---- | ---- | ||
development/plugins/auto_injection_interfaces.txt · Last modified: 2020/03/03 20:26 by demiankatz