public function getQueryModifier( QuoteInterface $quoting, $cast = true )
    {

        $modifier = new Modifier( $quoting, $this->data['type'], false );

        // nullify
        if( $this->data['isNullable'] ) {
            $modifier->add( 'pre', '\Bond\nullify' );
        }

        // datatypes which aren't all lower case need to be identifier quoted
        if( $cast ) {

            // datatypes which aren't all lower case need to be identifier quoted
            if( strtolower( $this->data['type'] ) !== $this->data['type'] ) {
                $type = $quoting->quoteIdent( $this->data['type'] );
            } else {
                $type = $this->data['type'];
            }

            $modifier->add( 'post', $modifier->generateCastClosure( $type ) );

        }

        return $modifier;

    }
public function getQueryModifier( QuoteInterface $quoting, $cast = true )
    {

        $modifier = new Modifier( $quoting, $this->data['type'], false );

        // nullify
        if( $this->data['isNullable'] ) {
            $modifier->add( 'pre', '\Bond\nullify' );
        }

        // datatypes which aren't all lower case need to be identifier quoted
        if( $cast ) {

            // datatypes which aren't all lower case need to be identifier quoted
            if( strtolower( $this->data['type'] ) !== $this->data['type'] ) {
                $type = $quoting->quoteIdent( $this->data['type'] );
            } else {
                $type = $this->data['type'];
            }

            $modifier->add( 'post', $modifier->generateCastClosure( $type ) );

        }

        return $modifier;

    }
public function getQueryModifier ( QuoteInterface $ quoting , $ cast = true ) { $ modifier = new Modifier ( $ quoting , $ this -> data [ 'type' ] , false ) ; // nullify if ( $ this -> data [ 'isNullable' ] ) { $ modifier -> add ( 'pre' , '\Bond\nullify' ) ; } // datatypes which aren't all lower case need to be identifier quoted if ( $ cast ) { // datatypes which aren't all lower case need to be identifier quoted if ( strtolower ( $ this -> data [ 'type' ] ) !== $ this -> data [ 'type' ] ) { $ type = $ quoting -> quoteIdent ( $ this -> data [ 'type' ] ) ; } else { $ type = $ this -> data [ 'type' ] ; } $ modifier -> add ( 'post' , $ modifier -> generateCastClosure ( $ type ) ) ; } return $ modifier ; }
Get a modifier customised to work on this datatype
Get a modifier customised to work on this datatype