<?php


namespace AutoAdmin\Bundle\Seo\EventListener;


use AutoAdmin\Bundle\Content\Event\PostContentMetadataEvent;
use AutoAdmin\Bundle\Seo\Schema\SchemaManager;

class SchemaBuildEventListener
{
    private SchemaManager $schemaManager;

    public function __construct(SchemaManager $schemaManager)
    {
        $this->schemaManager = $schemaManager;
    }

    public function onContentPostMetadata(PostContentMetadataEvent $event): void
    {
        $contentContext = $event->getContentContext();
        $this->schemaManager->build($contentContext);
    }
}