1: <?php
2:
3: namespace Charcoal\Object;
4:
5: /**
6: *
7: */
8: interface ObjectScheduleInterface
9: {
10: /**
11: * @param string $targetType The object type (type-ident).
12: * @return ObjectScheduleInterface Chainable
13: */
14: public function setTargetType($targetType);
15:
16: /**
17: * @return string
18: */
19: public function targetType();
20:
21: /**
22: * @param mixed $targetId The object ID.
23: * @return ObjectScheduleInterface Chainable
24: */
25: public function setTargetId($targetId);
26:
27: /**
28: * @return mixed
29: */
30: public function targetId();
31:
32: /**
33: * Set the date/time the item should be processed at.
34: *
35: * @param null|string|DateTimeInterface $ts A date/time string or object.
36: * @throws InvalidArgumentException If the date/time is invalid.
37: * @return ObjectScheduleInterface Chainable
38: */
39: public function setScheduledDate($ts);
40:
41: /**
42: * Retrieve the date/time the item should be processed at.
43: *
44: * @return null|\DateTimeInterface
45: */
46: public function scheduledDate();
47:
48: /**
49: * @param array|string $data The data diff.
50: * @return ObjectScheduleInterface Chainable
51: */
52: public function setDataDiff($data);
53:
54: /**
55: * @return array
56: */
57: public function dataDiff();
58:
59: /**
60: * Set the date/time the item was processed at.
61: *
62: * @param null|string|DateTimeInterface $ts A date/time string or object.
63: * @throws InvalidArgumentException If the date/time is invalid.
64: * @return ObjectScheduleInterface Chainable
65: */
66: public function setProcessedDate($ts);
67:
68: /**
69: * Retrieve the date/time the item was processed at.
70: *
71: * @return null|\DateTimeInterface
72: */
73: public function processedDate();
74:
75: /**
76: * Process the item.
77: *
78: * @param callable $callback An optional callback routine executed after the item is processed.
79: * @param callable $successCallback An optional callback routine executed when the item is resolved.
80: * @param callable $failureCallback An optional callback routine executed when the item is rejected.
81: * @return boolean Success / Failure
82: */
83: public function process(
84: callable $callback = null,
85: callable $successCallback = null,
86: callable $failureCallback = null
87: );
88: }
89: