Overview

Namespaces

  • Charcoal
    • Object
    • User
      • Acl

Classes

  • Content
  • ObjectRevision
  • ObjectRoute
  • ObjectSchedule
  • UserData

Interfaces

  • ArchivableInterface
  • CategorizableInterface
  • CategorizableMultipleInterface
  • CategoryInterface
  • ContentInterface
  • HierarchicalInterface
  • ObjectRevisionInterface
  • ObjectRouteInterface
  • ObjectScheduleInterface
  • PublishableInterface
  • RevisionableInterface
  • RoutableInterface
  • UserDataInterface

Traits

  • ArchivableTrait
  • CategorizableMultipleTrait
  • CategorizableTrait
  • CategoryTrait
  • HierarchicalTrait
  • PublishableTrait
  • RevisionableTrait
  • RoutableTrait
  • Overview
  • Namespace
  • Class

Class ObjectSchedule

The object schedule class allows object properties to be changed at a scheduled time.

Required Services

  • "model/factory" — \Charcoal\Model\ModelFactory
Charcoal\Model\AbstractModel
Extended by Charcoal\Object\ObjectSchedule implements Charcoal\Object\ObjectScheduleInterface
Namespace: Charcoal\Object
Located at Charcoal/Object/ObjectSchedule.php
Methods summary
public ObjectContainerInterface
# setModelFactory( Charcoal\Factory\FactoryInterface $factory )

Set an object model factory.

Set an object model factory.

Parameters

$factory
The model factory, to create objects.

Returns

ObjectContainerInterface
Chainable
protected Charcoal\Factory\FactoryInterface
# modelFactory( )

Retrieve the object model factory.

Retrieve the object model factory.

Returns

Charcoal\Factory\FactoryInterface

Throws

RuntimeException
If the model factory was not previously set.
public Charcoal\Object\ObjectScheduleInterface
# setTargetType( string $targetType )

Set the scheduled object's type.

Set the scheduled object's type.

Parameters

$targetType
The object type (model).

Returns

Charcoal\Object\ObjectScheduleInterface
Chainable

Throws

InvalidArgumentException
If the object type parameter is not a string.

Implementation of

Charcoal\Object\ObjectScheduleInterface::setTargetType()
public string
# targetType( )

Retrieve the scheduled object's type.

Retrieve the scheduled object's type.

Returns

string

Implementation of

Charcoal\Object\ObjectScheduleInterface::targetType()
public Charcoal\Object\ObjectScheduleInterface
# setTargetId( mixed $targetId )

Set the scheduled object's ID.

Set the scheduled object's ID.

Parameters

$targetId
The object ID.

Returns

Charcoal\Object\ObjectScheduleInterface
Chainable

Implementation of

Charcoal\Object\ObjectScheduleInterface::setTargetId()
public mixed
# targetId( )

Retrieve the scheduled object's ID.

Retrieve the scheduled object's ID.

Returns

mixed

Implementation of

Charcoal\Object\ObjectScheduleInterface::targetId()
public Charcoal\Object\ObjectRevision
# setDataDiff( array|string $data )

Parameters

$data
The data diff.

Returns

Charcoal\Object\ObjectRevision

Implementation of

Charcoal\Object\ObjectScheduleInterface::setDataDiff()
public array
# dataDiff( )

Returns

array

Implementation of

Charcoal\Object\ObjectScheduleInterface::dataDiff()
public Charcoal\Object\ObjectScheduleInterface
# setProcessed( boolean $processed )

Set the schedule's processed status.

Set the schedule's processed status.

Parameters

$processed
Whether the schedule has been processed.

Returns

Charcoal\Object\ObjectScheduleInterface
Chainable
public boolean
# processed( )

Determine if the schedule has been processed.

Determine if the schedule has been processed.

Returns

boolean
public QueueItemInterface
# setScheduledDate( null|string|DateTimeInterface $ts )

Set the date/time the item should be processed at.

Set the date/time the item should be processed at.

Parameters

$ts
A date/time string or object.

Returns

QueueItemInterface
Chainable

Throws

InvalidArgumentException
If the date/time is invalid.

Implementation of

Charcoal\Object\ObjectScheduleInterface::setScheduledDate()
public null|DateTimeInterface
# scheduledDate( )

Retrieve the date/time the item should be processed at.

Retrieve the date/time the item should be processed at.

Returns

null|DateTimeInterface

Implementation of

Charcoal\Object\ObjectScheduleInterface::scheduledDate()
public QueueItemInterface
# setProcessedDate( null|string|DateTimeInterface $ts )

Set the date/time the item was processed at.

Set the date/time the item was processed at.

Parameters

$ts
A date/time string or object.

Returns

QueueItemInterface
Chainable

Throws

InvalidArgumentException
If the date/time is invalid.

Implementation of

Charcoal\Object\ObjectScheduleInterface::setProcessedDate()
public null|DateTimeInterface
# processedDate( )

Retrieve the date/time the item was processed at.

Retrieve the date/time the item was processed at.

Returns

null|DateTimeInterface

Implementation of

Charcoal\Object\ObjectScheduleInterface::processedDate()
public QueueItemInterface
# preSave( )

Hook called before saving the item.

Hook called before saving the item.

Presets the item as to-be processed and queued now.

Returns

QueueItemInterface
Chainable
public boolean
# process( callable $callback = null, callable $successCallback = null, callable $failureCallback = null )

Process the item.

Process the item.

Parameters

$callback
An optional callback routine executed after the item is processed.
$successCallback
An optional callback routine executed when the item is resolved.
$failureCallback
An optional callback routine executed when the item is rejected.

Returns

boolean
Success / Failure

Implementation of

Charcoal\Object\ObjectScheduleInterface::process()
API documentation generated by ApiGen