Exemple #1
0
 public function getArea()
 {
     if (!is_null($this->area)) {
         return $this->area;
     }
     $this->area = AreaModel::findOrFail((int) $this->property('id'));
     if ($this->area->is_private && !Auth::check()) {
         throw new ApplicationException('Authenticated users only');
     }
     return $this->area;
 }
Exemple #2
0
 public function getArea()
 {
     if (!is_null($this->area)) {
         return $this->area;
     }
     if ($topic = $this->getTopic()) {
         $area = $topic->area;
     } else {
         if ($areaId = input('area')) {
             $area = AreaModel::findOrFail($areaId);
         } else {
             $area = null;
         }
     }
     if ($area) {
         if ($area->is_private && !Auth::check()) {
             throw new ApplicationException('Authenticated users only');
         }
         $area->setUrl($this->areaPage, $this->controller);
     }
     return $this->area = $area;
 }