public function entityPhotosCount(OW_Event $e) { $params = $e->getParams(); if (empty($params['entityId']) || empty($params['entityType'])) { return null; } $status = isset($params["status"]) ? $params["status"] : "approved"; $count = $this->photoService->countEntityPhotos($params['entityType'], $params['entityId'], $status); $e->setData($count); return $count; }