public function addFilterConstraint(ClassMetadata $targetEntity, $targetTableAlias)
    {
        if (!$targetEntity->reflClass->implementsInterface(Tenantable::class)) {
            return '';
        }

        $tenant = trim($this->getParameter('tenant'), '\'');

        if ('' === $tenant) {
            $constraint = sprintf('%s.tenant is NULL', $targetTableAlias);
        } else {
            $constraint = sprintf('%s.tenant = \'%s\'', $targetTableAlias, $tenant);
        }

        return $constraint;
    }