Gittern\Repository::getObjectBySha PHP Method

getObjectBySha() public method

public getObjectBySha ( $sha )
    public function getObjectBySha($sha)
    {
        $raw_object = $this->transport->fetchRawObject($sha);
        if (!$raw_object) {
            throw new EntityNotFoundException(sprintf("Couldn't fetch object with identifier %s", $sha));
        }
        $hydrator = $this->getHydratorForType($raw_object->getType());
        if (!$hydrator) {
            throw new \RuntimeException("No hydrator for type {$type} set");
        }
        return $hydrator->hydrate($raw_object);
    }