<?php

namespace Vendtics\App\Models;

defined( 'ABSPATH' ) || exit;

use Vendtics\WpMVC\App;
use Vendtics\WpMVC\Database\Eloquent\Model;
use Vendtics\WpMVC\Database\Eloquent\Relations\HasMany;
use Vendtics\WpMVC\Database\Resolver;

class Post extends Model {
    public static function get_table_name():string {
        return 'posts';
    }

    public function meta(): HasMany {
        return $this->has_many( PostMeta::class, 'post_id', 'ID' );
    }

    public function resolver():Resolver {
        return App::$container->get( Resolver::class );
    }
}