PHP_METHOD(DefaultColumn, isReversed) { cassandra_column *self; if (zend_parse_parameters_none() == FAILURE) { return; } self = PHP_CASSANDRA_GET_COLUMN(getThis()); RETURN_BOOL(self->reversed); }
PHP_METHOD(DefaultColumn, type) { cassandra_column *self; if (zend_parse_parameters_none() == FAILURE) { return; } self = PHP_CASSANDRA_GET_COLUMN(getThis()); RETURN_ZVAL(PHP5TO7_ZVAL_MAYBE_P(self->type), 1, 0); }
PHP_METHOD(DefaultColumn, isStatic) { cassandra_column *self; const CassValue *value; const char *str; size_t str_len; if (zend_parse_parameters_none() == FAILURE) { return; } self = PHP_CASSANDRA_GET_COLUMN(getThis()); value = cass_column_meta_field_by_name(self->meta, "type"); ASSERT_SUCCESS_BLOCK(cass_value_get_string(value, &str, &str_len), RETURN_FALSE; );
const char *validator; size_t validator_length; PHP5TO7_ZVAL_UNDEF(result); value = cass_column_meta_field_by_name(meta, "validator"); ASSERT_SUCCESS_VALUE(cass_value_get_string(value, &validator, &validator_length), result); PHP5TO7_ZVAL_MAYBE_MAKE(result); object_init_ex(PHP5TO7_ZVAL_MAYBE_P(result), cassandra_default_column_ce); column = PHP_CASSANDRA_GET_COLUMN(PHP5TO7_ZVAL_MAYBE_P(result)); ASSERT_SUCCESS_BLOCK(php_cassandra_get_column_field(meta, "column_name", &column->name TSRMLS_CC), zval_ptr_dtor(&result); PHP5TO7_ZVAL_UNDEF(result); return result; ); if (php_cassandra_parse_column_type(validator, validator_length, &column->reversed, &column->frozen, &column->type TSRMLS_CC) == FAILURE) { zval_ptr_dtor(&result); PHP5TO7_ZVAL_UNDEF(result); return result; }