protected function addHelper( $data )
    {

        // array of values
        if( is_array( $data ) ) {

            $originalSize = count( $data );
            $data = array_filter( $data, '\Bond\is_not_null' );

            // have null
            if( $originalSize !== count( $data ) ) {
                $this->containsNull = true;
            }

            $argIntervals = array_map( null, $data, $data );
            $argIntervals = array_map( array($this, 'prepInterval'), $argIntervals );

            return array_filter( $argIntervals );

        } elseif( $data instanceof static ) {

            return $data->intervals;

        } elseif( $data === null ) {

            $this->containsNull = true;
            return array();

        } elseif( is_int($data) ) {

            return $this->parseStringToIntervals( $this->escape( $data ) );

        } elseif( is_scalar( $data ) ) {

            return $this->parseStringToIntervals( (string) $data );

        }

        throw new \RuntimeException( "Don't know how to handle this `{$data}`." );

    }
protected function addHelper( $data )
    {

        // array of values
        if( is_array( $data ) ) {

            $originalSize = count( $data );
            $data = array_filter( $data, '\Bond\is_not_null' );

            // have null
            if( $originalSize !== count( $data ) ) {
                $this->containsNull = true;
            }

            $argIntervals = array_map( null, $data, $data );
            $argIntervals = array_map( array($this, 'prepInterval'), $argIntervals );

            return array_filter( $argIntervals );

        } elseif( $data instanceof static ) {

            return $data->intervals;

        } elseif( $data === null ) {

            $this->containsNull = true;
            return array();

        } elseif( is_int($data) ) {

            return $this->parseStringToIntervals( $this->escape( $data ) );

        } elseif( is_scalar( $data ) ) {

            return $this->parseStringToIntervals( (string) $data );

        }

        throw new \RuntimeException( "Don't know how to handle this `{$data}`." );

    }
protected function addHelper ( $ data ) { // array of values if ( is_array ( $ data ) ) { $ originalSize = count ( $ data ) ; $ data = array_filter ( $ data , '\Bond\is_not_null' ) ; // have null if ( $ originalSize !== count ( $ data ) ) { $ this -> containsNull = true ; } $ argIntervals = array_map ( null , $ data , $ data ) ; $ argIntervals = array_map ( array ( $ this , 'prepInterval' ) , $ argIntervals ) ; return array_filter ( $ argIntervals ) ; } elseif ( $ data instanceof static ) { return $ data -> intervals ; } elseif ( $ data === null ) { $ this -> containsNull = true ; return array ( ) ; } elseif ( is_int ( $ data ) ) { return $ this -> parseStringToIntervals ( $ this -> escape ( $ data ) ) ; } elseif ( is_scalar ( $ data ) ) { return $ this -> parseStringToIntervals ( ( string ) $ data ) ; } throw new \ RuntimeException ( "Don't know how to handle this `{$data}`." ) ; }
Convert something that looks like it's going to be a set castable into a array of intervals
Not nessisarily sorted
@param mixed $data
@return array Intervals
Convert something that looks like it s going to be a set castable into a array of intervals Not nessisarily sorted