Example #1
0
 /**
  * Add A Primary Category (will overwrite existing value)
  * 
  * @param \Ner0tic\FoursquareBundle\Entity\Category $category
  * @param boolean $addIfNone
  * 
  * @return \Ner0tic\FoursquareBundle\Entity\Venue
  */
 public function addPrimaryCategory(Category $category, $addIfNone = true)
 {
     foreach ($this->categories as $cat) {
         if ($cat == $category) {
             $cat->setPrimary(true);
             $this->primaryCategory = $cat;
         }
     }
     if ($addIfNone) {
         $category->setPrimary(true);
         $this->addCategory($category);
         $this->primaryCategory = $category;
     }
     return $this;
 }