src/Sulu/Bundle/CoreBundle/Entity/ApiEntity.php
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,
        ];
    }
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,
        ];
    }
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 , ] ; }
creates the _links array including the self path.
creates the _links array including the self path .