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

setIsFork() public method

Set isFork
public setIsFork ( boolean $isFork )
$isFork boolean
    public function setIsFork($isFork)
    {
        $this->isFork = $isFork;
    }

Usage Example

Example #1
0
 /**
  * Return true if the Repo exists on GitHub, false otherwise
  *
  * @param Bundle $bundle
  *
  * @return boolean whether the Repo exists on GitHub
  */
 public function updateInfos(Bundle $bundle)
 {
     $this->output->write(' infos');
     try {
         $data = $this->github->api('repo')->show($bundle->getOwnerName(), $bundle->getName());
     } catch (RuntimeException $e) {
         return false;
     }
     // Let's try to only keep a forked repo with lots of watchers
     if ($data['fork'] && $data['watchers'] < 10) {
         return false;
     }
     $bundle->setDescription(empty($data['description']) ? null : $data['description']);
     $bundle->setNbFollowers($data['watchers']);
     $bundle->setNbForks($data['forks']);
     $bundle->setIsFork($data['fork']);
     $bundle->setCreatedAt(new \DateTime($data['created_at']));
     $bundle->setHomepage(empty($data['homepage']) ? null : $data['homepage']);
     return true;
 }