本文整理汇总了PHP中Report::findById方法的典型用法代码示例。如果您正苦于以下问题:PHP Report::findById方法的具体用法?PHP Report::findById怎么用?PHP Report::findById使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Report
的用法示例。
在下文中一共展示了Report::findById方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fullLogModalAction
/**
* Show full logs modal for a report (manually or cron job)
*/
public function fullLogModalAction()
{
$report = Report::findById($this->request->get('id'));
$this->view->report = $report;
}
示例2: getReport
public function getReport()
{
return Report::findById($this->rid);
}
示例3: changePermissionAction
/**
* Change and assign permision for a report of for an user
* Will always return integer "1"
*/
public function changePermissionAction()
{
//case of permission per report
if ($this->request->get('report')) {
$report = Report::findById($this->request->get('report'));
$users = User::find(['conditions' => ['type' => 'operator', 'status' => 1]]);
$perm = $this->request->get('perm');
foreach ($users as $user) {
if (isset($perm[$user->getId()]) && in_array('view', $perm[$user->getId()])) {
$user->setPermission('Report', $report->getId(), $perm[$user->getId()]);
} else {
$user->unsetPermission('Report', $report->getId(), $perm[$user->getId()]);
}
$user->save();
}
}
//case of permission per user
if ($this->request->get('user')) {
$user = User::findById($this->request->get('user'));
$user->removePermissions();
if ($perm = $this->request->get('perm')) {
foreach ($perm as $key => $val) {
$user->setPermission('Report', $key, $val);
}
}
$user->save();
}
echo 1;
$this->view->setRenderLevel(View::LEVEL_NO_RENDER);
}