public function updateFilterCounts($pageId, $answers) { $has_comment = false; # Does this record have a comment attached? # Defined as an answer of type 'text'. foreach ($answers as $a) { if ($a['aa_response_text'] !== null) { $has_comment = true; } } # Update the overall number of records for this page. ApiArticleFeedbackv5Utils::incrementFilterCount($pageId, 'all'); # If the feedbackrecord had a comment, update that filter count. if ($has_comment) { ApiArticleFeedbackv5Utils::incrementFilterCount($pageId, 'comment'); } }