本文整理匯總了PHP中Plan::getEntity方法的典型用法代碼示例。如果您正苦於以下問題:PHP Plan::getEntity方法的具體用法?PHP Plan::getEntity怎麽用?PHP Plan::getEntity使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Plan
的用法示例。
在下文中一共展示了Plan::getEntity方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: actionAddPlanPicture
public function actionAddPlanPicture()
{
if (isset($_FILES) && count($_FILES) > 0 && ControleurRights::canAddPlans()) {
$plan = new Plan();
$plan = Plan::getEntity($_POST['id_plan']);
// Delete old picture
if ($plan->getMedia_id() != null) {
$old_media = Media::getEntity($plan->getMedia_id());
$old_media->deleteEntity();
}
// Upload new picture
$media_list = ControleurMedia::actionUploadNewMedia($_FILES, $_POST['id_plan'], $plan->getName());
// Save picture to plan
$media = $media_list[0];
$media->setIs_main_media(true);
$media->updateEntity();
$plan->setMedia_id($media->getId());
$plan->updateEntity();
}
}
示例2: actionGetEntity
public static function actionGetEntity()
{
if (isset($_GET['t']) && $_GET['t']) {
$table = $_GET['t'];
if (isset($_GET['i']) && $_GET['i'] && $_GET['i'] != null) {
$id = $_GET['i'];
} else {
$id = null;
}
if ($table == 'customers' && ControleurRights::canAddCustomer()) {
return Customer::getEntity($id);
} elseif ($table == 'team_member' && ControleurRights::canAddTeamMember()) {
$member = TeamMember::getEntity($id);
$member->setSkills(Skill::getSkillsForUser($id));
return $member;
} elseif ($table == 'users' && ControleurRights::canAddUser()) {
$user = User::getEntity($id);
$user->setPicture();
return $user;
} elseif ($table == 'projects' && ControleurRights::canDisplayProjects()) {
$project = Project::getEntity($id);
$project->setSkills(Skill::getSkillsForProject($id));
return $project;
} elseif ($table == 'plans' && ControleurRights::canDisplayPlans()) {
return Plan::getEntity($id);
} elseif ($table == 'right' && ControleurRights::canAddUser()) {
$right = Right::getEntity($id);
$rightClass = new ReflectionClass('RightColumnsLabel');
$right->setLabels($rightClass->getConstants());
return $right;
} elseif ($table == 'skills' && ControleurRights::canAddSkills()) {
return Skill::getEntity($id);
} else {
return "Table " . $table . " non configurée dans le CRUD ou interdiction d'accès à l'utilisateur";
}
}
}