public function setLinkable(a\Linkable $linkable = NULL) { // required if ($this->required && $linkable == NULL) { throw new e\EmptyValueException(S_SPAN . c\M::NULL_LINKABLE . E_SPAN); } if ($this->asset_type != c\T::PFS) { throw new e\NodeException(S_SPAN . "The asset does not accept a linkable." . E_SPAN); } if (isset($linkable)) { $type = $linkable->getType(); if ($type == c\T::FILE) { $this->file_id = $linkable->getId(); $this->file_path = $linkable->getPath(); $this->page_id = NULL; $this->page_path = NULL; $this->symlink_id = NULL; $this->symlink_path = NULL; } else { if ($type == c\T::PAGE) { $this->page_id = $linkable->getId(); $this->page_path = $linkable->getPath(); $this->file_id = NULL; $this->file_path = NULL; $this->symlink_id = NULL; $this->symlink_path = NULL; } else { if ($type == c\T::SYMLINK) { $this->symlink_id = $linkable->getId(); $this->symlink_path = $linkable->getPath(); $this->file_id = NULL; $this->file_path = NULL; $this->page_id = NULL; $this->page_path = NULL; } } } } else { $this->file_id = NULL; $this->file_path = NULL; $this->page_id = NULL; $this->page_path = NULL; $this->symlink_id = NULL; $this->symlink_path = NULL; } return $this; }