/** * Get by user : returns the contact data for given user * * @param array $data : datas from DB (loaded by CMS_profile_user) or CMS_profile_user object * @return CMS_contactData * @access public */ static function getByUser($data) { if (is_array($data)) { return CMS_contactDatas_catalog::getById($data); } elseif (is_a($data, 'CMS_profile_user')) { //ugly method but need it for compatibility //I do not think that it is very often useful, so ... $user = new CMS_profile_user($data->getUserID()); return $user->getContactData(); } else { return null; } }