<?php
namespace WpBookingHotelAdmin\app\controllers;
use WpBookingHotel\Factory;
use WpBookingHotel\Mvc\Controller\Controller;
use WpBookingHotel\Mvc\Controller\ControllerForm;
use WpBookingHotel\Utilities\Utility;

defined('_WPBOOKINGHOTEL_EXEC') or die;
class EmailController extends ControllerForm
{
    public $view="emails";
    public function delete($id = 0)
    {
        return parent::delete($id); // TODO: Change the autogenerated stub
    }
    public function save_v1($data = array())
    {
        try {
            $data = parent::save($data); // TODO: Change the autogenerated stub
            if (!empty($data) && isset($data) && is_object($data)) {
                $clientId = is_admin() ? 1 : 0;
                $wordpress = Factory::getWordpress($clientId);
                $this->redirect(Utility::getBackendGoToLink($this->view . ".list"));
                return true;
            }
        }catch (\Exception $e){}
    }

}
