<?php
/**
 * Class represents records from table folders
 * {autogenerated}
 * @property int $folder_id PK
 * @property string $title
 * @property string|null $desc
 * @property string $path
 * @property string $url
 * @property string|null $method
 * @property datetime|null $dattm
 * @property int|null $hide
 * @property string|null $no_access_url
 * @property string|null $options
 * {/autogenerated}
 */

class Folder extends ResourceAbstract
{
    public function getUrl()
    {
        return $this->url;
    }

    public function getLinkTitle()
    {
        return $this->title ?: ___("Link");
    }
}

/**
 * @extends ResourceAbstractTable<Folder>
 * @method Folder|null findFirstByPath($value)
 */
class FolderTable extends ResourceAbstractTable
{
    protected $_key = 'folder_id';
    protected $_table = '?_folder';
    protected $_recordClass = 'Folder';

    public function getAccessType()
    {
        return ResourceAccess::FOLDER;
    }

    public function getAccessTitle()
    {
        return ___('Folders');
    }

    public function getPageId()
    {
        return 'folders';
    }
}