• Модуль: dav
  • Путь к файлу: ~/bitrix/modules/dav/classes/general/addressbookcrmbase.php
  • Класс: CDavAddressbookCrmBase
  • Вызов: CDavAddressbookCrmBase::Put
public function Put($id, $card)
{
	//TODO: in future, when iOS client will have correct put functionality with groups, then there we can add crm entities from phone addressbook
	return parent::Put($id, $card);
	$entityParams = $this->PrepareEntityParamsFromVCard($id, $card);
	$photoProperty = $card->GetProperties('PHOTO');
	if (!empty($photoProperty[0]))
	{
		$photo = $photoProperty[0];
	}
	if ((int)$id && $oldEntity = $this->LoadEntityById($id))
	{
		$multiFields = $this->LoadMultiFields($id);
		$oldEntityParams = $this->AttachMultiFieldsToEntityForImport($multiFields, $oldEntity);
		if (isset($photo))
			$oldEntityParams = $this->AttachToEntityImgId($oldEntityParams, $photo->Value(), $photo->Parameter('TYPE'));
		$mergedEntityParams = $this->Merge($entityParams, $oldEntityParams);
		return $this->UpdateEntity($id, $mergedEntityParams);
	}
	else
	{
		if (isset($photo))
			$entityParams = $this->AttachToEntityImgId($entityParams, $photo->Value(), $photo->Parameter('TYPE'));
		return $this->AddEntity($entityParams);
	}
}