37 lines
815 B
PHP
37 lines
815 B
PHP
<?php
|
|
namespace ContentNation\ActivityPub\Common;
|
|
require_once("Document.php");
|
|
|
|
class Video extends Document {
|
|
/**
|
|
* is live broadcast
|
|
* @var ?bool
|
|
*/
|
|
private $isLiveBroadcast = null;
|
|
|
|
public function __construct() {
|
|
parent::__construct("Video");
|
|
}
|
|
|
|
/**
|
|
* @param array<string, mixed> $json input
|
|
*/
|
|
public function fromJson($json) : bool {
|
|
if (array_key_exists('isLiveBroadcast', $json)) {
|
|
$this->isLiveBroadcast = $json['isLiveBroadcast'];
|
|
}
|
|
return parent::fromJson($json);
|
|
}
|
|
|
|
/**
|
|
* convert internal state to php array
|
|
* @return array<string,mixed>
|
|
*/
|
|
public function toObject() {
|
|
$return = parent::toObject();
|
|
if ($this->isLiveBroadcast !== null ) {
|
|
$return['isLiveBroadcast'] = $this->isLiveBroadcast;
|
|
}
|
|
return $return;
|
|
}
|
|
} |