I am creating a system which manages projects. Each projects' behaviour can be customized by custom PHP class called c11n, that the project's owner can create by extending my parent c11nBase class. It works well when handling single project at a time (in my code) but once I started creating a script that works with multiple projects at once, the classnames start to clash - because each child class is called c11n.
How to go around this? Is there a better pattern for behaviour custimization using child classes?
I can of course make sure, that each child class is named differently e.g. project1c11n extends c11nBase, project2c11n extends c11nBase etc. but I don't want to keep track of the classnames somewhere else, I want everything to be encapsulated in the customization file. I would need something like "instantiate the single class defined in that file".
Projects\XYZ”