private function deleteLanguageKnown($member_id, $language_id) { $language = new Tnp_Model_MemberInfo_Language(); $language->setMember_id($member_id); $language->setLanguage_id($language_id); $language->deleteLanguageKnown(); }
public function saveLanguageInfo($data_array) { $member_id = $this->getMember_id(true); $language_id = $data_array['language_id']; Zend_Registry::get('logger')->debug('Language id = ' . $language_id); $info = $this->fetchLanguageProficiency($language_id); Zend_Registry::get('logger')->debug('Info = ' . $info); if ($info == false) { $member_lang = new Tnp_Model_MemberInfo_Language(); $member_lang->initSave(); $data_array['member_id'] = $member_id; $preparedData = $member_lang->prepareDataForSaveProcess($data_array); Zend_Registry::get('logger')->debug('Saving language'); Zend_Registry::get('logger')->debug($preparedData); return $member_lang->getMapper()->save($preparedData); } else { $member_lang = new Tnp_Model_MemberInfo_Language(); $member_lang->initSave(); unset($data_array['member_id']); unset($data_array['language_id']); $prepared_data = $member_lang->prepareDataForSaveProcess($data_array); Zend_Registry::get('logger')->debug('Updating language'); Zend_Registry::get('logger')->debug($prepared_data); return $member_lang->getMapper()->update($prepared_data, $member_id, $language_id); } }