[TYPO3-mvc] extbase: relations simple question

Dmitri Pusarev dimaip at gmail.com
Mon Feb 15 19:49:05 CET 2010


OK, I think I can make my question more specific:
a) $projects = $client->getProjects();
b) $this->projectRepository->findByClient($client);
Which is better to get all projects for given client, a) or b)?


Dmitri Pusarev wrote:
> Hey!
> In my model I have a Client and a Project. Relations which pop into my 
> mind from the business domain:
> a)Client has a relation projects with Project, 0..*(fk).
> b)Project has a relation client with Client, 0..1.
> Should I create both a) and b)? Or just a) is enough?
> 
> In the database language(which I more used to), I would just create a 
> field 'client' in the table 'Projects'.
> 
> Sorry, I'm still learning!
> 
> Cheers,
> Dmitri.


More information about the TYPO3-project-typo3v4mvc mailing list