public function createSelfLink()
{
// if no apiPath is not set generate it from basepath
if (is_null($this->getApiPath())) {
$class = explode('\\', get_class($this));
$plural = Inflector::pluralize(strtolower(end($class)));
$this->apiPath = $this->apiBasePath . '/' . $plural;
}
// add id to path
$idPath = '';
if ($this->getId()) {
$idPath = '/' . $this->getId();
}
$this->_links = ['self' => $this->getApiPath() . $idPath];
}