@@ 95-103 (lines=9) @@ | ||
92 | * |
|
93 | * @throws DuplicateException if another link is already using that $key |
|
94 | */ |
|
95 | public function addLinkString($key, $href) { |
|
96 | Validator::checkMemberName($key); |
|
97 | ||
98 | if (isset($this->links[$key])) { |
|
99 | throw new DuplicateException('link with key "'.$key.'" already set'); |
|
100 | } |
|
101 | ||
102 | $this->links[$key] = $href; |
|
103 | } |
|
104 | ||
105 | /** |
|
106 | * @param string $key |
|
@@ 111-119 (lines=9) @@ | ||
108 | * |
|
109 | * @throws DuplicateException if another link is already using that $key |
|
110 | */ |
|
111 | public function addLinkObject($key, LinkObject $linkObject) { |
|
112 | Validator::checkMemberName($key); |
|
113 | ||
114 | if (isset($this->links[$key])) { |
|
115 | throw new DuplicateException('link with key "'.$key.'" already set'); |
|
116 | } |
|
117 | ||
118 | $this->links[$key] = $linkObject; |
|
119 | } |
|
120 | ||
121 | /** |
|
122 | * @param string $key |
|
@@ 127-135 (lines=9) @@ | ||
124 | * |
|
125 | * @throws DuplicateException if another link is already using that $key |
|
126 | */ |
|
127 | public function addLinksArray($key, LinksArray $linksArray) { |
|
128 | Validator::checkMemberName($key); |
|
129 | ||
130 | if (isset($this->links[$key])) { |
|
131 | throw new DuplicateException('link with key "'.$key.'" already set'); |
|
132 | } |
|
133 | ||
134 | $this->links[$key] = $linksArray; |
|
135 | } |
|
136 | ||
137 | /** |
|
138 | * @param string $key |
@@ 49-57 (lines=9) @@ | ||
46 | * |
|
47 | * @throws DuplicateException if another relationship is already using that $key |
|
48 | */ |
|
49 | public function addRelationshipObject($key, RelationshipObject $relationshipObject) { |
|
50 | Validator::checkMemberName($key); |
|
51 | ||
52 | if (isset($this->relationships[$key])) { |
|
53 | throw new DuplicateException('relationship with key "'.$key.'" already set'); |
|
54 | } |
|
55 | ||
56 | $this->relationships[$key] = $relationshipObject; |
|
57 | } |
|
58 | ||
59 | /** |
|
60 | * internal api |