*/ private $content_suggestions = []; /** * Adds a content suggestion to the list. * * @param Content_Suggestion $content_suggestion A content suggestion. * * @return void */ public function add( Content_Suggestion $content_suggestion ): void { $this->content_suggestions[] = $content_suggestion; } /** * Returns this object in array format. * * @return array>> The suggestions as an array. */ public function to_array(): array { $result = []; foreach ( $this->content_suggestions as $suggestion ) { $result[] = $suggestion->to_array(); } return [ 'suggestions' => $result ]; } }