• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/orm/objectify/entityobject.php
  • Класс: BitrixMainORMObjectifyEntityObject
  • Вызов: EntityObject::sysPostSave
public function sysPostSave()
{
	// clear current values
	foreach ($this->_currentValues as $k => $v)
	{
		$field = $this->entity->getField($k);

		// handle references
		if ($v instanceof EntityObject)
		{
			// hold raw references
			if ($v->state === State::RAW)
			{
				continue;
			}

			// move actual or changed
			if ($v->state === State::ACTUAL || $v->state === State::CHANGED)
			{
				$this->sysSetActual($k, $v);
			}
		}
		elseif ($field instanceof ScalarField || $field instanceof UserTypeField)
		{
			$v = $field->cast($v);

			if ($v instanceof SqlExpression)
			{
				continue;
			}

			$this->sysSetActual($k, $v);
		}

		// clear values
		unset($this->_currentValues[$k]);
	}

	// change state
	$this->sysChangeState(State::ACTUAL);

	// return object field to current values
	foreach ($this->_actualValues as $fieldName => $actualValue)
	{
		if ($this->entity->getField($fieldName) instanceof ObjectField)
		{
			$this->_currentValues[$fieldName] = clone $actualValue;
		}
	}
}