/** * Insert the contact preferences into the database * * @param string $policynumber Policy number * @param Model_Core_CustomerContactPreferences $customerpref Customer preferences */ public function insertPreferences($policynumber, $customerpref) { $preferences = $customerpref->getPreferences(); foreach ($preferences as $preference) { // Insert the preference into the database $templatemodel = new Datasource_Insurance_Document_InsuranceRequestMethods(); $contactprefid = $templatemodel->getRequestMethodId($preference); $data = array('policynumber' => $policynumber, 'contactpref' => $contactprefid); $this->insert($data); } }