public function addEntityLink(Rel $rel, EntityLink $entity) { if (!isset($this->data['entities'])) { $this->data['entities'] = array(); } $entity->setRel($rel); $this->data['entities'][] = $entity; }