<?php
defined('_WPBOOKINGPRO_EXEC') or die;
if(!class_exists("WpBookingPro_RatingController")) {
    /**
     * Class WpBookingPro_RatingController
     */
    class WpBookingPro_RatingController extends woobooking_controller
    {
        /**
         * @param array $data
         * @return array|bool|mixed
         */
        public function save($data = array())
        {
            return parent::save($data); // TODO: Change the autogenerated stub
        }

        /**
         * @return mixed
         * @throws Exception
         */
        public function ajax_add_new_rating()
        {
            return self::view("rating.form");
        }

        /**
         * @return mixed
         * @throws Exception
         */
        public function ajax_get_item()
        {
            return self::view("rating.form");
        }

        /**
         * @return bool
         * @throws Exception
         */
        public function ajax_delete()
        {
            $ratingModel = WoobookingModel::getInstance('rating');
            $input = Factory::getInput();
            $list_delete_rating_id = $input->get('list_delete_rating_id', array(), 'array');
            foreach ($list_delete_rating_id as $rating_id) {
                $ratingModel->delete($rating_id);
            }
            return true;
        }
    }
}
?>