*/ final class TagMapper extends DataMapperFactory { /** * Columns. * * @var array * @since 1.0.0 */ public const COLUMNS = [ 'tag_id' => ['name' => 'tag_id', 'type' => 'int', 'internal' => 'id'], 'tag_name' => ['name' => 'tag_name', 'type' => 'string', 'internal' => 'name'], 'tag_color' => ['name' => 'tag_color', 'type' => 'string', 'internal' => 'color'], 'tag_icon' => ['name' => 'tag_icon', 'type' => 'string', 'internal' => 'icon'], 'tag_type' => ['name' => 'tag_type', 'type' => 'int', 'internal' => 'type'], 'tag_owner' => ['name' => 'tag_owner', 'type' => 'int', 'internal' => 'owner'], ]; /** * Has many relation. * * @var array * @since 1.0.0 */ public const HAS_MANY = [ 'title' => [ 'mapper' => TagL11nMapper::class, 'table' => 'tag_l11n', 'self' => 'tag_l11n_tag', 'column' => 'content', 'external' => null, ], ]; /** * Belongs to. * * @var array * @since 1.0.0 */ /* public const BELONGS_TO = [ 'owner' => [ 'mapper' => AccountMapper::class, 'external' => 'tag_owner', ], ]; */ /** * Model to use by the mapper. * * @var class-string * @since 1.0.0 */ public const MODEL = Tag::class; /** * Primary table. * * @var string * @since 1.0.0 */ public const TABLE = 'tag'; /** * Primary field name. * * @var string * @since 1.0.0 */ public const PRIMARYFIELD = 'tag_id'; }