[TYPO3-mvc] extbase: relations simple question

Thomas "Thasmo" Deinhamer thasmo at gmail.com
Mon Feb 15 19:57:10 CET 2010


You can of course use both ways, if you like:

$projects = $client->getProjects();
$client = $project->getClient();

Greatings,
Thomas

Am 15.02.2010 19:49, schrieb Dmitri Pusarev:
> 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