function _setObjectLinkItems($changed_key) { if ($changed_key == CS_PROJECT_TYPE) { $array = array(); if (!empty($this->_data[$changed_key]) and is_object($this->_data[$changed_key])) { $item = $this->_data[$changed_key]->getFirst(); while ($item) { $array[] = $item->getItemID(); $item = $this->_data[$changed_key]->getNext(); } } $this->setInternalProjectIDArray($array); } parent::_setObjectLinkItems($changed_key); }
function _setObjectLinkItems($changed_key) { if ($changed_key == CS_COMMUNITY_TYPE) { if (!empty($this->_data[$changed_key]) and is_object($this->_data[$changed_key])) { $item = $this->_data[$changed_key]->getFirst(); $community_save_array = array(); while ($item) { $item->addProjectID2InternalProjectIDArray($this->getItemID()); $item->saveWithoutChangingModificationInformation(); $community_save_array[] = $item->getItemID(); unset($item); $item = $this->_data[$changed_key]->getNext(); } if (!empty($this->_old_community_id_array)) { $community_manager = $this->_environment->getCommunityManager(); foreach ($this->_old_community_id_array as $id) { if (!in_array($id, $community_save_array)) { $item = $community_manager->getItem($id); if (!empty($item)) { $item->removeProjectID2InternalProjectIDArray($this->getItemID()); $item->saveWithoutChangingModificationInformation(); } unset($item); } } unset($community_manager); } } } parent::_setObjectLinkItems($changed_key); }