title = $title; $this->description = $description; $this->category = $category; $this->primary_focus_keyword = $primary_focus_keyword; $this->is_cornerstone = $is_cornerstone; $this->last_modified = $last_modified; $this->schema_article_type = $schema_article_type; } /** * Returns this object in array format. * * @return array> The post as an array. */ public function to_array(): array { $data = [ 'title' => $this->title, 'description' => $this->description, 'category' => isset( $this->category ) ? $this->category->to_array() : null, 'primary_focus_keyword' => $this->primary_focus_keyword, 'is_cornerstone' => $this->is_cornerstone, 'last_modified' => $this->last_modified, ]; if ( isset( $this->schema_article_type ) ) { $data['schema_article_type'] = $this->schema_article_type; } return $data; } }