Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | public function addFilterConstraint(ClassMetadata $targetEntity, $targetTableAlias) |
||
12 | { |
||
13 | if (!$targetEntity->reflClass->implementsInterface('Tahoe\Bundle\MultiTenancyBundle\Model\TenantAwareInterface')) { |
||
14 | return ""; |
||
15 | } |
||
16 | |||
17 | // it would be easier (and probably less hackish) if I just wrote $column = "tenant_id" |
||
18 | //$column = $targetEntity |
||
19 | // ->getAssociationsByTargetClass('Tahoe\Bundle\MultiTenancyBundle\Model\MultiTenantTenantInterface') |
||
20 | //['tenant']['targetToSourceKeyColumns']['id']; |
||
21 | $column = 'tenant_id'; |
||
22 | |||
23 | return $targetTableAlias . '.' . $column . ' = ' . $this->getParameter('tenantId'); |
||
24 | } |
||
25 | } |
||
26 |