/** * Prepare and sanitise the table prior to saving. * * @param SocialCommunityTableProfile $table * @param array $data * * @since 1.6 */ protected function prepareContact($table, $data) { $secretKey = JFactory::getApplication()->get('secret'); if (!$data['phone']) { $data['phone'] = null; } else { $data['phone'] = Defuse\Crypto\Crypto::encrypt($data['phone'], $secretKey); } if (!$data['address']) { $data['address'] = null; } else { $data['address'] = Defuse\Crypto\Crypto::encrypt($data['address'], $secretKey); } if (!$data['website']) { $data['website'] = null; } $table->set('phone', $data['phone']); $table->set('address', $data['address']); $table->set('country_id', (int) $data['country_id']); $table->set('location_id', (int) $data['location_id']); $table->set('website', $data['website']); }
/** * Prepare and sanitise the table prior to saving. * * @param SocialCommunityTableProfile $table * @param array $data * * @since 1.6 */ protected function prepareContact($table, $data) { if (!$data["phone"]) { $data["phone"] = null; } if (!$data["address"]) { $data["address"] = null; } if (!$data["website"]) { $data["website"] = null; } $table->set("phone", $data["phone"]); $table->set("address", $data["address"]); $table->set("country_id", (int) $data["country_id"]); $table->set("location_id", (int) $data["location_id"]); $table->set("website", $data["website"]); }