<?php

/**
 * Freeform for Craft CMS.
 *
 * @author        Solspace, Inc.
 * @copyright     Copyright (c) 2008-2026, Solspace, Inc.
 *
 * @see           https://docs.solspace.com/craft/freeform
 *
 * @license       https://docs.solspace.com/license-agreement
 */

namespace Solspace\Freeform\Records;

use craft\db\ActiveQuery;
use craft\db\ActiveRecord;

/**
 * @property int    $id
 * @property string $formId
 * @property string $groupId
 * @property int    $order
 */
class FormGroupsEntriesRecord extends ActiveRecord
{
    public const TABLE = '{{%freeform_forms_groups_entries}}';

    /**
     * Returns the name of the associated database table.
     */
    public static function tableName(): string
    {
        return self::TABLE;
    }

    public function getForm(): ActiveQuery
    {
        return $this->hasOne(FormRecord::class, ['id' => 'formId']);
    }
}
