public function do_actions() { #/* # * Fetch the data on the admin users. # */ #$user_entries = Admin_UsersHelper::get_all_user_entries(); # #/* # * Preprocess the user data. # */ #$preprocessed_users = array(); # #foreach ($user_entries as $user_entry) { # $preprocessed_users[] # = array( # 'name' => $user_entry->get_name(), # 'email' => $user_entry->get_email(), # 'real_name' => $user_entry->get_real_name(), # 'type' => $user_entry->get_type() # ); #} # #/* # * Print of the data. # */ #CLIScripts_DataRenderingHelper # ::render_array_of_assocs_in_table( # $preprocessed_users # ); $user_assocs = array(); foreach (Admin_UsersHelper::get_all_user_entries() as $user_entry) { $user_assocs[] = $user_entry->get_assoc(); } CLIScripts_DataRenderingHelper::render_array_of_assocs_in_table($user_assocs, array('id' => 'ID')); }
public function do_actions() { $user_assocs = array(); foreach (Admin_UsersHelper::get_all_user_entries() as $user_entry) { $user_assocs[] = $user_entry->get_assoc(); } CLIScripts_DataRenderingHelper::render_array_of_assocs_in_table($user_assocs, array('id' => 'ID')); }
public static function get_user_entry_from_cli_choice() { /* * Get the array of users. */ $all_user_entries = Admin_UsersHelper::get_all_user_entries(); /* * Do a bit of array manipulation to put users * into a hash with the names as the key. */ $users_hash = array(); foreach ($all_user_entries as $user_entry) { $users_hash[$user_entry->get_name()] = $user_entry; } /* * Get the user's choice of user. */ return $users_hash[CLIScripts_UserInterrogationHelper::get_choice_from_string_array(array_keys($users_hash))]; }