本文整理匯總了PHP中Sql::get_user_name_from_id方法的典型用法代碼示例。如果您正苦於以下問題:PHP Sql::get_user_name_from_id方法的具體用法?PHP Sql::get_user_name_from_id怎麽用?PHP Sql::get_user_name_from_id使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Sql
的用法示例。
在下文中一共展示了Sql::get_user_name_from_id方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: get_project_from_row
/**
* Get a project object from a SQL row result.
*/
private static function get_project_from_row($row)
{
$project = NULL;
if ($row) {
$project = new Project(NULL, $row['project_urlname']);
$project->set_id($row['project_id']);
$project->set_safe_name($row['project_name']);
$project->set_safe_url_name($row['project_urlname']);
$project->set_safe_description($row['project_description']);
$project->set_worked_per_week($row['project_workedperweek']);
$project->set_owner_user_id($row['project_owneruserid']);
$project->set_owner_user_name(Sql::get_user_name_from_id($row['project_owneruserid']));
}
return $project;
}
示例2: set_include_path
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// FIXME: Use a host that better supports PHP include paths...
set_include_path(get_include_path() . PATH_SEPARATOR . '/customers/tasktaste.com/tasktaste.com/httpd.www/phpincludes');
require_once 'TaskTaste/tasktaste.php';
// Create the project
$unsafe_name = Utils::get_name_from_post(PROJECT_NAME);
$userid = Utils::get_id_from_post(USERID);
$username = Sql::get_user_name_from_id($userid);
if ($username) {
// Create project
$project = Sql::create_project($unsafe_name, $userid);
if ($project) {
$project_id = $project->get_id();
// Setup default settings
Sql::set_worked_per_week($project_id, 1.0);
Sql::set_project_description($project_id, TASKTASTE_DEFAULT_PROJECT_DESCRIPTION);
// Create default tasks
// Task 1
$task1 = Sql::create_task($project_id);
if ($task1) {
Sql::update_task_name($task1->get_id(), TASKTASTE_FIRST_TASK_NAME);
Sql::update_task_size($task1->get_id(), TASKTASTE_FIRST_TASKS_SIZE);
}