本文整理汇总了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";
}
}
}