Add `setImplementedComponentClasses` to specify that a Component satisfies the contracts for another Component
leoloso opened this issue · comments
Leonardo Losoviz commented
If an extension depends on a 3rd party library, and the library is not installed/active in the site, we may get an error:
PHP Fatal error: Uncaught Exception: The following names have not been implemented by the CMS: "popcomponent:locations:dbcolumn:orderby:locations:name", "popcomponent:events:dbcolumn:orderby:events:startdate". Hence, we can't continue.
To fix it, the Component
with the contracts must implement resolveEnabled
asking if hasImplementerComponent
is true
. If false
, the package must not be loaded.
Eg: events
depends on events-wp-em
which depends on events-manager
. Then:
EventsWPEM\Component
is loaded only if theevents-manager
plugin is loadedEventsWPEM\Component
must indicate it satisfiesEvents\Component
- If satisfied,
Events\Component
is loaded, otherwise it is not.