<?php
|
namespace JVBase\managers\SEO\schemas;
|
|
use JVBase\meta\Meta;
|
|
if (!defined('ABSPATH')) {
|
exit;
|
}
|
|
/**
|
* Interface for type-specific schema resolution.
|
*
|
* Like the Queue's Executor interface, each resolver
|
* knows how to build schema for its content type family.
|
*/
|
interface SchemaResolverInterface
|
{
|
/**
|
* Resolve all fields and return the complete schema array for JSON-LD.
|
*
|
* @param SchemaDefinition $definition Schema definition with config and context
|
* @param Meta|null $meta Optional Meta instance for field lookups
|
* @return array|null Complete schema array, or null if empty
|
*/
|
public function resolve(SchemaDefinition $definition, ?Meta $meta = null): ?array;
|
|
/**
|
* Get auto-enrichment fields beyond what's in config.
|
*
|
* Allows type-specific intelligence like:
|
* - TattooParlor auto-includes artists as `employee`
|
* - VisualArtwork derives `artform` from taxonomy terms
|
* - Person adds `worksFor` from shop association
|
*
|
* @param SchemaDefinition $definition Schema definition with context
|
* @return array Field name => value pairs to merge (won't override config)
|
*/
|
public function getAutoFields(SchemaDefinition $definition): array;
|
}
|