protected function transformCondition($condition)
    {
        $dispatcher = $GLOBALS['container']['event-dispatcher'];
        $event      = new CreatePropertyConditionEvent($condition, $this->getMetaModel());

        /** @var \Symfony\Component\EventDispatcher\EventDispatcherInterface $dispatcher */
        $dispatcher->dispatch(CreatePropertyConditionEvent::NAME, $event);

        if ($event->getInstance() === null) {
            throw new \RuntimeException(sprintf(
                'Condition of type %s could not be transformed to an instance.',
                $condition['type']
            ));
        }

        return $event->getInstance();
    }