Documentation

ScheduleHandle
in package
uses ClientContextTrait

FinalYes

Table of Contents

Properties

$clientOptions  : ClientOptions
$converter  : DataConverterInterface
$id  : string
$marshaller  : MarshallerInterface
$namespace  : string
$protoConverter  : ProtoToArrayConverter

Methods

__construct()  : mixed
backfill()  : void
Backfill the schedule by going though the specified time periods and taking Actions as if that time passed by right now, all at once.
delete()  : void
Delete the Schedule.
describe()  : ScheduleDescription
Describe fetches the Schedule's description from the Server
getID()  : string
GetID returns the schedule ID associated with this handle.
listScheduleMatchingTimes()  : Countable|Traversable<int, DateTimeImmutable>
Lists matching times within a range.
pause()  : void
Pause the Schedule will also overwrite the Schedules current note with the new note.
trigger()  : void
Trigger an Action to be taken immediately. Will override the schedules default policy with the one specified here. If overlap is {@see ScheduleOverlapPolicy::Unspecified} the Schedule policy will be used.
unpause()  : void
Unpause the Schedule will also overwrite the Schedules current note with the new note.
update()  : void
Update the Schedule.
patch()  : PatchScheduleRequest

Properties

$protoConverter read-only

private ProtoToArrayConverter $protoConverter

Methods

backfill()

Backfill the schedule by going though the specified time periods and taking Actions as if that time passed by right now, all at once.

public backfill(iterable<string|int, BackfillPeriod$periods) : void
Parameters
$periods : iterable<string|int, BackfillPeriod>

Time periods to backfill the schedule.

getID()

GetID returns the schedule ID associated with this handle.

public getID() : string
Return values
string

listScheduleMatchingTimes()

Lists matching times within a range.

public listScheduleMatchingTimes(DateTimeInterface $startTime, DateTimeInterface $endTime) : Countable|Traversable<int, DateTimeImmutable>
Parameters
$startTime : DateTimeInterface
$endTime : DateTimeInterface
Return values
Countable|Traversable<int, DateTimeImmutable>

pause()

Pause the Schedule will also overwrite the Schedules current note with the new note.

public pause([string $note = 'Paused via PHP SDK' ]) : void
Parameters
$note : string = 'Paused via PHP SDK'

Informative human-readable message with contextual notes.

Tags
psalm-assert

non-empty-string $note

trigger()

Trigger an Action to be taken immediately. Will override the schedules default policy with the one specified here. If overlap is {@see ScheduleOverlapPolicy::Unspecified} the Schedule policy will be used.

public trigger([ScheduleOverlapPolicy $overlapPolicy = ScheduleOverlapPolicy::Unspecified ]) : void
Parameters
$overlapPolicy : ScheduleOverlapPolicy = ScheduleOverlapPolicy::Unspecified

If specified, policy to override the Schedules default overlap policy.

unpause()

Unpause the Schedule will also overwrite the Schedules current note with the new note.

public unpause([string $note = 'Unpaused via PHP SDK' ]) : void
Parameters
$note : string = 'Unpaused via PHP SDK'

Informative human-readable message with contextual notes.

Tags
psalm-assert

non-empty-string $note

update()

Update the Schedule.

public update(Schedule|callable(ScheduleUpdateInput): ScheduleUpdate $schedule[, string|null $conflictToken = null ]) : void

Examples:

Add a search attribute to the schedule:

 $handle->update(function (ScheduleUpdateInput $input): ScheduleUpdate {
     return ScheduleUpdate::new($input->description->schedule)
         ->withSearchAttributes($input->description->searchAttributes
             ->withValue('foo', 'bar'),
             ->withValue('bar', 42),
         );
});

Pause a described schedule:

 $description = $handle->describe();
 $schedule = $description->schedule;
 $handle->update(
     $schedule
         ->withState($schedule->state->withPaused(true)),
     $description->conflictToken,
 );

NOTE: If two Update calls are made in parallel to the same Schedule there is the potential for a race condition. Use $conflictToken to avoid this.

Parameters
$schedule : Schedule|callable(ScheduleUpdateInput): ScheduleUpdate

The new Schedule to update to or a closure that will be passed the current ScheduleDescription and should return a ScheduleUpdate.

$conflictToken : string|null = null

Can be the value of ScheduleDescription::$conflictToken, which will cause this request to fail if the schedule has been modified between the self::describe() and this Update. If missing, the schedule will be updated unconditionally.

patch()

private patch(SchedulePatch $patch) : PatchScheduleRequest
Parameters
$patch : SchedulePatch
Return values
PatchScheduleRequest

        
On this page

Search results