public function processDefaultValue($key, $default, $value, & $neighbouring_values, $set_neightbouring_values = true, $changed_field = [], $options = []) {
		if (strpos($default, 'dependent::') !== false) {
			// nothing
		} else if (strpos($default, 'master_object::') !== false) {
			$field = explode('::', str_replace(['master_object::', 'static::'], '', $default));
			return $this->master_object->{$field[0]}->{$field[1]}->{$field[2]};
		} else if (strpos($default, 'parent::') !== false) {
			$field = str_replace(['parent::', 'static::'], '', $default);
			$value = $this->values[$field] ?? null;
		} else {
			if ($default === 'now()') $default = \Format::now('timestamp');
			$value = $default;
		}
		// handling override_field_value method
		if (!empty($this->wrapper_methods['processDefaultValue']['main'])) {
			// fix changed field
			if (empty($changed_field)) $changed_field = [];
			$changed_field['parent'] = $changed_field['parent'] ?? null;
			$changed_field['detail'] = $changed_field['detail'] ?? null;
			$changed_field['subdetail'] = $changed_field['subdetail'] ?? null;
			// call override method
			$model = $this->wrapper_methods['processDefaultValue']['main'][0];
			$model->{$this->wrapper_methods['processDefaultValue']['main'][1]}($this, $key, $default, $value, $neighbouring_values, $changed_field, $options);
		}
		// if we need to set neightbouring values
		if ($set_neightbouring_values) {
			$neighbouring_values[$key] = $value;
		}
		return $value;
	}
public function processDefaultValue($key, $default, $value, & $neighbouring_values, $set_neightbouring_values = true, $changed_field = [], $options = []) {
		if (strpos($default, 'dependent::') !== false) {
			// nothing
		} else if (strpos($default, 'master_object::') !== false) {
			$field = explode('::', str_replace(['master_object::', 'static::'], '', $default));
			return $this->master_object->{$field[0]}->{$field[1]}->{$field[2]};
		} else if (strpos($default, 'parent::') !== false) {
			$field = str_replace(['parent::', 'static::'], '', $default);
			$value = $this->values[$field] ?? null;
		} else {
			if ($default === 'now()') $default = \Format::now('timestamp');
			$value = $default;
		}
		// handling override_field_value method
		if (!empty($this->wrapper_methods['processDefaultValue']['main'])) {
			// fix changed field
			if (empty($changed_field)) $changed_field = [];
			$changed_field['parent'] = $changed_field['parent'] ?? null;
			$changed_field['detail'] = $changed_field['detail'] ?? null;
			$changed_field['subdetail'] = $changed_field['subdetail'] ?? null;
			// call override method
			$model = $this->wrapper_methods['processDefaultValue']['main'][0];
			$model->{$this->wrapper_methods['processDefaultValue']['main'][1]}($this, $key, $default, $value, $neighbouring_values, $changed_field, $options);
		}
		// if we need to set neightbouring values
		if ($set_neightbouring_values) {
			$neighbouring_values[$key] = $value;
		}
		return $value;
	}
public function processDefaultValue ( $ key , $ default , $ value , & $ neighbouring_values , $ set_neightbouring_values = true , $ changed_field = [ ] , $ options = [ ] ) { if ( strpos ( $ default , 'dependent::' ) !== false ) { // nothing } else if ( strpos ( $ default , 'master_object::' ) !== false ) { $ field = explode ( '::' , str_replace ( [ 'master_object::' , 'static::' ] , '' , $ default ) ) ; return $ this -> master_object -> { $ field [ 0 ] } -> { $ field [ 1 ] } -> { $ field [ 2 ] } ; } else if ( strpos ( $ default , 'parent::' ) !== false ) { $ field = str_replace ( [ 'parent::' , 'static::' ] , '' , $ default ) ; $ value = $ this -> values [ $ field ] ?? null ; } else { if ( $ default === 'now()' ) $ default = \ Format :: now ( 'timestamp' ) ; $ value = $ default ; } // handling override_field_value method if ( ! empty ( $ this -> wrapper_methods [ 'processDefaultValue' ] [ 'main' ] ) ) { // fix changed field if ( empty ( $ changed_field ) ) $ changed_field = [ ] ; $ changed_field [ 'parent' ] = $ changed_field [ 'parent' ] ?? null ; $ changed_field [ 'detail' ] = $ changed_field [ 'detail' ] ?? null ; $ changed_field [ 'subdetail' ] = $ changed_field [ 'subdetail' ] ?? null ; // call override method $ model = $ this -> wrapper_methods [ 'processDefaultValue' ] [ 'main' ] [ 0 ] ; $ model -> { $ this -> wrapper_methods [ 'processDefaultValue' ] [ 'main' ] [ 1 ] } ( $ this , $ key , $ default , $ value , $ neighbouring_values , $ changed_field , $ options ) ; } // if we need to set neightbouring values if ( $ set_neightbouring_values ) { $ neighbouring_values [ $ key ] = $ value ; } return $ value ; }
Process default value

@param string $key
@param mixed $default
@param array $neighbouring_values
@param boolean $set_neightbouring_values
@param array $changed_field
@param array $options
@return mixed
Process default value