2222/**
2323 * @see https://schema.org/Action
2424 */
25+ use \InvalidArgumentException ;
2526class Action extends Thing
2627{
2728 use Traits \DateTime;
2829
29- final public function setActionStatus (ActionStatusType $ status )
30+ /**
31+ * [setActionStatus description]
32+ * @param ActionStatusType $status [description]
33+ */
34+ final public function setActionStatus (ActionStatusType $ status ): self
3035 {
31- $ this ->_set ('actionStatus ' , $ status );
36+ return $ this ->_set ('actionStatus ' , $ status );
3237 }
3338
34- final public function setAgent (Thing $ agent )
39+ /**
40+ * [setAgent description]
41+ * @param Thing $agent [description]
42+ */
43+ final public function setAgent (Thing $ agent ): self
3544 {
3645 if ($ agent instanceof Person or $ agent instanceof Organization) {
37- $ this ->_set ('agent ' , $ agent );
46+ return $ this ->_set ('agent ' , $ agent );
3847 } else {
39- throw new \ InvalidArgumentException (sprintf (
48+ throw new InvalidArgumentException (sprintf (
4049 'Author must be an instance of Person or Organization. Instance of %s given ' ,
4150 $ agent ::getType ()
4251 ));
4352 }
4453 }
4554
55+ /**
56+ * [setEndDate description]
57+ * @param String $date [description]
58+ * @param boolean $use_date [description]
59+ * @param boolean $use_time [description]
60+ */
4661 final public function setEndDate (
4762 String $ date ,
4863 Bool $ use_date = true ,
4964 Bool $ use_time = true
50- )
65+ ): self
5166 {
52- $ this ->_set ('endDate ' , static ::formatDateTime ($ date , $ use_date , $ use_time ));
67+ return $ this ->_set ('endDate ' , static ::formatDateTime ($ date , $ use_date , $ use_time ));
5368 }
5469
55- final public function setError (Thing $ error )
70+ /**
71+ * [setError description]
72+ * @param Thing $error [description]
73+ */
74+ final public function setError (Thing $ error ): self
5675 {
57- $ this ->_set ('error ' , $ error );
76+ return $ this ->_set ('error ' , $ error );
5877 }
5978
60- final public function setLocation (Thing $ location )
79+ /**
80+ * [setLocation description]
81+ * @param Thing $location [description]
82+ */
83+ final public function setLocation (Thing $ location ): self
6184 {
6285 if ($ location instanceof PostalAddress or $ location instanceof Place) {
63- $ this ->_set ('location ' , $ location );
86+ return $ this ->_set ('location ' , $ location );
6487 } else {
6588 throw new InvalidArgumentException (sprintf (
6689 'Location must be an instance of PostalAddress or Place. Instance of %s given. ' ,
@@ -69,15 +92,23 @@ final public function setLocation(Thing $location)
6992 }
7093 }
7194
72- final public function setObject (Thing $ object )
95+ /**
96+ * [setObject description]
97+ * @param Thing $object [description]
98+ */
99+ final public function setObject (Thing $ object ): self
73100 {
74- $ this ->_set ('object ' , $ object );
101+ return $ this ->_set ('object ' , $ object );
75102 }
76103
104+ /**
105+ * [setParticipant description]
106+ * @param Thing $participant [description]
107+ */
77108 final public function setParticipant (Thing $ participant )
78109 {
79110 if ($ participant instanceof Person or $ participant instanceof Organization) {
80- $ this ->_set ('participant ' , $ participant );
111+ return $ this ->_set ('participant ' , $ participant );
81112 } else {
82113 throw new InvalidArgumentException (sprintf (
83114 'Participant must be an instance of Person or Organization. Instance of %s given. ' ,
@@ -86,22 +117,36 @@ final public function setParticipant(Thing $participant)
86117 }
87118 }
88119
120+ /**
121+ * [setResult description]
122+ * @param Thing $result [description]
123+ */
89124 final public function setResult (Thing $ result )
90125 {
91- $ this ->_set ('result ' , $ result );
126+ return $ this ->_set ('result ' , $ result );
92127 }
93128
129+ /**
130+ * [setStartDate description]
131+ * @param String $date [description]
132+ * @param boolean $use_date [description]
133+ * @param boolean $use_time [description]
134+ */
94135 final public function setStartDate (
95136 String $ date ,
96137 Bool $ use_date = true ,
97138 Bool $ use_time = true
98139 )
99140 {
100- $ this ->_set ('startDate ' , static ::formatDateTime ($ date , $ use_date , $ use_time ));
141+ return $ this ->_set ('startDate ' , static ::formatDateTime ($ date , $ use_date , $ use_time ));
101142 }
102143
144+ /**
145+ * [setTarget description]
146+ * @param EntryPoint $target [description]
147+ */
103148 final public function setTarget (EntryPoint $ target )
104149 {
105- $ this ->_set ('target ' , $ target );
150+ return $ this ->_set ('target ' , $ target );
106151 }
107152}
0 commit comments