Skip to content

Commit

Permalink
Merge pull request #5 from m0x72/revert-3-patch-1
Browse files Browse the repository at this point in the history
Revert "'Rel'-types in Embedded Link Entities"
  • Loading branch information
jefersondaniel committed Mar 17, 2016
2 parents 52f356c + c282f58 commit 809a5a9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
5 changes: 5 additions & 0 deletions src/SirenPHP/Entity.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ public function setProperties(array $properties) {
}

public function appendEntity(array $rel, BaseEntity $entity) {
foreach ($rel as $r) {
if (!is_string($r)) {
throw new \InvalidArgumentExcpetion('rel must be an array of strings')
}
}
$copyEntity = clone $entity;
$copyEntity->rel = $rel;
$this->entities[] = $copyEntity;
Expand Down
14 changes: 1 addition & 13 deletions src/SirenPHP/LinkedEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
class LinkedEntity extends BaseEntity {
private $href = null;

public function __construct($href, array $rel, array $class=array()) {
public function __construct($href, array $class=array()) {
$this->setHref($href);
$this->setRel($rel);
$this->setClass($class);
}

Expand All @@ -18,17 +17,6 @@ public function setHref($href) {
$this->href = $href;
return $this;
}

public function setRel($rel) {
foreach ($rel as $r) {
if (!is_string($r)) {
throw new \InvalidArgumentExcpetion('rel must be an array of strings')
}
}

$this->rel = $rel;
return $this;
}

public function getSerializableVars() {
$vars = get_object_vars($this);
Expand Down

0 comments on commit 809a5a9

Please sign in to comment.