src/Communibase/Connector.php
public function getById($entityType, $id, array $params = [], $version = null)
    {
        if (empty($id)) {
            throw new Exception('Id is empty');
        }

        if (!static::isIdValid($id)) {
            throw new Exception('Id is invalid, please use a correctly formatted id');
        }

        return ($version === null)
            ? $this->doGet($entityType . '.json/crud/' . $id, $params)
            : $this->doGet($entityType . '.json/history/' . $id . '/' . $version, $params);
    }
public function getById($entityType, $id, array $params = [], $version = null)
    {
        if (empty($id)) {
            throw new Exception('Id is empty');
        }

        if (!static::isIdValid($id)) {
            throw new Exception('Id is invalid, please use a correctly formatted id');
        }

        return ($version === null)
            ? $this->doGet($entityType . '.json/crud/' . $id, $params)
            : $this->doGet($entityType . '.json/history/' . $id . '/' . $version, $params);
    }
public function getById ( $ entityType , $ id , array $ params = [ ] , $ version = null ) { if ( empty ( $ id ) ) { throw new Exception ( 'Id is empty' ) ; } if ( ! static :: isIdValid ( $ id ) ) { throw new Exception ( 'Id is invalid, please use a correctly formatted id' ) ; } return ( $ version === null ) ? $ this -> doGet ( $ entityType . '.json/crud/' . $ id , $ params ) : $ this -> doGet ( $ entityType . '.json/history/' . $ id . '/' . $ version , $ params ) ; }
Get a single Entity by its id

@param string $entityType
@param string $id
@param array $params (optional)
@param string|null $version

@return array entity

@throws Exception
Get a single Entity by its id