Knp\Bundle\KnpBundlesBundle\Entity\Bundle::setNbForks PHP Method

setNbForks() public method

Set forks
public setNbForks ( integer $nbForks )
$nbForks integer
    public function setNbForks($nbForks)
    {
        $this->nbForks = $nbForks;
    }

Usage Example

コード例 #1
0
ファイル: Repo.php プロジェクト: ruian/KnpBundles
 /**
  * Return true if the Repo exists on GitHub, false otherwise
  *
  * @param Entity\Bundle $bundle
  * @param array $data
  * @return boolean whether the Repo exists on GitHub
  */
 public function updateInfos(Entity\Bundle $bundle)
 {
     $this->output->write(' infos');
     try {
         $data = $this->github->getRepoApi()->show($bundle->getUsername(), $bundle->getName());
     } catch (\Github_HttpClient_Exception $e) {
         if (404 == $e->getCode()) {
             return false;
         }
         throw $e;
     }
     if ($data['fork']) {
         if ($data['watchers'] >= 10) {
             // Let's try to keep a forked repo with lots of watchers
         } else {
             return false;
         }
     }
     $bundle->setDescription(empty($data['description']) ? null : $data['description']);
     $bundle->setNbFollowers($data['watchers']);
     $bundle->setNbForks($data['forks']);
     $bundle->setCreatedAt(new \DateTime($data['created_at']));
     $bundle->setHomepage(empty($data['homepage']) ? null : $data['homepage']);
     return $bundle;
 }
All Usage Examples Of Knp\Bundle\KnpBundlesBundle\Entity\Bundle::setNbForks