Feature #319
Support setter injection without configuration through "inject" methods
Status: | Resolved | Start date: | 2008-02-18 | |
---|---|---|---|---|
Priority: | Should have | Due date: | ||
Assigned To: | Robert Lemke | % Done: | 100% |
|
Category: | Object | |||
Target version: | - | |||
PHP Version: | Complexity: | |||
Has patch: |
Description
Currently setter injection is only possible via setter methods whose name follows the scheme "setPropertyName". These dependencies need to be configured explicitly in the Components.ini file because autowiring is not possible in this case.
It would be nice if there was (additionally) support for "inject" methods (setter methods with names like "injectPropertyName"). By convention these methods would be recognized as setters for dependencies and could be autowired.
inject* methods should be preferred over set* methods.
Associated revisions
- FLOW3: (Component) Removed support for setter injection via generic "setProperty()" method.
- FLOW3: (Component) Setter injection is now also possible via a "inject" method, e.g. injectSomeDependency() (instead of setSomeDependency). All methods whose name starts with "inject" will be included into the autowiring procedure. Therefore dependencies don't need to be configured explicitly in the Components.ini when "inject" methods are used. Resolves #319.
- FLOW3: (Component) Added autowiring support for "inject" setter methods. Addresses #319.
- Smarty: Added check against multiple definition of "SMARTY_DIR"
- Testing, TYPO3, PhoneBookTutorial: Refactored to the new "inject*" methods in the action controllers.
History
#1 Updated by Robert Lemke about 7 years ago
- Target version deleted (
18)