Knp\Bundle\KnpBundlesBundle\Github\Organization::setOwnerManager PHP Method

setOwnerManager() public method

public setOwnerManager ( OwnerManager $manager )
$manager Knp\Bundle\KnpBundlesBundle\Manager\OwnerManager
    public function setOwnerManager(OwnerManager $manager)
    {
        $this->manager = $manager;
    }

Usage Example

Example #1
0
 /**
  * @param string $ownerName
  *
  * @return boolean|GithubOwnerInterface
  */
 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;
 }