<?php
namespace WpBookingHotelFrontend\app\models;
defined('_WPBOOKINGHOTEL_EXEC') or die;

use WpBookingHotel\Factory;
use WpBookingHotel\Mvc\Model\ModelForm;
use WpBookingHotel\Form\Form;
use WpBookingHotel\Mvc\Model\ModelList;
use WpBookingHotel\Registry\Registry;
use WpBookingHotel\Utilities\Utility;
use WpBookingHotelAdmin\app\helpers\AdminHelper;
use WpBookingHotelFrontend\app\helpers\FrontendHelper;

class WishlistModel extends ModelForm
{
    /**
     * @var string
     */
    public $context = "service";
    /**
     * @var string
     */
    public $table_name = "service";
    public function getItem($id = 0)
    {

        $item = (object)parent::getItem($id); // TODO: Change the autogenerated stub
        $query = $this->_db->getQuery(true);
        $query->clear()
            ->select('price_service')
            ->from($this->getTableName('hotelproperty'))
            ->where('object_id='.(int)$id)
            ->where('type='.$query->quote(FrontendHelper::getWpBookingServiceKey()))
            ;
        $item->price_service = $this->_db->loadResult();
        return $item;
    }

}
