示例#1
0
 function _setIDLinkItems($changed_key)
 {
     if ($changed_key == CS_PROJECT_TYPE) {
         if (!empty($this->_data[$changed_key]) and is_array($this->_data[$changed_key])) {
             $this->setInternalProjectIDArray($this->_data[$changed_key]);
         }
     }
     parent::_setIDLinkItems($changed_key);
 }
示例#2
0
 function _setIDLinkItems($changed_key)
 {
     if ($changed_key == CS_COMMUNITY_TYPE) {
         if (isset($this->_data[$changed_key]) and is_array($this->_data[$changed_key])) {
             $community_save_array = array();
             $community_manager = $this->_environment->getCommunityManager();
             foreach ($this->_data[$changed_key] as $key => $id) {
                 if (!empty($id['iid'])) {
                     $id = $id['iid'];
                 }
                 $item = $community_manager->getItem($id);
                 if (!empty($item)) {
                     $item->addProjectID2InternalProjectIDArray($this->getItemID());
                     $community_save_array[] = $id;
                     $item->saveWithoutChangingModificationInformation();
                 }
                 unset($item);
             }
             if (!empty($this->_old_community_id_array)) {
                 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::_setIDLinkItems($changed_key);
 }