Knp\Bundle\KnpBundlesBundle\Manager\OwnerManager::getApiByOwnerName PHP Method

getApiByOwnerName() public method

public getApiByOwnerName ( string $ownerName ) : boolean | Knp\Bundle\KnpBundlesBundle\Github\OwnerInterface
$ownerName string
return boolean | Knp\Bundle\KnpBundlesBundle\Github\OwnerInterface
    public function getApiByOwnerName($ownerName)
    {
        try {
            $githubOwner = $this->github->api('user')->show($ownerName);
            // Data fetched, but not in expected format ?
            if (!isset($githubOwner['type'])) {
                return false;
            }
        } catch (RuntimeException $e) {
            // Api limit? User/organization not found? Don't continue
            return false;
        }
        if ($githubOwner['type'] != 'Organization') {
            $api = new GithubDeveloper($this->github, new NullOutput());
        } else {
            $api = new GithubOrganization($this->github, new NullOutput());
            $api->setOwnerManager($this);
        }
        return $api;
    }