<?php

namespace CliqThemes\ORM\Entities;

use CliqThemes\ORM\Model;

/**
 * ORM model representing the wp_postmeta table.
 */
class PostMeta extends Model
{
    protected string $table = 'postmeta';

    protected string $primaryKey = 'meta_id';

    protected array $fillable = [
        'post_id',
        'meta_key',
        'meta_value',
    ];

    protected bool $timestamps = false;

    /**
     * Relationship back to the owning post.
     */
    public function post()
    {
        return $this->belongsTo(Post::class, 'post_id', 'ID');
    }
}

