array( 'type' => 'bigint', ), 'ad_space_id' => array( 'type' => 'bigint', 'required' => true, ), 'meta_key' => array( 'type' => 'string', 'length' => 255, ), 'meta_value' => array( 'type' => 'text', ), 'created_at' => array( 'type' => 'datetime', 'nullable' => true, ), 'updated_at' => array( 'type' => 'datetime', 'nullable' => true, ), ); } /** * Defines allowed meta keys, their types, defaults, and validation rules. * Only keys listed here will be accepted by handleMeta(). */ public static function metaSchema(): array { $meta_schema = array( 'slider_mode' => array( 'type' => 'enum', 'enum' => array( 'manual', 'auto', 'both' ), 'default' => 'manual', ), 'slider_interval' => array( 'type' => 'int', 'min' => 1, 'max' => 60, 'default' => 5, ), 'slider_show_arrows' => array( 'type' => 'bool', 'default' => true, ), 'slider_show_dots' => array( 'type' => 'bool', 'default' => true, ), ); return apply_filters( 'adfuz/ad_space_meta/meta_schema', $meta_schema ); } public static function table() { return static::TABLE; } }