private function addRelation(Definition $definition, $filter, $urlType, $relationType)
    {
        if (empty($filter['relations'][$urlType][$relationType])) {
            return;
        }

        $relation = new Definition(
            sprintf('ONGR\FilterManagerBundle\Relation\%sRelation', ucfirst($relationType)),
            [$filter['relations'][$urlType][$relationType]]
        );
        $definition->addMethodCall(
            'set' . ucfirst($urlType) . 'Relation',
            [$relation]
        );
    }