protected function forceTypes($data)
    {
        if (in_array($data, array('true', 'false')))
        {
            $data = ($data === 'true' ? 1 : 0);
        }
        else if (is_numeric($data))
        {
            $data = (int) $data;
        }
        else if (gettype($data) === 'array')
        {
            foreach($data as $key=>$value)
            {
                $data[$key] = $this->forceTypes($value);
            }
        }

        return $data;
    }
protected function forceTypes($data)
    {
        if (in_array($data, array('true', 'false')))
        {
            $data = ($data === 'true' ? 1 : 0);
        }
        else if (is_numeric($data))
        {
            $data = (int) $data;
        }
        else if (gettype($data) === 'array')
        {
            foreach($data as $key=>$value)
            {
                $data[$key] = $this->forceTypes($value);
            }
        }

        return $data;
    }
protected function forceTypes ( $ data ) { if ( in_array ( $ data , array ( 'true' , 'false' ) ) ) { $ data = ( $ data === 'true' ? 1 : 0 ) ; } else if ( is_numeric ( $ data ) ) { $ data = ( int ) $ data ; } else if ( gettype ( $ data ) === 'array' ) { foreach ( $ data as $ key => $ value ) { $ data [ $ key ] = $ this -> forceTypes ( $ value ) ; } } return $ data ; }
Cast values to native PHP variable types.

@param  mixed  $data
@return mixed
Cast values to native PHP variable types .