, , , ... MyModel :
class MyModelTable extends Doctrine_Table
{
public function createTenantAwareQuery($userId)
{
$q = $this->createQuery('m')
->where('tenant_id = ', $userId);
return $q;
}
}
:
$myVar = Doctrine_Core::getTable('MyModel')->createTenantAwareQuery()
->where('something = ', $value);
Thus, if necessary, you create an "Animated request for the tenant" ... you simply use this function when necessary ... Even in the admin generator in the configuration file, there is a way to override the default request method:
config:
list:
table_method: retrieveTenantAwareResult
It remains only to create this method.
Hope this answer will work for you =)
rDeeb source
share