cc_id; } /** * Sets the value of cc_id. * * @param mixed $cc_id the cc id * * @return self */ private function set_cc_id($cc_id) { $this->cc_id = $cc_id; return $this; } /** * Gets the value of cc_name. * * @return mixed */ public function get_cc_name() { return $this->cc_name; } /** * Sets the value of cc_name. * * @param mixed $cc_name the cc name * * @return self */ private function set_cc_name($cc_name) { $this->cc_name = $cc_name; return $this; } /** * Gets the value of cc_mobile. * * @return mixed */ public function get_cc_mobile() { return $this->cc_mobile; } /** * Sets the value of cc_mobile. * * @param mixed $cc_mobile the cc mobile * * @return self */ private function set_cc_mobile($cc_mobile) { $this->cc_mobile = $cc_mobile; return $this; } /** * Gets the value of cc_email. * * @return mixed */ public function get_cc_email() { return $this->cc_email; } /** * Sets the value of cc_email. * * @param mixed $cc_email the cc email * * @return self */ private function set_cc_email($cc_email) { $this->cc_email = $cc_email; return $this; } /** * Gets the value of cc_facebook. * * @return mixed */ public function get_cc_facebook() { return $this->cc_facebook; } /** * Sets the value of cc_facebook. * * @param mixed $cc_facebook the cc facebook * * @return self */ private function set_cc_facebook($cc_facebook) { $this->cc_facebook = $cc_facebook; return $this; } /** * Gets the value of cc_camp_contact_type_cct_id. * * @return mixed */ public function get_cc_camp_contact_type_cct_id() { return $this->cc_camp_contact_type_cct_id; } /** * Sets the value of cc_camp_contact_type_cct_id. * * @param mixed $cc_camp_contact_type_cct_id the cc camp contact type cct id * * @return self */ private function set_cc_camp_contact_type_cct_id($cc_camp_contact_type_cct_id) { $this->cc_camp_contact_type_cct_id = $cc_camp_contact_type_cct_id; return $this; } /** * Gets the value of cc_camp_contact_type. * * @return mixed */ public function get_cc_camp_contact_type() { return $this->cc_camp_contact_type; } /** * Sets the value of cc_camp_contact_type. * * @param mixed $cc_camp_contact_type the cc camp contact type * * @return self */ private function set_cc_camp_contact_type($cc_camp_contact_type) { $this->cc_camp_contact_type = $cc_camp_contact_type; return $this; } /** * Gets the value of cc_owner_id. * * @return mixed */ public function get_cc_owner_id() { return $this->cc_owner_id; } /** * Sets the value of cc_owner_id. * * @param mixed $cc_owner_id the cc owner id * * @return self */ private function set_cc_owner_id($cc_owner_id) { $this->cc_owner_id = $cc_owner_id; return $this; } /** * Gets the value of cc_owner. * * @return mixed */ public function get_cc_owner() { return $this->cc_owner; } /** * Sets the value of cc_owner. * * @param mixed $cc_owner the cc owner * * @return self */ private function set_cc_owner($cc_owner) { $this->cc_owner = $cc_owner; return $this; } /** * Gets the value of cc_original_id. * * @return mixed */ public function get_cc_original_id() { return $this->cc_original_id; } /** * Sets the value of cc_original_id. * * @param mixed $cc_original_id the cc original id * * @return self */ private function set_cc_original_id($cc_original_id) { $this->cc_original_id = $cc_original_id; return $this; } /** * Gets the value of cc_original. * * @return mixed */ public function get_cc_original() { return $this->cc_original; } /** * Sets the value of cc_original. * * @param mixed $cc_original the cc original * * @return self */ private function set_cc_original($cc_original) { $this->cc_original = $cc_original; return $this; } public function set_cc_data_by_id($_id) { global $sql; $cc_data_assoc_array = $sql->assoc_array("select * from camp_contact where cc_id = " . $_id); $cc_array = $cc_data_assoc_array[0]; foreach ($cc_array as $field => $value) { $function_name = "set_" . $field; $this->$function_name($value); if ($field == 'cc_camp_contact_type_cct_id') { $new_cct = new camp_contact_type(); $new_cct->set_cct_data_by_id($value); $this->set_cc_camp_contact_type($new_cct); } if ($field == 'cc_owner_id') { $new_cu = new camp_user(); $new_cu->set_user_data_by_id($value); $this->set_cc_owner($new_cu); } if ($field == 'cc_original_id' && !empty($value)) { $new_cc = new camp_contact(); $new_cc->set_cc_data_by_id($value); $this->set_cc_original($new_cc); } } } private static function empty_to_null($str) { return ($str == ""?"null":$str); } public static function create_camp_contact($_name, $_mobile, $_email, $_facebook, $_cct_id, $_owner_id, $_original_id) { global $sql; return $sql->insert_into('camp_contact', array( 'cc_name' => $_name, 'cc_mobile' => $_mobile, 'cc_email' => $_email, 'cc_facebook' => self::empty_to_null($_facebook), 'cc_camp_contact_type_cct_id' => $_cct_id, 'cc_owner_id' => $_owner_id, 'cc_original_id' => $_original_id, ) ); } } ?>