<?php
defined('_WPBOOKINGPRO_EXEC') or die;
if(!class_exists("WpBookingPro_ReviewController")) {
    /**
     * Class WpBookingPro_ReviewController
     */
    class WpBookingPro_ReviewController 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_review()
        {
            return self::view("review.form");
        }

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

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