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();
    }
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();
    }
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 ( ) ; }
Transform a single condition into a valid condition object.

@param array $condition The condition to transform.

@return PropertyConditionInterface

@throws \RuntimeException When a condition has not been transformed into a valid handling instance.

@SuppressWarnings(PHPMD.Superglobals)
@SuppressWarnings(PHPMD.CamelCaseVariableName)
Transform a single condition into a valid condition object .