id = $id; return $this; } /** * set actor * @param string $actor new actor * @return Create current instance */ public function setActor(string $actor) : Create { $this->actor = $actor; return $this; } /** * set object to create * @param \ContentNation\ActivityPub\Common\APObject $object object to create * @return Create current instance */ public function setObject(\ContentNation\ActivityPub\Common\APObject $object) : Create { $this->object = $object; return $this; } /** * convert internal state to php array * @return array */ public function toObject() { $return = array( '@context' => 'https://www.w3.org/ns/activitystreams', 'id' => $this->id, 'type' => 'Create', 'actor' => $this->actor, ); if ($this->object !== null) { $return['object'] = $this->object->toObject(); } return $return; } }