activitypub/src/ContentNation/ActivityPub/Common/Create.php

28 lines
667 B
PHP

<?php
namespace ContentNation\ActivityPub\Common;
require_once("Activity.php");
class Create extends Activity {
public function __construct() {
parent::__construct('Create');
parent::addContext('https://www.w3.org/ns/activitystreams');
}
/**
* convert internal state to php array
* @return array<string,mixed>
*/
public function toObject() {
$return = parent::toObject();
$return['type'] = 'Create';
return $return;
}
/**
* create object from json
* @param array<string,mixed> $json input json
* @return bool true on success
*/
public function fromJson($json) : bool {
return parent::fromJson($json);
}
}