本文整理汇总了PHP中Program::getById方法的典型用法代码示例。如果您正苦于以下问题:PHP Program::getById方法的具体用法?PHP Program::getById怎么用?PHP Program::getById使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Program
的用法示例。
在下文中一共展示了Program::getById方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: listofmodule
public function listofmodule($request, $response)
{/*{{{*/
$response->programList = DAL::get()->find_all('Program');
$moduleId = $request->moduleid;
$programId = $request->programid;
$response->moduleId = $moduleId;
$response->moduleid_seleted = $request->moduleid;
$response->programid_seleted = $request->programid;
$response->module = Module::getById($moduleId);
$response->funpoints = array();
if($response->module instanceof Module)
{
$response->funpoints = $response->module->getFunpoints();
//fix programid_seleted
$response->programid_seleted = $response->module->program->id;
$response->program = $response->module->program;
}elseif($request->programid > 0){
$response->program = Program::getById($request->programid);
$response->funpoints = $response->program->getFunpoints();
}
}/*}}}*/
示例2: listofprogram
public function listofprogram($request, $response)
{/*{{{*/
$response->programList = DAL::get()->find_all('Program');
$programId = $request->programid;
$response->programId = $programId;
$response->program = $program = Program::getById($programId);
$response->modules = array();
if($program instanceof Program)
{
$response->modules = $program->getModules();
}elseif($request->programid === '0') {
$response->modules = DAL::get()->find_all('Module');
}
}/*}}}*/
示例3: foreach
<?php
$programId_i = 0;
foreach($testTask->getTaskItems4Process() as $programId => $arr1)
{
$aProgram = Program::getById($programId);
$programId_i ++;
?>
<div class='greenBorderDiv'>
<span style='font-weight:bold;'>
<?php if($aProgram->id != $taskItem->usecase->funpoint->module->program->id){ ?>
<a href='/taskitem/next?testTaskId=<?=$testTask->id ?>&programId=<?=$programId ?>'>项目<?=$programId_i?>:<?=$aProgram->name?></a>
<?php }else{ ?>项目<?=$programId_i?>:<?=$aProgram->name?>
<?php }?>
</span>
<?php ?>
<?php if( $aProgram->id != $taskItem->usecase->funpoint->module->program->id){
echo $testTask->getSumInfoStr4Program($arr1);
echo '</div>';
continue;
}else{
echo $testTask->getSimpleSumInfoStr4Program($arr1);
} ?>
<?php
$moduleId_i = 0;
foreach($arr1 as $moduleId => $arr2){
$aModule = Module::getById($moduleId);
$moduleId_i ++;
?>