getActiveJobs() is on the JobeetJobTable class because in the context of
calling that method, those jobs aren't attached to any other entity. You
have no data currently loaded and you want to load only active ones.

The category getActiveJobs() is working off the basis of getting active jobs
*in that* category and so the method exists off that class. If it wasn't
then you would need to override getActiveJobs on the job table class to take
a category and filter, which you could totally do, and have the category one
call it with its category id.

I hope that makes some sense. It is really a question of design preference.
getActiveJobs on the category object allows you to have a method with no
arguments which reduces the margin for error because logic is encapsulated
from the caller.

On Tue, Dec 14, 2010 at 09:28, Andre Lopes <lopes80an...@gmail.com> wrote:

> Hi,
>
> I have read the text, but I can't figure out the following:
>
> In the example with Jobeet website:
>
> I have the "public function getActiveJobs()" in the
> JobeetJobTable.class.php
> and then I have the "public function getActiveJobs()" in the
> JobeetCategory.class.php
>
> What is the reason for this?
>
> In the *Table.class.php I have only methods controlling the table and in
> the *class.php I have methods controlling the "Object actions"?
>
> I wait for reply.
>
> Best Regards,
>
>
> On Tue, Dec 14, 2010 at 12:16 PM, Stefan Paschke <
> symfony.pasc...@gmail.com> wrote:
>
>> yes you can:
>> http://www.symfony-project.org/gentle-introduction/1_4/en/08-Inside-the-Model-Layer-Doctrine#chapter_08_sub_object_and_table_classes
>>
>> On Dec 14, 2010, at 1:02 PM, Andre Lopes wrote:
>>
>> > There are 2 classes for each Table, for example:
>> >
>> > JobeetJob.class.php and JobeetJobTable.class.php
>> >
>> > What is the difference between the two, what I must put in each one? Can
>> I find an answer for this online?
>> >
>> >
>> > Best Regards,
>>
>>
>> --
>> If you want to report a vulnerability issue on symfony, please send it to
>> security at symfony-project.com
>>
>> You received this message because you are subscribed to the Google
>> Groups "symfony users" group.
>> To post to this group, send email to symfony-users@googlegroups.com
>> To unsubscribe from this group, send email to
>> symfony-users+unsubscr...@googlegroups.com<symfony-users%2bunsubscr...@googlegroups.com>
>> For more options, visit this group at
>> http://groups.google.com/group/symfony-users?hl=en
>>
>
>  --
> If you want to report a vulnerability issue on symfony, please send it to
> security at symfony-project.com
>
> You received this message because you are subscribed to the Google
> Groups "symfony users" group.
> To post to this group, send email to symfony-users@googlegroups.com
> To unsubscribe from this group, send email to
> symfony-users+unsubscr...@googlegroups.com<symfony-users%2bunsubscr...@googlegroups.com>
> For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=en
>



-- 
Alex Pilon
(613) 608-1480

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to