schema_map_repository_factory = $schema_map_repository_factory; $this->schema_map_builder = $schema_map_builder; $this->schema_map_xml_renderer = $schema_map_xml_renderer; $this->indexable_helper = $indexable_helper; } /** * Handles the Aggregate_Site_Schema_Map_Command. * * @param Aggregate_Site_Schema_Map_Command $command The command. * * @return string The schema map xml. */ public function handle( Aggregate_Site_Schema_Map_Command $command ): string { $schema_map_repository = $this->schema_map_repository_factory->get_repository( $this->indexable_helper->should_index_indexables() ); $indexable_counts = $schema_map_repository->get_indexable_count_per_post_type( $command->get_post_types() ); $schema_map = $this->schema_map_builder ->with_repository( $schema_map_repository ) ->build( $indexable_counts ); return $this->schema_map_xml_renderer->render( $schema_map ); } }