I use the following line in many places, and I want to make it
shorter.. since I will never be pulling the information for ALL
organizations..
$this->campaigns =
Doctrine::getTable('Campaign')->getCampaigns($this->getUser()->getGuardUser()->Organization);
I created the method getCampaigns
class CampaignTable extends Doctrine_Table
{
public function getCampaigns(Organization $organization = null)
{
$q = Doctrine_Query::create()
->from('Campaign c')
->where('c.organization_id =?', $organization->id);
return $q->execute();
}
Should I have done this differently? If not, then how could I just do
$this-campaigns = Doctrine:getCampaigns(); // Get all campaigns for
logged in user... ?
Thank you.
--
You received this message because you are subscribed to the Google Groups
"symfony users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en.