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

use Exception;
use WpBookingPro\Factory;
use WpBookingPro\Language\Text;
use WpBookingPro\Mvc\Model\ModelForm;
use WpBookingPro\Filesystem\File as FileAlias;
use WpBookingPro\Mvc\Model\Model;
use WpBookingPro\Form\Form;
use WpBookingPro\Mvc\Model\ModelList;
use WpBookingPro\Registry\Registry;
use WpBookingPro\Utilities\Utility;

class SmscontentModel extends ModelForm
{
    /**
     * @var string
     */
    public $context = "smscontent";
    /**
     * @var string
     */
    public $table_name = "smscontent";

    public function save($data = array())
    {
        $db = Factory::getDBO();
        $query = $db->getQuery(true);
        $query->clear()
            ->select('id')
            ->from($this->getTableName('sms'))
            ->where('published=1')
        ;
        $sms_id = $db->setQuery($query)->loadResult();
        $data['sms_suplier_id'] = $sms_id;
        $item = parent::save($data); // TODO: Change the autogenerated stub

        return $item;
    }

}
