Jake Vanderwerf
2026-03-08 c19264ac916707096fe294d996a1b7fb85206b34
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?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;
}