public function GroupContainer(ContactContainerWithSingleGroup $contactContainer = null) { BaseContainer::BaseContainer(); if (null !== $contactContainer) { $this->MassSetValue($contactContainer->GetContainer()); } }
protected function _ProcessParsedContact($IdUser, ContactContainerWithSingleGroup $contactContainer) { $ll =& CLog::CreateInstance(); $contactContainer->SetValue('IdUser', $IdUser, 'int'); $contactStrId = $contactContainer->GetValue('StrId'); $groupStrId = $contactContainer->GetValue('GroupStrId'); $groupName = $contactContainer->GetValue('GroupName'); $contact = new ContactContainer($contactContainer); $contact->SetValue('IdUser', $IdUser, 'int'); $ContactId = $this->_GetContactIdByStrId($IdUser, $contactStrId); if (0 < $ContactId) { $contact->SetValue('IdAddress', $ContactId, 'int'); } if (!empty($groupName)) { $groupContainer = $this->_GetGroupByStrId($IdUser, $groupStrId); if ($groupContainer) { $groupId = $groupContainer->GetValue('GroupId'); $groupContainer->MassSetValue($contactContainer->GetContainer()); $groupContainer->SetValue('GroupId', $groupId, 'int'); $groupContainer->SetValue('IdUser', $IdUser, 'int'); $this->_UpdateGroup($groupContainer); } else { $groupContainer = new GroupContainer($contactContainer); $groupContainer->SetValue('IdUser', $IdUser, 'int'); $this->_CreateGroup($groupContainer); } $contact->SetValue('Groups', array($groupContainer)); } if (0 < $contact->GetValue('IdAddress', 'int')) { $this->_UpdateVCardContact($contact); } else { $this->_CreateContact($contact); } }