protected function makeFromArray( $options ) {
		if ( count( $options ) === 0 ) {
			throw new ConfigurationException( 'No condition type specified.' );
		}

		if ( is_array( $options[0] ) ) {
			return $this->makeFromArrayOfConditions( $options );
		}

		$condition_options = $this->parseConditionOptions( $options );
		$condition_class = $this->getConditionTypeClass( $condition_options['type'] );

		try {
			$reflection = new ReflectionClass( $condition_class );
			/** @var $instance \WPEmerge\Routing\Conditions\ConditionInterface */
			$instance = $reflection->newInstanceArgs( $condition_options['arguments'] );
			return $instance;
		} catch ( ReflectionException $e ) {
			throw new ConfigurationException( 'Condition class "' . $condition_class . '" does not exist.' );
		}
	}
protected function makeFromArray( $options ) {
		if ( count( $options ) === 0 ) {
			throw new ConfigurationException( 'No condition type specified.' );
		}

		if ( is_array( $options[0] ) ) {
			return $this->makeFromArrayOfConditions( $options );
		}

		$condition_options = $this->parseConditionOptions( $options );
		$condition_class = $this->getConditionTypeClass( $condition_options['type'] );

		try {
			$reflection = new ReflectionClass( $condition_class );
			/** @var $instance \WPEmerge\Routing\Conditions\ConditionInterface */
			$instance = $reflection->newInstanceArgs( $condition_options['arguments'] );
			return $instance;
		} catch ( ReflectionException $e ) {
			throw new ConfigurationException( 'Condition class "' . $condition_class . '" does not exist.' );
		}
	}
protected function makeFromArray ( $ options ) { if ( count ( $ options ) === 0 ) { throw new ConfigurationException ( 'No condition type specified.' ) ; } if ( is_array ( $ options [ 0 ] ) ) { return $ this -> makeFromArrayOfConditions ( $ options ) ; } $ condition_options = $ this -> parseConditionOptions ( $ options ) ; $ condition_class = $ this -> getConditionTypeClass ( $ condition_options [ 'type' ] ) ; try { $ reflection = new ReflectionClass ( $ condition_class ) ; /** @var $instance \WPEmerge\Routing\Conditions\ConditionInterface */ $ instance = $ reflection -> newInstanceArgs ( $ condition_options [ 'arguments' ] ) ; return $ instance ; } catch ( ReflectionException $ e ) { throw new ConfigurationException ( 'Condition class "' . $ condition_class . '" does not exist.' ) ; } }
Create a new condition from an array.

@param  array              $options
@return ConditionInterface
Create a new condition from an array .