Filter content in symfony 1.2.x generator?

I have a Symfony 1.2.7 application where 3 different sites coexist in the same database. All content has a foreign key, 'site_id', which tells which site it belongs to.

In my created admin interface, I want to be able to display content from the currently selected site (actually installed using the filter class based on the domain used to access the admin interface).

Example:

Using "www.domain.com/admin/", the user has access to content belonging to the domain.com domain (with site_id = 1) and only this site.

Any ideas on how to achieve this?

Thanks in advance

0
source share
1 answer

you can use the table_method parameter in the .yml generator of your content module:

config: ... list: table_method: getSiteContent ... 

then write a method in the Content_Table class that modifies the request object:

 public function getSiteContent(Doctrine_Query $q) { $q->andWhere( some where condition with site_id ); return $q; } 
+1
source

All Articles