PHP Classes with Same Name
Posted on 2011-02-18
I'm trying to create the architecture for a new website using OOP and I have a question about creating and using class names.
I already have an Events Class and a Staff Class and there are similarities between them. They each have Titles, Locations, Documents, and Descriptions and I would like to create separate classes for each to handle their unique logic.
So, for example, the Events Class would have Title, Location, Document subclasses and the Staff Class would also have Title, Location, Document subclasses. A Title Class would extend Events and a Title Class would extend Staff, etc.
When I try to implement that, I get the error "can't re-declare classes..."
So, my question is: Is there a way to do this (possibly with namespaces?) or am I approaching it incorrectly?