X-Git-Url: https://git.mxchange.org/?p=quix0rs-gnu-social.git;a=blobdiff_plain;f=lib%2Factivitystreamslink.php;fp=lib%2Factivitystreamslink.php;h=2c91deda0eabc111264e0f2edb8029dac3d604f7;hp=0000000000000000000000000000000000000000;hb=4160a3fb730113f3d712bd777884c4b0482f6df1;hpb=abd90bbdf562614755802885dfb5673645df8575 diff --git a/lib/activitystreamslink.php b/lib/activitystreamslink.php new file mode 100644 index 0000000000..2c91deda0e --- /dev/null +++ b/lib/activitystreamslink.php @@ -0,0 +1,35 @@ + + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0 + * @link http://status.net/ + */ + +class ActivityStreamsLink +{ + private $linkDict; + + function __construct($url = null, $rel = null, $mediaType = null) + { + // links MUST have a URL + if (empty($url)) { + throw new Exception('Links must have a URL.'); + } + + $this->linkDict = array( + 'url' => $url, + 'rel' => $rel, // extension + 'type' => $mediaType // extension + ); + } + + function asArray() + { + return array_filter($this->linkDict); + } +}