本文整理汇总了C++中PHALCON_CALL_METHOD_PARAMS_1_NORETURN函数的典型用法代码示例。如果您正苦于以下问题:C++ PHALCON_CALL_METHOD_PARAMS_1_NORETURN函数的具体用法?C++ PHALCON_CALL_METHOD_PARAMS_1_NORETURN怎么用?C++ PHALCON_CALL_METHOD_PARAMS_1_NORETURN使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了PHALCON_CALL_METHOD_PARAMS_1_NORETURN函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PHP_METHOD
/**
* Starts the profile of a SQL sentence
*
* @param string $sqlStatement
* @return Phalcon\Db\Profiler
*/
PHP_METHOD(Phalcon_Db_Profiler, startProfile){
zval *sql_statement, *active_profile, *micro;
zval *time;
PHALCON_MM_GROW();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &sql_statement) == FAILURE) {
PHALCON_MM_RESTORE();
RETURN_NULL();
}
PHALCON_INIT_VAR(active_profile);
object_init_ex(active_profile, phalcon_db_profiler_item_ce);
PHALCON_CALL_METHOD_PARAMS_1_NORETURN(active_profile, "setsqlstatement", sql_statement, PH_NO_CHECK);
PHALCON_INIT_VAR(micro);
ZVAL_BOOL(micro, 1);
PHALCON_INIT_VAR(time);
PHALCON_CALL_FUNC_PARAMS_1(time, "microtime", micro);
PHALCON_CALL_METHOD_PARAMS_1_NORETURN(active_profile, "setinitialtime", time, PH_NO_CHECK);
if (phalcon_method_exists_ex(this_ptr, SS("beforestartprofile") TSRMLS_CC) == SUCCESS) {
PHALCON_CALL_METHOD_PARAMS_1_NORETURN(this_ptr, "beforestartprofile", active_profile, PH_NO_CHECK);
}
phalcon_update_property_zval(this_ptr, SL("_activeProfile"), active_profile TSRMLS_CC);
RETURN_CTOR(this_ptr);
}
示例2: PHP_METHOD
/**
* Creates a Phalcon\Mvc\Model\Query and execute it
*
* @param string $phql
* @param array $placeholders
* @return Phalcon\Mvc\Model\Query
*/
PHP_METHOD(Phalcon_Mvc_Model_Manager, executeQuery){
zval *phql = NULL, *placeholders = NULL, *dependency_injector = NULL;
zval *query = NULL, *result = NULL;
PHALCON_MM_GROW();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|z", &phql, &placeholders) == FAILURE) {
PHALCON_MM_RESTORE();
RETURN_NULL();
}
if (!placeholders) {
PHALCON_ALLOC_ZVAL_MM(placeholders);
ZVAL_NULL(placeholders);
}
PHALCON_INIT_VAR(dependency_injector);
phalcon_read_property(&dependency_injector, this_ptr, SL("_dependencyInjector"), PH_NOISY_CC);
if (Z_TYPE_P(dependency_injector) != IS_OBJECT) {
PHALCON_THROW_EXCEPTION_STR(phalcon_mvc_model_exception_ce, "A dependency injection object is required to access ORM services");
return;
}
PHALCON_INIT_VAR(query);
object_init_ex(query, phalcon_mvc_model_query_ce);
PHALCON_CALL_METHOD_PARAMS_1_NORETURN(query, "__construct", phql, PH_CHECK);
PHALCON_CALL_METHOD_PARAMS_1_NORETURN(query, "setdi", dependency_injector, PH_NO_CHECK);
PHALCON_INIT_VAR(result);
PHALCON_CALL_METHOD_PARAMS_1(result, query, "execute", placeholders, PH_NO_CHECK);
RETURN_CCTOR(result);
}
示例3: PHP_METHOD
/**
* Gets the models manager
*
* @return Phalcon_Model_Manager
*/
PHP_METHOD(Phalcon_Controller_Front, getModelComponent){
zval *model = NULL;
zval *t0 = NULL, *t1 = NULL, *t2 = NULL, *t3 = NULL;
zval *i0 = NULL;
PHALCON_MM_GROW();
PHALCON_ALLOC_ZVAL_MM(t0);
phalcon_read_property(&t0, this_ptr, "_model", sizeof("_model")-1, PHALCON_NOISY TSRMLS_CC);
if (!zend_is_true(t0)) {
PHALCON_ALLOC_ZVAL_MM(i0);
object_init_ex(i0, phalcon_model_manager_ce);
PHALCON_ALLOC_ZVAL_MM(t1);
phalcon_read_property(&t1, this_ptr, "_modelsConfig", sizeof("_modelsConfig")-1, PHALCON_NOISY TSRMLS_CC);
PHALCON_CALL_METHOD_PARAMS_1_NORETURN(i0, "__construct", t1, PHALCON_CHECK);
PHALCON_CPY_WRT(model, i0);
PHALCON_ALLOC_ZVAL_MM(t2);
phalcon_read_property(&t2, this_ptr, "_modelsDir", sizeof("_modelsDir")-1, PHALCON_NOISY TSRMLS_CC);
PHALCON_CALL_METHOD_PARAMS_1_NORETURN(model, "setmodelsdir", t2, PHALCON_NO_CHECK);
phalcon_update_property_zval(this_ptr, "_model", strlen("_model"), model TSRMLS_CC);
}
PHALCON_ALLOC_ZVAL_MM(t3);
phalcon_read_property(&t3, this_ptr, "_model", sizeof("_model")-1, PHALCON_NOISY TSRMLS_CC);
PHALCON_RETURN_CHECK_CTOR(t3);
}
示例4: PHP_METHOD
/**
* Sets a Expires header to use HTTP cache
*
*<code>
* $this->response->setExpires(new DateTime());
*</code>
*
* @param DateTime $datetime
* @return Phalcon\Http\ResponseInterface
*/
PHP_METHOD(Phalcon_Http_Response, setExpires){
zval *datetime, *headers, *date, *utc_zone, *timezone;
zval *format, *utc_format, *utc_date, *expires_header;
zend_class_entry *ce0;
PHALCON_MM_GROW();
phalcon_fetch_params(1, 1, 0, &datetime);
if (Z_TYPE_P(datetime) != IS_OBJECT) {
PHALCON_THROW_EXCEPTION_STR(phalcon_http_response_exception_ce, "datetime parameter must be an instance of DateTime");
return;
}
PHALCON_INIT_VAR(headers);
PHALCON_CALL_METHOD(headers, this_ptr, "getheaders");
PHALCON_INIT_VAR(date);
if (phalcon_clone(date, datetime TSRMLS_CC) == FAILURE) {
return;
}
/**
* All the expiration times are sent in UTC
*/
PHALCON_INIT_VAR(utc_zone);
ZVAL_STRING(utc_zone, "UTC", 1);
ce0 = zend_fetch_class(SL("DateTimeZone"), ZEND_FETCH_CLASS_AUTO TSRMLS_CC);
PHALCON_INIT_VAR(timezone);
object_init_ex(timezone, ce0);
if (phalcon_has_constructor(timezone TSRMLS_CC)) {
PHALCON_CALL_METHOD_PARAMS_1_NORETURN(timezone, "__construct", utc_zone);
}
/**
* Change the timezone to utc
*/
PHALCON_CALL_METHOD_PARAMS_1_NORETURN(date, "settimezone", timezone);
PHALCON_INIT_VAR(format);
ZVAL_STRING(format, "D, d M Y H:i:s", 1);
PHALCON_INIT_VAR(utc_format);
PHALCON_CALL_METHOD_PARAMS_1(utc_format, date, "format", format);
PHALCON_INIT_VAR(utc_date);
PHALCON_CONCAT_VS(utc_date, utc_format, " GMT");
/**
* The 'Expires' header set this info
*/
PHALCON_INIT_VAR(expires_header);
ZVAL_STRING(expires_header, "Expires", 1);
PHALCON_CALL_METHOD_PARAMS_2_NORETURN(this_ptr, "setheader", expires_header, utc_date);
RETURN_THIS();
}
示例5: PHP_METHOD
/**
* Check whether internal resource has rows to fetch
*
* @return boolean
*/
PHP_METHOD(Phalcon_Model_Resultset, valid){
zval *result = NULL, *row = NULL, *rows = NULL;
zval *t0 = NULL, *t1 = NULL, *t2 = NULL, *t3 = NULL;
zval *c0 = NULL, *c1 = NULL;
zval *r0 = NULL, *r1 = NULL, *r2 = NULL;
PHALCON_MM_GROW();
PHALCON_ALLOC_ZVAL_MM(t0);
phalcon_read_property(&t0, this_ptr, "_type", sizeof("_type")-1, PHALCON_NOISY TSRMLS_CC);
if (zend_is_true(t0)) {
PHALCON_ALLOC_ZVAL_MM(t1);
phalcon_read_property(&t1, this_ptr, "_result", sizeof("_result")-1, PHALCON_NOISY TSRMLS_CC);
PHALCON_CPY_WRT(result, t1);
if (Z_TYPE_P(result) != IS_BOOL || (Z_TYPE_P(result) == IS_BOOL && Z_BVAL_P(result))) {
PHALCON_INIT_VAR(c0);
ZVAL_LONG(c0, 1);
PHALCON_CALL_METHOD_PARAMS_1_NORETURN(result, "setfetchmode", c0, PHALCON_NO_CHECK);
PHALCON_ALLOC_ZVAL_MM(r0);
PHALCON_CALL_METHOD_PARAMS_1(r0, result, "fetcharray", result, PHALCON_NO_CHECK);
PHALCON_CPY_WRT(row, r0);
if (zend_is_true(row)) {
PHALCON_ALLOC_ZVAL_MM(r1);
PHALCON_ALLOC_ZVAL_MM(t2);
phalcon_read_property(&t2, this_ptr, "_model", sizeof("_model")-1, PHALCON_NOISY TSRMLS_CC);
PHALCON_CALL_STATIC_PARAMS_2(r1, "phalcon_model_base", "dumpresult", t2, row);
phalcon_update_property_zval(this_ptr, "_activeRow", strlen("_activeRow"), r1 TSRMLS_CC);
PHALCON_MM_RESTORE();
RETURN_TRUE;
} else {
PHALCON_INIT_VAR(c1);
ZVAL_LONG(c1, 2);
PHALCON_CALL_METHOD_PARAMS_1_NORETURN(result, "setfetchmode", c1, PHALCON_NO_CHECK);
}
}
} else {
PHALCON_ALLOC_ZVAL_MM(t3);
phalcon_read_property(&t3, this_ptr, "_rows", sizeof("_rows")-1, PHALCON_NOISY TSRMLS_CC);
PHALCON_CPY_WRT(rows, t3);
PHALCON_ALLOC_ZVAL_MM(r2);
Z_SET_ISREF_P(rows);
PHALCON_CALL_FUNC_PARAMS_1(r2, "current", rows, 0x054);
Z_UNSET_ISREF_P(rows);
PHALCON_CPY_WRT(row, r2);
if (zend_is_true(row)) {
Z_SET_ISREF_P(rows);
PHALCON_CALL_FUNC_PARAMS_1_NORETURN("next", rows, 0x059);
Z_UNSET_ISREF_P(rows);
phalcon_update_property_zval(this_ptr, "_activeRow", strlen("_activeRow"), row TSRMLS_CC);
PHALCON_MM_RESTORE();
RETURN_TRUE;
}
}
PHALCON_MM_RESTORE();
RETURN_FALSE;
}
示例6: PHP_METHOD
/**
* Sends SQL statements to the MySQL database server returning success state.
* When the SQL sent have returned any row, the result is a PHP resource.
*
*
* $resultset = $connection->query("SELECT * FROM robots WHERE type=?", array("mechanical"));
*
* @param string $sqlStatement
* @return Phalcon_Db_Result_Mysql|boolean
*/
PHP_METHOD(Phalcon_Db_Adapter_Mysql, query){
zval *sql_statement = NULL, *id_connection = NULL, *result = NULL;
zval *number_error = NULL, *error_message = NULL;
zval *t0 = NULL;
zval *i0 = NULL, *i1 = NULL;
zval *r0 = NULL, *r1 = NULL, *r2 = NULL;
PHALCON_MM_GROW();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &sql_statement) == FAILURE) {
PHALCON_MM_RESTORE();
RETURN_NULL();
}
PHALCON_CALL_METHOD_PARAMS_1_NORETURN(this_ptr, "_beforequery", sql_statement, PHALCON_NO_CHECK);
PHALCON_ALLOC_ZVAL_MM(t0);
phalcon_read_property(&t0, this_ptr, SL("_idConnection"), PHALCON_NOISY TSRMLS_CC);
PHALCON_CPY_WRT(id_connection, t0);
PHALCON_INIT_VAR(result);
PHALCON_CALL_FUNC_PARAMS_2(result, "mysqli_query", id_connection, sql_statement);
if (zend_is_true(result)) {
PHALCON_CALL_METHOD_PARAMS_1_NORETURN(this_ptr, "_afterquery", sql_statement, PHALCON_NO_CHECK);
if (Z_TYPE_P(result) == IS_OBJECT) {
PHALCON_ALLOC_ZVAL_MM(i0);
object_init_ex(i0, phalcon_db_result_mysql_ce);
PHALCON_CALL_METHOD_PARAMS_1_NORETURN(i0, "__construct", result, PHALCON_CHECK);
RETURN_CTOR(i0);
}
RETURN_CHECK_CTOR(result);
}
PHALCON_ALLOC_ZVAL_MM(r0);
PHALCON_CALL_METHOD(r0, this_ptr, "noerror", PHALCON_NO_CHECK);
PHALCON_CPY_WRT(number_error, r0);
PHALCON_ALLOC_ZVAL_MM(r1);
PHALCON_ALLOC_ZVAL_MM(r2);
PHALCON_CONCAT_SVS(r2, " when executing \"", sql_statement, "\"");
PHALCON_CALL_METHOD_PARAMS_1(r1, this_ptr, "error", r2, PHALCON_NO_CHECK);
PHALCON_CPY_WRT(error_message, r1);
PHALCON_ALLOC_ZVAL_MM(i1);
object_init_ex(i1, phalcon_db_exception_ce);
PHALCON_CALL_METHOD_PARAMS_2_NORETURN(i1, "__construct", error_message, number_error, PHALCON_CHECK);
phalcon_throw_exception(i1 TSRMLS_CC);
return;
}
示例7: PHP_METHOD
/**
* Phalcon_Acl Constructor
*
* @param string $adapterName
* @param array $options
*/
PHP_METHOD(Phalcon_Acl, __construct){
zval *adapter_name = NULL, *options = NULL, *adapter_class = NULL;
zval *a0 = NULL;
zval *r0 = NULL, *r1 = NULL, *r2 = NULL;
zval *i0 = NULL, *i1 = NULL;
zend_class_entry *ce0;
PHALCON_MM_GROW();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|zz", &adapter_name, &options) == FAILURE) {
PHALCON_MM_RESTORE();
RETURN_NULL();
}
if (!adapter_name) {
PHALCON_INIT_VAR(adapter_name);
ZVAL_STRING(adapter_name, "Memory", 1);
}
if (!options) {
PHALCON_INIT_VAR(a0);
array_init(a0);
PHALCON_CPY_WRT(options, a0);
}
PHALCON_ALLOC_ZVAL_MM(r0);
PHALCON_CONCAT_SV(r0, "Phalcon_Acl_Adapter_", adapter_name);
PHALCON_CPY_WRT(adapter_class, r0);
PHALCON_ALLOC_ZVAL_MM(r1);
PHALCON_CALL_FUNC_PARAMS_1(r1, "class_exists", adapter_class);
if (!zend_is_true(r1)) {
PHALCON_ALLOC_ZVAL_MM(i0);
object_init_ex(i0, phalcon_acl_exception_ce);
PHALCON_ALLOC_ZVAL_MM(r2);
PHALCON_CONCAT_SVS(r2, "Adapter '", adapter_name, "' does not exist");
PHALCON_CALL_METHOD_PARAMS_1_NORETURN(i0, "__construct", r2, PHALCON_CHECK);
phalcon_throw_exception(i0 TSRMLS_CC);
return;
}
ce0 = phalcon_fetch_class(adapter_class TSRMLS_CC);
PHALCON_ALLOC_ZVAL_MM(i1);
object_init_ex(i1, ce0);
PHALCON_CALL_METHOD_PARAMS_1_NORETURN(i1, "__construct", options, PHALCON_CHECK);
phalcon_update_property_zval(this_ptr, SL("_adapter"), i1 TSRMLS_CC);
PHALCON_MM_RESTORE();
}
示例8: PHP_METHOD
/**
* Phalcon_Model_MetaData constructor
*
* @param string $adapter
* @param array $options
*/
PHP_METHOD(Phalcon_Model_MetaData, __construct){
zval *adapter = NULL, *options = NULL, *adapter_class = NULL, *adapter_object = NULL;
zval *a0 = NULL;
zval *r0 = NULL, *r1 = NULL, *r2 = NULL, *r3 = NULL;
zval *i0 = NULL, *i1 = NULL;
zend_class_entry *ce0;
PHALCON_MM_GROW();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|z", &adapter, &options) == FAILURE) {
PHALCON_MM_RESTORE();
RETURN_NULL();
}
if (!options) {
PHALCON_INIT_VAR(a0);
array_init(a0);
PHALCON_CPY_WRT(options, a0);
}
PHALCON_ALLOC_ZVAL_MM(r0);
PHALCON_CONCAT_SV(r0, "Phalcon_Model_MetaData_", adapter);
PHALCON_CPY_WRT(adapter_class, r0);
PHALCON_ALLOC_ZVAL_MM(r1);
PHALCON_CALL_FUNC_PARAMS_1(r1, "class_exists", adapter_class);
if (zend_is_true(r1)) {
ce0 = phalcon_fetch_class(adapter_class TSRMLS_CC);
PHALCON_ALLOC_ZVAL_MM(i0);
object_init_ex(i0, ce0);
PHALCON_CALL_METHOD_PARAMS_1_NORETURN(i0, "__construct", options, PHALCON_CHECK);
PHALCON_CPY_WRT(adapter_object, i0);
PHALCON_ALLOC_ZVAL_MM(r2);
PHALCON_CALL_METHOD(r2, adapter_object, "read", PHALCON_NO_CHECK);
phalcon_update_property_zval(this_ptr, SL("_metaData"), r2 TSRMLS_CC);
phalcon_update_property_zval(this_ptr, SL("_adapter"), adapter_object TSRMLS_CC);
} else {
PHALCON_ALLOC_ZVAL_MM(i1);
object_init_ex(i1, phalcon_model_exception_ce);
PHALCON_ALLOC_ZVAL_MM(r3);
PHALCON_CONCAT_SVS(r3, "Meta-data adapter '", adapter, "' could not found");
PHALCON_CALL_METHOD_PARAMS_1_NORETURN(i1, "__construct", r3, PHALCON_CHECK);
phalcon_throw_exception(i1 TSRMLS_CC);
return;
}
PHALCON_MM_RESTORE();
}
示例9: PHP_METHOD
/**
* Phalcon_Backend_Adapter_File constructor
*
* @param mixed $frontendObject
* @param array $backendOptions
*/
PHP_METHOD(Phalcon_Cache_Backend_File, __construct){
zval *frontend_object = NULL, *backend_options = NULL;
zval *a0 = NULL;
zval *r0 = NULL, *r1 = NULL;
zval *i0 = NULL, *i1 = NULL;
zval *c0 = NULL, *c1 = NULL;
int eval_int;
PHALCON_MM_GROW();
PHALCON_INIT_VAR(a0);
array_init(a0);
zend_update_property(phalcon_cache_backend_file_ce, this_ptr, "_backendOptions", strlen("_backendOptions"), a0 TSRMLS_CC);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &frontend_object, &backend_options) == FAILURE) {
PHALCON_MM_RESTORE();
RETURN_NULL();
}
phalcon_update_property_zval(this_ptr, "_frontendObject", strlen("_frontendObject"), frontend_object TSRMLS_CC);
phalcon_update_property_zval(this_ptr, "_backendOptions", strlen("_backendOptions"), backend_options TSRMLS_CC);
eval_int = phalcon_array_isset_string(backend_options, "cacheDir", strlen("cacheDir")+1);
if (eval_int) {
PHALCON_ALLOC_ZVAL_MM(r0);
PHALCON_ALLOC_ZVAL_MM(r1);
phalcon_array_fetch_string(&r1, backend_options, "cacheDir", strlen("cacheDir"), PHALCON_NOISY TSRMLS_CC);
PHALCON_CALL_FUNC_PARAMS_1(r0, "is_writable", r1, 0x017);
if (!zend_is_true(r0)) {
PHALCON_ALLOC_ZVAL_MM(i0);
object_init_ex(i0, phalcon_cache_exception_ce);
PHALCON_INIT_VAR(c0);
ZVAL_STRING(c0, "The cache directory does not exist or is not writable", 1);
PHALCON_CALL_METHOD_PARAMS_1_NORETURN(i0, "__construct", c0, PHALCON_CHECK);
phalcon_throw_exception(i0 TSRMLS_CC);
return;
}
} else {
PHALCON_ALLOC_ZVAL_MM(i1);
object_init_ex(i1, phalcon_cache_exception_ce);
PHALCON_INIT_VAR(c1);
ZVAL_STRING(c1, "You must specify the cache directory with the option cachesDir", 1);
PHALCON_CALL_METHOD_PARAMS_1_NORETURN(i1, "__construct", c1, PHALCON_CHECK);
phalcon_throw_exception(i1 TSRMLS_CC);
return;
}
PHALCON_MM_RESTORE();
}
示例10: PHP_METHOD
/**
* Stops the active profile
*
* @access public
*/
PHP_METHOD(Phalcon_Db_Profiler, stopProfile){
zval *final_time = NULL;
zval *r0 = NULL, *r1 = NULL, *r2 = NULL, *r3 = NULL;
zval *c0 = NULL;
zval *t0 = NULL, *t1 = NULL, *t2 = NULL, *t3 = NULL, *t4 = NULL, *t5 = NULL;
PHALCON_MM_GROW();
PHALCON_ALLOC_ZVAL_MM(r0);
PHALCON_INIT_VAR(c0);
ZVAL_BOOL(c0, 1);
PHALCON_CALL_FUNC_PARAMS_1(r0, "microtime", c0, 0x034);
PHALCON_CPY_WRT(final_time, r0);
PHALCON_ALLOC_ZVAL_MM(t0);
phalcon_read_property(&t0, this_ptr, "_activeProfile", sizeof("_activeProfile")-1, PHALCON_NOISY TSRMLS_CC);
PHALCON_CALL_METHOD_PARAMS_1_NORETURN(t0, "setfinaltime", final_time, PHALCON_NO_CHECK);
PHALCON_ALLOC_ZVAL_MM(t1);
phalcon_read_property(&t1, this_ptr, "_totalSeconds", sizeof("_totalSeconds")-1, PHALCON_NOISY TSRMLS_CC);
PHALCON_ALLOC_ZVAL_MM(r1);
PHALCON_ALLOC_ZVAL_MM(t2);
phalcon_read_property(&t2, this_ptr, "_activeProfile", sizeof("_activeProfile")-1, PHALCON_NOISY TSRMLS_CC);
PHALCON_CALL_METHOD(r1, t2, "getinitialtime", PHALCON_NO_CHECK);
PHALCON_ALLOC_ZVAL_MM(r2);
sub_function(r2, final_time, r1 TSRMLS_CC);
PHALCON_ALLOC_ZVAL_MM(r3);
phalcon_add_function(r3, t1, r2 TSRMLS_CC);
phalcon_update_property_zval(this_ptr, "_totalSeconds", strlen("_totalSeconds"), r3 TSRMLS_CC);
PHALCON_ALLOC_ZVAL_MM(t3);
phalcon_read_property(&t3, this_ptr, "_activeProfile", sizeof("_activeProfile")-1, PHALCON_NOISY TSRMLS_CC);
PHALCON_ALLOC_ZVAL_MM(t4);
phalcon_read_property(&t4, this_ptr, "_allProfiles", sizeof("_allProfiles")-1, PHALCON_NOISY TSRMLS_CC);
phalcon_array_append(&t4, t3, PHALCON_NO_SEPARATE_THX TSRMLS_CC);
phalcon_update_property_zval(this_ptr, "_allProfiles", strlen("_allProfiles"), t4 TSRMLS_CC);
if (phalcon_method_exists_ex(this_ptr, "afterendprofile", strlen("afterendprofile") TSRMLS_CC) == SUCCESS) {
PHALCON_ALLOC_ZVAL_MM(t5);
phalcon_read_property(&t5, this_ptr, "_activeProfile", sizeof("_activeProfile")-1, PHALCON_NOISY TSRMLS_CC);
PHALCON_CALL_METHOD_PARAMS_1_NORETURN(this_ptr, "afterendprofile", t5, PHALCON_NO_CHECK);
}
PHALCON_MM_RESTORE();
}
示例11: PHP_METHOD
/**
* Rewinds resultset to its beginning
*
*/
PHP_METHOD(Phalcon_Mvc_Model_Resultset, rewind){
zval *type = NULL, *result = NULL, *rows = NULL;
zval *c0 = NULL;
PHALCON_MM_GROW();
PHALCON_INIT_VAR(type);
phalcon_read_property(&type, this_ptr, SL("_type"), PH_NOISY_CC);
if (zend_is_true(type)) {
PHALCON_INIT_VAR(result);
phalcon_read_property(&result, this_ptr, SL("_result"), PH_NOISY_CC);
if (Z_TYPE_P(result) != IS_BOOL || (Z_TYPE_P(result) == IS_BOOL && Z_BVAL_P(result))) {
phalcon_update_property_long(this_ptr, SL("_pointer"), 1 TSRMLS_CC);
PHALCON_INIT_VAR(c0);
ZVAL_LONG(c0, 0);
PHALCON_CALL_METHOD_PARAMS_1_NORETURN(result, "dataseek", c0, PH_NO_CHECK);
}
} else {
PHALCON_INIT_VAR(rows);
phalcon_read_property(&rows, this_ptr, SL("_rows"), PH_NOISY_CC);
Z_SET_ISREF_P(rows);
PHALCON_CALL_FUNC_PARAMS_1_NORETURN("reset", rows);
Z_UNSET_ISREF_P(rows);
}
PHALCON_MM_RESTORE();
}
示例12: PHP_METHOD
/**
* Throws an internal exception
*
* @param Phalcon_Response $response
* @param string $message
*/
PHP_METHOD(Phalcon_Dispatcher, _throwDispatchException){
zval *response = NULL, *message = NULL;
zval *c0 = NULL, *c1 = NULL;
zval *i0 = NULL;
PHALCON_MM_GROW();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &response, &message) == FAILURE) {
PHALCON_MM_RESTORE();
RETURN_NULL();
}
PHALCON_INIT_VAR(c0);
ZVAL_LONG(c0, 404);
PHALCON_INIT_VAR(c1);
ZVAL_STRING(c1, "Not Found", 1);
PHALCON_CALL_METHOD_PARAMS_2_NORETURN(response, "setstatuscode", c0, c1, PHALCON_NO_CHECK);
PHALCON_ALLOC_ZVAL_MM(i0);
object_init_ex(i0, phalcon_dispatcher_exception_ce);
PHALCON_CALL_METHOD_PARAMS_1_NORETURN(i0, "__construct", message, PHALCON_CHECK);
phalcon_throw_exception(i0 TSRMLS_CC);
return;
}
示例13: PHP_METHOD
/**
* Returns the first row in a SQL query result
*
* @param string $sqlQuery
* @param int $fetchMode
* @return array
*/
PHP_METHOD(Phalcon_Db, fetchOne){
zval *sql_query = NULL, *fetch_mode = NULL, *result = NULL, *row = NULL, *empty_row = NULL;
PHALCON_MM_GROW();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|z", &sql_query, &fetch_mode) == FAILURE) {
PHALCON_MM_RESTORE();
RETURN_NULL();
}
if (!fetch_mode) {
PHALCON_ALLOC_ZVAL_MM(fetch_mode);
ZVAL_LONG(fetch_mode, 2);
}
PHALCON_INIT_VAR(result);
PHALCON_CALL_METHOD_PARAMS_1(result, this_ptr, "query", sql_query, PH_NO_CHECK);
if (Z_TYPE_P(result) == IS_OBJECT) {
PHALCON_CALL_METHOD_PARAMS_1_NORETURN(result, "setfetchmode", fetch_mode, PH_NO_CHECK);
PHALCON_INIT_VAR(row);
PHALCON_CALL_METHOD(row, result, "fetcharray", PH_NO_CHECK);
RETURN_CCTOR(row);
}
PHALCON_INIT_VAR(empty_row);
array_init(empty_row);
RETURN_CTOR(empty_row);
}
示例14: PHP_METHOD
/**
* Sets transaction manager related to the transaction
*
* @param Phalcon\Mvc\Model\Transaction\Manager $manager
*/
PHP_METHOD(Phalcon_Mvc_Model_Transaction, setTransactionManager){
zval *manager = NULL;
zval *i0 = NULL;
zval *r0 = NULL;
PHALCON_MM_GROW();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &manager) == FAILURE) {
PHALCON_MM_RESTORE();
RETURN_NULL();
}
if (Z_TYPE_P(manager) != IS_OBJECT) {
PHALCON_ALLOC_ZVAL_MM(i0);
object_init_ex(i0, phalcon_mvc_model_transaction_exception_ce);
PHALCON_ALLOC_ZVAL_MM(r0);
PHALCON_CONCAT_VS(r0, manager, " must be an Object");
PHALCON_CALL_METHOD_PARAMS_1_NORETURN(i0, "__construct", r0, PH_CHECK);
phalcon_throw_exception(i0 TSRMLS_CC);
return;
}
phalcon_update_property_zval(this_ptr, SL("_manager"), manager TSRMLS_CC);
PHALCON_MM_RESTORE();
}
示例15: PHP_METHOD
/**
* Phalcon\Mvc\Model\Resultset\Complex constructor
*
* @param array $columnsTypes
* @param Phalcon\Db\ResultInterface $result
* @param Phalcon\Cache\BackendInterface $cache
*/
PHP_METHOD(Phalcon_Mvc_Model_Resultset_Complex, __construct){
zval *columns_types, *result, *cache = NULL, *fetch_assoc;
PHALCON_MM_GROW();
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz|z", &columns_types, &result, &cache) == FAILURE) {
PHALCON_MM_RESTORE();
RETURN_NULL();
}
if (!cache) {
PHALCON_INIT_NVAR(cache);
}
phalcon_update_property_zval(this_ptr, SL("_columnTypes"), columns_types TSRMLS_CC);
phalcon_update_property_zval(this_ptr, SL("_result"), result TSRMLS_CC);
phalcon_update_property_zval(this_ptr, SL("_cache"), cache TSRMLS_CC);
phalcon_update_property_long(this_ptr, SL("_type"), 1 TSRMLS_CC);
if (PHALCON_IS_NOT_FALSE(result)) {
PHALCON_INIT_VAR(fetch_assoc);
ZVAL_LONG(fetch_assoc, 1);
PHALCON_CALL_METHOD_PARAMS_1_NORETURN(result, "setfetchmode", fetch_assoc, PH_NO_CHECK);
}
PHALCON_MM_RESTORE();
}