本文整理汇总了C++中RETURN_THIS函数的典型用法代码示例。如果您正苦于以下问题:C++ RETURN_THIS函数的具体用法?C++ RETURN_THIS怎么用?C++ RETURN_THIS使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RETURN_THIS函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PHP_METHOD
/**
* Sets field name related to message
*/
PHP_METHOD(Phalcon_Validation_Message, setField) {
zval *field_param = NULL;
zval *field = NULL;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 0, &field_param);
if (unlikely(Z_TYPE_P(field_param) != IS_STRING && Z_TYPE_P(field_param) != IS_NULL)) {
zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'field' must be a string") TSRMLS_CC);
RETURN_MM_NULL();
}
if (likely(Z_TYPE_P(field_param) == IS_STRING)) {
zephir_get_strval(field, field_param);
} else {
ZEPHIR_INIT_VAR(field);
ZVAL_EMPTY_STRING(field);
}
zephir_update_property_this(this_ptr, SL("_field"), field TSRMLS_CC);
RETURN_THIS();
}
示例2: PHP_METHOD
/**
* Set a single view parameter
*
*<code>
* $this->view->setVar("products", $products);
*</code>
*/
PHP_METHOD(Phalcon_Mvc_View_Simple, setVar) {
zval *key_param = NULL, *value;
zval *key = NULL;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 2, 0, &key_param, &value);
if (UNEXPECTED(Z_TYPE_P(key_param) != IS_STRING && Z_TYPE_P(key_param) != IS_NULL)) {
zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'key' must be a string") TSRMLS_CC);
RETURN_MM_NULL();
}
if (EXPECTED(Z_TYPE_P(key_param) == IS_STRING)) {
zephir_get_strval(key, key_param);
} else {
ZEPHIR_INIT_VAR(key);
ZVAL_EMPTY_STRING(key);
}
zephir_update_property_array(this_ptr, SL("_viewParams"), key, value TSRMLS_CC);
RETURN_THIS();
}
示例3: PHP_METHOD
/**
* Applies a callback function to each item in the object
*
* @param callable callback
* @param mixed userdata [Optional]
*/
PHP_METHOD(Xpl_Collection_ArrayObject, walk) {
int ZEPHIR_LAST_CALL_STATUS;
zval *callback, *userdata = NULL, *data = NULL;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 1, &callback, &userdata);
if (!userdata) {
userdata = ZEPHIR_GLOBAL(global_null);
}
ZEPHIR_CALL_METHOD(&data, this_ptr, "getarraycopy", NULL, 0);
zephir_check_call_status();
ZEPHIR_MAKE_REF(data);
ZEPHIR_CALL_FUNCTION(NULL, "array_walk", NULL, 72, data, callback, userdata);
ZEPHIR_UNREF(data);
zephir_check_call_status();
ZEPHIR_CALL_METHOD(NULL, this_ptr, "exchangearray", NULL, 0, data);
zephir_check_call_status();
RETURN_THIS();
}
示例4: PHP_METHOD
/**
* Sets a hostname restriction to the route
*
*<code>
* $route->setHostname('localhost');
*</code>
*/
PHP_METHOD(Phalcon_Mvc_Router_Route, setHostname) {
zval *hostname_param = NULL;
zval *hostname = NULL;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 0, &hostname_param);
if (unlikely(Z_TYPE_P(hostname_param) != IS_STRING && Z_TYPE_P(hostname_param) != IS_NULL)) {
zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'hostname' must be a string") TSRMLS_CC);
RETURN_MM_NULL();
}
if (likely(Z_TYPE_P(hostname_param) == IS_STRING)) {
zephir_get_strval(hostname, hostname_param);
} else {
ZEPHIR_INIT_VAR(hostname);
ZVAL_EMPTY_STRING(hostname);
}
zephir_update_property_this(this_ptr, SL("_hostname"), hostname TSRMLS_CC);
RETURN_THIS();
}
示例5: PHP_METHOD
/**
* Sets the element name
*/
PHP_METHOD(Phalcon_Forms_Element, setName) {
zval *name_param = NULL;
zval *name = NULL;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 0, &name_param);
if (UNEXPECTED(Z_TYPE_P(name_param) != IS_STRING && Z_TYPE_P(name_param) != IS_NULL)) {
zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'name' must be a string") TSRMLS_CC);
RETURN_MM_NULL();
}
if (EXPECTED(Z_TYPE_P(name_param) == IS_STRING)) {
zephir_get_strval(name, name_param);
} else {
ZEPHIR_INIT_VAR(name);
ZVAL_EMPTY_STRING(name);
}
zephir_update_property_this(getThis(), SL("_name"), name TSRMLS_CC);
RETURN_THIS();
}
示例6: PHP_METHOD
/**
* Sets a prefix for all routes added to the collection
*/
PHP_METHOD(Phalcon_Mvc_Micro_Collection, setPrefix) {
zval *prefix_param = NULL;
zval *prefix = NULL;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 0, &prefix_param);
if (UNEXPECTED(Z_TYPE_P(prefix_param) != IS_STRING && Z_TYPE_P(prefix_param) != IS_NULL)) {
zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'prefix' must be a string") TSRMLS_CC);
RETURN_MM_NULL();
}
if (EXPECTED(Z_TYPE_P(prefix_param) == IS_STRING)) {
zephir_get_strval(prefix, prefix_param);
} else {
ZEPHIR_INIT_VAR(prefix);
ZVAL_EMPTY_STRING(prefix);
}
zephir_update_property_this(getThis(), SL("_prefix"), prefix TSRMLS_CC);
RETURN_THIS();
}
示例7: PHP_METHOD
/**
* Externally sets the view content
*
*<code>
* $this->view->setContent("<h1>hello</h1>");
*</code>
*/
PHP_METHOD(Phalcon_Mvc_View_Simple, setContent) {
zval *content_param = NULL;
zval *content = NULL;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 0, &content_param);
if (unlikely(Z_TYPE_P(content_param) != IS_STRING && Z_TYPE_P(content_param) != IS_NULL)) {
zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'content' must be a string") TSRMLS_CC);
RETURN_MM_NULL();
}
if (likely(Z_TYPE_P(content_param) == IS_STRING)) {
zephir_get_strval(content, content_param);
} else {
ZEPHIR_INIT_VAR(content);
ZVAL_EMPTY_STRING(content);
}
zephir_update_property_this(this_ptr, SL("_content"), content TSRMLS_CC);
RETURN_THIS();
}
示例8: PHP_METHOD
/**
* Sets the form's action
*/
PHP_METHOD(Phalcon_Forms_Form, setAction) {
zval *action_param = NULL;
zval *action = NULL;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 0, &action_param);
if (UNEXPECTED(Z_TYPE_P(action_param) != IS_STRING && Z_TYPE_P(action_param) != IS_NULL)) {
zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'action' must be a string") TSRMLS_CC);
RETURN_MM_NULL();
}
if (EXPECTED(Z_TYPE_P(action_param) == IS_STRING)) {
zephir_get_strval(action, action_param);
} else {
ZEPHIR_INIT_VAR(action);
ZVAL_EMPTY_STRING(action);
}
zephir_update_property_this(this_ptr, SL("_action"), action TSRMLS_CC);
RETURN_THIS();
}
示例9: PHP_METHOD
/**
* Sets a base path for all the generated paths
*
*<code>
* $url->setBasePath("/var/www/htdocs/");
*</code>
*/
PHP_METHOD(Phalcon_Mvc_Url, setBasePath) {
zval *basePath_param = NULL;
zval *basePath = NULL;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 0, &basePath_param);
if (UNEXPECTED(Z_TYPE_P(basePath_param) != IS_STRING && Z_TYPE_P(basePath_param) != IS_NULL)) {
zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'basePath' must be a string") TSRMLS_CC);
RETURN_MM_NULL();
}
if (EXPECTED(Z_TYPE_P(basePath_param) == IS_STRING)) {
zephir_get_strval(basePath, basePath_param);
} else {
ZEPHIR_INIT_VAR(basePath);
ZVAL_EMPTY_STRING(basePath);
}
zephir_update_property_this(getThis(), SL("_basePath"), basePath TSRMLS_CC);
RETURN_THIS();
}
示例10: PHP_METHOD
/**
* Sets the cipher algorithm
*/
PHP_METHOD(Phalcon_Crypt, setCipher) {
zval *cipher_param = NULL;
zval *cipher = NULL;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 0, &cipher_param);
if (UNEXPECTED(Z_TYPE_P(cipher_param) != IS_STRING && Z_TYPE_P(cipher_param) != IS_NULL)) {
zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'cipher' must be a string") TSRMLS_CC);
RETURN_MM_NULL();
}
if (EXPECTED(Z_TYPE_P(cipher_param) == IS_STRING)) {
zephir_get_strval(cipher, cipher_param);
} else {
ZEPHIR_INIT_VAR(cipher);
ZVAL_EMPTY_STRING(cipher);
}
zephir_update_property_this(getThis(), SL("_cipher"), cipher TSRMLS_CC);
RETURN_THIS();
}
示例11: PHP_METHOD
/**
* Sets verbose message
*/
PHP_METHOD(Phalcon_Mvc_Model_Message, setMessage) {
zval *message_param = NULL;
zval *message = NULL;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 0, &message_param);
if (unlikely(Z_TYPE_P(message_param) != IS_STRING && Z_TYPE_P(message_param) != IS_NULL)) {
zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'message' must be a string") TSRMLS_CC);
RETURN_MM_NULL();
}
if (likely(Z_TYPE_P(message_param) == IS_STRING)) {
zephir_get_strval(message, message_param);
} else {
ZEPHIR_INIT_VAR(message);
ZVAL_EMPTY_STRING(message);
}
zephir_update_property_this(this_ptr, SL("_message"), message TSRMLS_CC);
RETURN_THIS();
}
示例12: PHP_METHOD
/**
* Sets a base source path for all the resources in this collection
*/
PHP_METHOD(Phalcon_Assets_Collection, setSourcePath) {
zval *sourcePath_param = NULL;
zval *sourcePath = NULL;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 0, &sourcePath_param);
if (unlikely(Z_TYPE_P(sourcePath_param) != IS_STRING && Z_TYPE_P(sourcePath_param) != IS_NULL)) {
zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'sourcePath' must be a string") TSRMLS_CC);
RETURN_MM_NULL();
}
if (likely(Z_TYPE_P(sourcePath_param) == IS_STRING)) {
zephir_get_strval(sourcePath, sourcePath_param);
} else {
ZEPHIR_INIT_VAR(sourcePath);
ZVAL_EMPTY_STRING(sourcePath);
}
zephir_update_property_this(this_ptr, SL("_sourcePath"), sourcePath TSRMLS_CC);
RETURN_THIS();
}
示例13: PHP_METHOD
/**
* Sets event type.
*/
PHP_METHOD(Phalcon_Events_Event, setType) {
zval *type_param = NULL;
zval *type = NULL;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 0, &type_param);
if (unlikely(Z_TYPE_P(type_param) != IS_STRING && Z_TYPE_P(type_param) != IS_NULL)) {
zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'type' must be a string") TSRMLS_CC);
RETURN_MM_NULL();
}
if (likely(Z_TYPE_P(type_param) == IS_STRING)) {
zephir_get_strval(type, type_param);
} else {
ZEPHIR_INIT_VAR(type);
ZVAL_EMPTY_STRING(type);
}
zephir_update_property_this(this_ptr, SL("_type"), type TSRMLS_CC);
RETURN_THIS();
}
示例14: PHP_METHOD
/**
* Adds an element to the form
*/
PHP_METHOD(Phalcon_Forms_Form, add) {
HashTable *_4$$4;
HashPosition _3$$4;
zend_long ZEPHIR_LAST_CALL_STATUS;
zend_bool type, _0;
zval *position = NULL;
zval *element, *position_param = NULL, *type_param = NULL, *name = NULL, *key = NULL, *value = NULL, *elements = NULL, *_1, *_2$$4, **_5$$4;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 2, &element, &position_param, &type_param);
if (!position_param) {
ZEPHIR_INIT_VAR(position);
ZVAL_EMPTY_STRING(position);
} else {
zephir_get_strval(position, position_param);
}
if (!type_param) {
type = 0;
} else {
type = zephir_get_boolval(type_param);
}
ZEPHIR_CALL_METHOD(&name, element, "getname", NULL, 0);
zephir_check_call_status();
ZEPHIR_CALL_METHOD(NULL, element, "setform", NULL, 0, this_ptr);
zephir_check_call_status();
_0 = ZEPHIR_IS_STRING(position, "");
if (!(_0)) {
_1 = zephir_fetch_nproperty_this(this_ptr, SL("_elements"), PH_NOISY_CC);
_0 = ZEPHIR_IS_EMPTY(_1);
}
if (_0) {
zephir_update_property_array(this_ptr, SL("_elements"), name, element TSRMLS_CC);
} else {
ZEPHIR_INIT_VAR(elements);
array_init(elements);
_2$$4 = zephir_fetch_nproperty_this(this_ptr, SL("_elements"), PH_NOISY_CC);
zephir_is_iterable(_2$$4, &_4$$4, &_3$$4, 0, 0, "phalcon/forms/form.zep", 449);
for (
; zend_hash_get_current_data_ex(_4$$4, (void**) &_5$$4, &_3$$4) == SUCCESS
; zend_hash_move_forward_ex(_4$$4, &_3$$4)
) {
ZEPHIR_GET_HMKEY(key, _4$$4, _3$$4);
ZEPHIR_GET_HVALUE(value, _5$$4);
if (ZEPHIR_IS_EQUAL(key, position)) {
if (type) {
zephir_array_update_zval(&elements, name, &element, PH_COPY | PH_SEPARATE);
zephir_array_update_zval(&elements, key, &value, PH_COPY | PH_SEPARATE);
} else {
zephir_array_update_zval(&elements, key, &value, PH_COPY | PH_SEPARATE);
zephir_array_update_zval(&elements, name, &element, PH_COPY | PH_SEPARATE);
}
} else {
zephir_array_update_zval(&elements, key, &value, PH_COPY | PH_SEPARATE);
}
}
zephir_update_property_this(getThis(), SL("_elements"), elements TSRMLS_CC);
}
RETURN_THIS();
}
示例15: PHP_METHOD
/**
* Logs messages to the internal logger. Appends logs to the logger
*/
PHP_METHOD(Phalcon_Logger_Adapter, log) {
int ZEPHIR_LAST_CALL_STATUS;
zend_bool _0, _1;
zval *context = NULL;
zval *type, *message = NULL, *context_param = NULL, *timestamp, *toggledMessage = NULL, *toggledType = NULL, *_2, *_3, *_4;
ZEPHIR_MM_GROW();
zephir_fetch_params(1, 1, 2, &type, &message, &context_param);
if (!message) {
message = ZEPHIR_GLOBAL(global_null);
}
if (!context_param) {
ZEPHIR_INIT_VAR(context);
array_init(context);
} else {
context = context_param;
}
_0 = Z_TYPE_P(type) == IS_STRING;
if (_0) {
_0 = Z_TYPE_P(message) == IS_LONG;
}
if (_0) {
ZEPHIR_CPY_WRT(toggledMessage, type);
ZEPHIR_CPY_WRT(toggledType, message);
} else {
_1 = Z_TYPE_P(type) == IS_STRING;
if (_1) {
_1 = Z_TYPE_P(message) == IS_NULL;
}
if (_1) {
ZEPHIR_CPY_WRT(toggledMessage, type);
ZEPHIR_CPY_WRT(toggledType, message);
} else {
ZEPHIR_CPY_WRT(toggledMessage, message);
ZEPHIR_CPY_WRT(toggledType, type);
}
}
if (Z_TYPE_P(toggledType) == IS_NULL) {
ZEPHIR_INIT_NVAR(toggledType);
ZVAL_LONG(toggledType, 7);
}
_2 = zephir_fetch_nproperty_this(this_ptr, SL("_logLevel"), PH_NOISY_CC);
if (ZEPHIR_GE(_2, toggledType)) {
ZEPHIR_INIT_VAR(timestamp);
zephir_time(timestamp);
_3 = zephir_fetch_nproperty_this(this_ptr, SL("_transaction"), PH_NOISY_CC);
if (zephir_is_true(_3)) {
ZEPHIR_INIT_VAR(_4);
object_init_ex(_4, phalcon_logger_item_ce);
ZEPHIR_CALL_METHOD(NULL, _4, "__construct", NULL, 52, toggledMessage, toggledType, timestamp, context);
zephir_check_call_status();
zephir_update_property_array_append(this_ptr, SL("_queue"), _4 TSRMLS_CC);
} else {
ZEPHIR_CALL_METHOD(NULL, this_ptr, "loginternal", NULL, 0, toggledMessage, toggledType, timestamp, context);
zephir_check_call_status();
}
}
RETURN_THIS();
}