/** * Counts the News which exist for the given application key. * * @param string $appKey Optional. Default: Current context. The application identifier, which is used to differentiate different news instances. * * @return int The number of existing news. */ public function getNewsCount($appKey = null) { if ($appKey === null) { $appKey = $this->getContext(); } $crit = new GenericCriterionObject(); $crit->addPropertyIndicator('AppKey', $appKey); return $this->ORM->loadObjectCount('News', $crit); }