Sorry this was wrong... you would have
interface IProject {}
interface ILocalProject extends IProject {}
interface ISoftwareProject extends IProject {}
interface IIssue {}
interface IComplaint extends IIssue {}
interface IBugReport extends IIssue {}
cllass LocalModel extends AppModel implements ILocalProject, IComplaint {
public $actsAs = array( 'LocalProject', 'Complaint' );
...
}
class SoftwareModel extends AppModel implements ISoftwareProject,
IBugReport {
public $actsAs = array( 'SoftwareProject', 'BugReport' );
...
}
Your factory could then have 2 methods:
getProject() would return the model that implemented the correct IProject
derived interface.
getIssue() would return the model that implemented the correct IIssue
derived interface
So your code would be something like:
DoSomethingWithProject( factory->getProject() );
function DoSomethingWithProject( IProject $project ) {
....
}
and DoSomethingWithProject() would be free to call any function defined in
the base project interface definition.
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP related questions.
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at
http://groups.google.com/group/cake-php