text: 
  #ifdef HAVE_CONFIG_H
  #include "../../../ext_config.h"
  #endif
  
  #include <php.h>
  #include "../../../php_ext.h"
  #include "../../../ext.h"
  
  #include <Zend/zend_operators.h>
  #include <Zend/zend_exceptions.h>
  #include <Zend/zend_interfaces.h>
  
  #include "kernel/main.h"
  #include "ext/json/php_json.h"
  #include "kernel/fcall.h"
  #include "kernel/object.h"
  #include "kernel/memory.h"
  #include "kernel/array.h"
  #include "kernel/exception.h"
  #include "ext/spl/spl_exceptions.h"
  #include "kernel/operators.h"
  
  
  /**
   * This file is part of the Phalcon Framework.
   *
   * (c) Phalcon Team <team@phalcon.io>
   *
   * For the full copyright and license information, please view the LICENSE.txt
   * file that was distributed with this source code.
   */
  /**
   * Phalcon\Mvc\Model\Row
   *
   * This component allows Phalcon\Mvc\Model to return rows without an associated entity.
   * This objects implements the ArrayAccess interface to allow access the object as object->x or array[x].
   */
  ZEPHIR_INIT_CLASS(Phalcon_Mvc_Model_Row)
  {
  	ZEPHIR_REGISTER_CLASS(Phalcon\\Mvc\\Model, Row, phalcon, mvc_model_row, phalcon_mvc_model_row_method_entry, 0);
  
  	zend_class_implements(phalcon_mvc_model_row_ce, 1, phalcon_mvc_entityinterface_ce);
  	zend_class_implements(phalcon_mvc_model_row_ce, 1, phalcon_mvc_model_resultinterface_ce);
  	zend_class_implements(phalcon_mvc_model_row_ce, 1, zend_ce_arrayaccess);
  	zend_class_implements(phalcon_mvc_model_row_ce, 1, php_json_serializable_ce);
  	return SUCCESS;
  }
  
  /**
   * Serializes the object for json_encode
   */
  PHP_METHOD(Phalcon_Mvc_Model_Row, jsonSerialize)
  {
  	zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
  	zend_long ZEPHIR_LAST_CALL_STATUS;
  	zval *this_ptr = getThis();
  
  
  
  	ZEPHIR_MM_GROW();
  
  	ZEPHIR_RETURN_CALL_METHOD(this_ptr, "toarray", NULL, 0);
  	zephir_check_call_status();
  	RETURN_MM();
  }
  
  /**
   * Gets a record in a specific position of the row
   *
   * @param string|int index
   *
   * @return string|ModelInterface
   */
  PHP_METHOD(Phalcon_Mvc_Model_Row, offsetGet)
  {
  	zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
  	zval *index, index_sub, value;
  	zval *this_ptr = getThis();
  
  	ZVAL_UNDEF(&index_sub);
  	ZVAL_UNDEF(&value);
  #if PHP_VERSION_ID >= 80000
  	bool is_null_true = 1;
  	ZEND_PARSE_PARAMETERS_START(1, 1)
  		Z_PARAM_ZVAL(index)
  	ZEND_PARSE_PARAMETERS_END();
  #endif
  
  
  	ZEPHIR_MM_GROW();
  	zephir_fetch_params(1, 1, 0, &index);
  
  
  	ZEPHIR_OBS_VAR(&value);
  	if (UNEXPECTED(!(zephir_fetch_property_zval(&value, this_ptr, index, PH_SILENT_CC)))) {
  		ZEPHIR_THROW_EXCEPTION_DEBUG_STR(phalcon_mvc_model_exception_ce, "The index does not exist in the row", "phalcon/Mvc/Model/Row.zep", 46);
  		return;
  	}
  	RETURN_CCTOR(&value);
  }
  
  /**
   * Checks whether offset exists in the row
   *
   * @param string|int $index
   */
  PHP_METHOD(Phalcon_Mvc_Model_Row, offsetExists)
  {
  	zval *index, index_sub;
  	zval *this_ptr = getThis();
  
  	ZVAL_UNDEF(&index_sub);
  #if PHP_VERSION_ID >= 80000
  	bool is_null_true = 1;
  	ZEND_PARSE_PARAMETERS_START(1, 1)
  		Z_PARAM_ZVAL(index)
  	ZEND_PARSE_PARAMETERS_END();
  #endif
  
  
  	zephir_fetch_params_without_memory_grow(1, 0, &index);
  
  
  	RETURN_BOOL(zephir_isset_property_zval(this_ptr, index));
  }
  
  /**
   * Rows cannot be changed. It has only been implemented to meet the definition of the ArrayAccess interface
   *
   * @param string|int index
   * @param ModelInterface value
   */
  PHP_METHOD(Phalcon_Mvc_Model_Row, offsetSet)
  {
  	zval *index, index_sub, *value, value_sub;
  	zval *this_ptr = getThis();
  
  	ZVAL_UNDEF(&index_sub);
  	ZVAL_UNDEF(&value_sub);
  #if PHP_VERSION_ID >= 80000
  	bool is_null_true = 1;
  	ZEND_PARSE_PARAMETERS_START(2, 2)
  		Z_PARAM_ZVAL(index)
  		Z_PARAM_ZVAL(value)
  	ZEND_PARSE_PARAMETERS_END();
  #endif
  
  
  	zephir_fetch_params_without_memory_grow(2, 0, &index, &value);
  
  
  	ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(phalcon_mvc_model_exception_ce, "Row is an immutable ArrayAccess object", "phalcon/Mvc/Model/Row.zep", 70);
  	return;
  }
  
  /**
   * Rows cannot be changed. It has only been implemented to meet the definition of the ArrayAccess interface
   *
   * @param string|int offset
   */
  PHP_METHOD(Phalcon_Mvc_Model_Row, offsetUnset)
  {
  	zval *offset, offset_sub;
  	zval *this_ptr = getThis();
  
  	ZVAL_UNDEF(&offset_sub);
  #if PHP_VERSION_ID >= 80000
  	bool is_null_true = 1;
  	ZEND_PARSE_PARAMETERS_START(1, 1)
  		Z_PARAM_ZVAL(offset)
  	ZEND_PARSE_PARAMETERS_END();
  #endif
  
  
  	zephir_fetch_params_without_memory_grow(1, 0, &offset);
  
  
  	ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(phalcon_mvc_model_exception_ce, "Row is an immutable ArrayAccess object", "phalcon/Mvc/Model/Row.zep", 80);
  	return;
  }
  
  /**
   * Reads an attribute value by its name
   *
   *```php
   * echo $robot->readAttribute("name");
   *```
   *
   * @return mixed
   */
  PHP_METHOD(Phalcon_Mvc_Model_Row, readAttribute)
  {
  	zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
  	zval *attribute_param = NULL, value;
  	zval attribute;
  	zval *this_ptr = getThis();
  
  	ZVAL_UNDEF(&attribute);
  	ZVAL_UNDEF(&value);
  #if PHP_VERSION_ID >= 80000
  	bool is_null_true = 1;
  	ZEND_PARSE_PARAMETERS_START(1, 1)
  		Z_PARAM_STR(attribute)
  	ZEND_PARSE_PARAMETERS_END();
  #endif
  
  
  	ZEPHIR_MM_GROW();
  	zephir_fetch_params(1, 1, 0, &attribute_param);
  	if (UNEXPECTED(Z_TYPE_P(attribute_param) != IS_STRING && Z_TYPE_P(attribute_param) != IS_NULL)) {
  		zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'attribute' must be of the type string"));
  		RETURN_MM_NULL();
  	}
  	if (EXPECTED(Z_TYPE_P(attribute_param) == IS_STRING)) {
  		zephir_get_strval(&attribute, attribute_param);
  	} else {
  		ZEPHIR_INIT_VAR(&attribute);
  	}
  
  
  	ZEPHIR_OBS_VAR(&value);
  	if (!(zephir_fetch_property_zval(&value, this_ptr, &attribute, PH_SILENT_CC))) {
  		RETURN_MM_NULL();
  	}
  	RETURN_CTOR(&value);
  }
  
  /**
   * Set the current object's state
   */
  PHP_METHOD(Phalcon_Mvc_Model_Row, setDirtyState)
  {
  	zval *dirtyState_param = NULL;
  	zend_long dirtyState;
  	zval *this_ptr = getThis();
  
  #if PHP_VERSION_ID >= 80000
  	bool is_null_true = 1;
  	ZEND_PARSE_PARAMETERS_START(1, 1)
  		Z_PARAM_LONG(dirtyState)
  	ZEND_PARSE_PARAMETERS_END();
  #endif
  
  
  	zephir_fetch_params_without_memory_grow(1, 0, &dirtyState_param);
  	dirtyState = zephir_get_intval(dirtyState_param);
  
  
  	RETURN_BOOL(0);
  }
  
  /**
   * Returns the instance as an array representation
   */
  PHP_METHOD(Phalcon_Mvc_Model_Row, toArray)
  {
  	zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
  	zend_long ZEPHIR_LAST_CALL_STATUS;
  	zval *this_ptr = getThis();
  
  
  
  	ZEPHIR_MM_GROW();
  
  	ZEPHIR_RETURN_CALL_FUNCTION("get_object_vars", NULL, 477, this_ptr);
  	zephir_check_call_status();
  	RETURN_MM();
  }
  
  /**
   * Writes an attribute value by its name
   *
   *```php
   * $robot->writeAttribute("name", "Rosey");
   *```
   *
   * @param mixed value
   */
  PHP_METHOD(Phalcon_Mvc_Model_Row, writeAttribute)
  {
  	zephir_method_globals *ZEPHIR_METHOD_GLOBALS_PTR = NULL;
  	zval *attribute_param = NULL, *value, value_sub;
  	zval attribute;
  	zval *this_ptr = getThis();
  
  	ZVAL_UNDEF(&attribute);
  	ZVAL_UNDEF(&value_sub);
  #if PHP_VERSION_ID >= 80000
  	bool is_null_true = 1;
  	ZEND_PARSE_PARAMETERS_START(2, 2)
  		Z_PARAM_STR(attribute)
  		Z_PARAM_ZVAL(value)
  	ZEND_PARSE_PARAMETERS_END();
  #endif
  
  
  	ZEPHIR_MM_GROW();
  	zephir_fetch_params(1, 2, 0, &attribute_param, &value);
  	if (UNEXPECTED(Z_TYPE_P(attribute_param) != IS_STRING && Z_TYPE_P(attribute_param) != IS_NULL)) {
  		zephir_throw_exception_string(spl_ce_InvalidArgumentException, SL("Parameter 'attribute' must be of the type string"));
  		RETURN_MM_NULL();
  	}
  	if (EXPECTED(Z_TYPE_P(attribute_param) == IS_STRING)) {
  		zephir_get_strval(&attribute, attribute_param);
  	} else {
  		ZEPHIR_INIT_VAR(&attribute);
  	}
  
  
  	zephir_update_property_zval_zval(this_ptr, &attribute, value);
  	ZEPHIR_MM_RESTORE();
  }
  
  