123456789101112131415161718192021222324252627282930313233343536 |
- <?php
- class ActivityStreamsLink
- {
- private $linkDict;
- function __construct($url = null, $rel = null, $mediaType = null)
- {
-
- if (empty($url)) {
- throw new Exception('Links must have a URL.');
- }
- $this->linkDict = array(
- 'url' => $url,
- 'rel' => $rel,
- 'type' => $mediaType
- );
- }
- function asArray()
- {
- return array_filter($this->linkDict);
- }
- }
|