<?php
namespace WpBookingProAdmin\app\models;
defined('_WPBOOKINGPRO_EXEC') or die;

use WpBookingPro\Factory;
use WpBookingPro\Mvc\Model\ModelForm;
use WpBookingPro\Form\Form;
use WpBookingPro\Mvc\Model\ModelList;
use WpBookingPro\Registry\Registry;
class TagModel extends ModelForm
{
    /**
     * @var string
     */
    public $context = "tag";
    /**
     * @var string
     */
    public $table_name = "tag";
    public function getTagByName($name)
    {
        $db = Factory::getDBO();
        $query = $db->getQuery(true);
        $query->select('*')
            ->from($this->getTableName())
            ->where('name=' . $query->quote($name));
        $tag = $db->setQuery($query)->loadObject();
        return $tag;
    }
}
