本文整理汇总了PHP中Schedule::SetAdminGroupId方法的典型用法代码示例。如果您正苦于以下问题:PHP Schedule::SetAdminGroupId方法的具体用法?PHP Schedule::SetAdminGroupId怎么用?PHP Schedule::SetAdminGroupId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Schedule
的用法示例。
在下文中一共展示了Schedule::SetAdminGroupId方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _GetAllRows
private function _GetAllRows()
{
$rows = $this->GetRows();
$expected = array();
foreach ($rows as $item) {
$schedule = new Schedule($item[ColumnNames::SCHEDULE_ID], $item[ColumnNames::SCHEDULE_NAME], $item[ColumnNames::SCHEDULE_DEFAULT], $item[ColumnNames::SCHEDULE_WEEKDAY_START], $item[ColumnNames::SCHEDULE_DAYS_VISIBLE], $item[ColumnNames::TIMEZONE_NAME]);
$schedule->SetAdminGroupId($item[ColumnNames::SCHEDULE_ADMIN_GROUP_ID]);
$expected[] = $schedule;
}
return $expected;
}
示例2: Add
public function Add(Schedule $schedule, $copyLayoutFromScheduleId)
{
$user = $this->repo->LoadById($this->user->UserId);
if (!$user->IsInRole(RoleLevel::SCHEDULE_ADMIN)) {
throw new Exception(sprintf('Schedule Add Failed. User %s does not have admin access.', $this->user->UserId));
}
foreach ($user->Groups() as $group) {
if ($group->IsScheduleAdmin) {
$schedule->SetAdminGroupId($group->GroupId);
break;
}
}
parent::Add($schedule, $copyLayoutFromScheduleId);
}
示例3: FromRow
/**
* @static
* @param array $row
* @return Schedule
*/
public static function FromRow($row)
{
$schedule = new Schedule($row[ColumnNames::SCHEDULE_ID], $row[ColumnNames::SCHEDULE_NAME], $row[ColumnNames::SCHEDULE_DEFAULT], $row[ColumnNames::SCHEDULE_WEEKDAY_START], $row[ColumnNames::SCHEDULE_DAYS_VISIBLE], $row[ColumnNames::TIMEZONE_NAME], $row[ColumnNames::LAYOUT_ID]);
$schedule->WithSubscription($row[ColumnNames::ALLOW_CALENDAR_SUBSCRIPTION]);
$schedule->WithPublicId($row[ColumnNames::PUBLIC_ID]);
$schedule->SetAdminGroupId($row[ColumnNames::SCHEDULE_ADMIN_GROUP_ID]);
return $schedule;
}
示例4: testCanUpdateSchedule
public function testCanUpdateSchedule()
{
$id = 10;
$name = 'super schedule';
$isDefault = 0;
$weekdayStart = 5;
$daysVisible = 3;
$subscriptionEnabled = true;
$adminGroupId = 123;
$schedule = new Schedule($id, $name, $isDefault, $weekdayStart, $daysVisible);
$schedule->EnableSubscription();
$publicId = $schedule->GetPublicId();
$schedule->SetAdminGroupId($adminGroupId);
$this->scheduleRepository->Update($schedule);
$this->assertEquals(new UpdateScheduleCommand($id, $name, $isDefault, $weekdayStart, $daysVisible, $subscriptionEnabled, $publicId, $adminGroupId), $this->db->_LastCommand);
}