/** * Removes an access from a resource * * @param string $resourceName * @param mixed $accessList */ PHP_METHOD(Phalcon_Acl_Adapter_Memory, dropResourceAccess){ zval *resource_name, *access_list, *access_name = NULL; zval *access_key = NULL; HashTable *ah0; HashPosition hp0; zval **hd; PHALCON_MM_GROW(); phalcon_fetch_params(1, 2, 0, &resource_name, &access_list); if (Z_TYPE_P(access_list) == IS_ARRAY) { phalcon_is_iterable(access_list, &ah0, &hp0, 0, 0); while (zend_hash_get_current_data_ex(ah0, (void**) &hd, &hp0) == SUCCESS) { PHALCON_GET_HVALUE(access_name); PHALCON_INIT_NVAR(access_key); PHALCON_CONCAT_VSV(access_key, resource_name, "!", access_name); phalcon_unset_property_array(this_ptr, SL("_accessList"), access_key TSRMLS_CC); zend_hash_move_forward_ex(ah0, &hp0); } } else { PHALCON_INIT_NVAR(access_key); PHALCON_CONCAT_VSV(access_key, resource_name, "!", access_name); phalcon_unset_property_array(this_ptr, SL("_accessList"), access_key TSRMLS_CC); } PHALCON_MM_RESTORE(); }
/** * Removes a property from the internal bag * *<code> * $user->remove('name'); *</code> * * @param string $property * @return boolean */ PHP_METHOD(Phalcon_Session_Bag, remove){ zval *property, *data = NULL, *name, *session; PHALCON_MM_GROW(); phalcon_fetch_params(1, 1, 0, &property); PHALCON_OBS_VAR(data); phalcon_read_property_this(&data, this_ptr, SL("_data"), PH_NOISY_CC); if (phalcon_array_isset(data, property)) { phalcon_unset_property_array(this_ptr, SL("_data"), property TSRMLS_CC); PHALCON_OBS_NVAR(data); phalcon_read_property_this(&data, this_ptr, SL("_data"), PH_NOISY_CC); PHALCON_OBS_VAR(name); phalcon_read_property_this(&name, this_ptr, SL("_name"), PH_NOISY_CC); PHALCON_OBS_VAR(session); phalcon_read_property_this(&session, this_ptr, SL("_session"), PH_NOISY_CC); phalcon_call_method_p2_noret(session, "set", name, data); RETURN_MM_TRUE; } RETURN_MM_FALSE; }
/** * @brief void Phalcon\Registry::offsetUnset(mixed $offset) */ PHP_METHOD(Phalcon_Registry, offsetUnset){ zval *property; phalcon_fetch_params(0, 1, 0, &property); phalcon_unset_property_array(getThis(), SL("_data"), property); }
/** * Magic __unset method * * @param string $key */ PHP_METHOD(Phalcon_Http_Uri, __unset){ zval *key; phalcon_fetch_params(0, 1, 0, &key); phalcon_unset_property_array(getThis(), SL("_parts"), key); }
/** * Removes a service in the services container * * @param string $name */ PHP_METHOD(Phalcon_DI, remove){ zval *name; phalcon_fetch_params(0, 1, 0, &name); PHALCON_ENSURE_IS_STRING(name); phalcon_unset_property_array(getThis(), SL("_services"), name); }
/** * Removes a service in the services container * * @param string $name */ PHP_METHOD(Phalcon_DI, remove){ zval *name; phalcon_fetch_params(0, 1, 0, &name); if (Z_TYPE_P(name) != IS_STRING) { PHALCON_THROW_EXCEPTION_STRW(phalcon_di_exception_ce, "The service name must be a string"); return; } phalcon_unset_property_array(this_ptr, SL("_services"), name TSRMLS_CC); }
/** * Removes a property from the internal bag * *<code> * $user->remove('name')); *</code> * * @param string $property * @return boolean */ PHP_METHOD(Phalcon_Session_Bag, remove){ zval *property, *data; PHALCON_MM_GROW(); if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &property) == FAILURE) { RETURN_MM_NULL(); } PHALCON_OBS_VAR(data); phalcon_read_property(&data, this_ptr, SL("_data"), PH_NOISY_CC); if (phalcon_array_isset(data, property)) { phalcon_unset_property_array(this_ptr, SL("_data"), property TSRMLS_CC); RETURN_MM_TRUE; } RETURN_MM_FALSE; }
/** * Removes an element from the form * * @param string $name * @return boolean */ PHP_METHOD(Phalcon_Forms_Form, remove){ zval *name, *elements; PHALCON_MM_GROW(); if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &name) == FAILURE) { RETURN_MM_NULL(); } PHALCON_OBS_VAR(elements); phalcon_read_property(&elements, this_ptr, SL("_elements"), PH_NOISY_CC); if (phalcon_array_isset(elements, name)) { phalcon_unset_property_array(this_ptr, SL("_elements"), name TSRMLS_CC); RETURN_MM_TRUE; } RETURN_MM_FALSE; }