Reviews::_check_sale_id PHP Method

_check_sale_id() public method

public _check_sale_id ( $sale_id )
    public function _check_sale_id($sale_id)
    {
        if ($this->input->post('sale_type') === 'order') {
            $this->load->model('Orders_model');
            if (!$this->Orders_model->validateOrder($sale_id)) {
                $this->form_validation->set_message('_check_sale_id', $this->lang->line('error_not_found_in_order'));
                return FALSE;
            } else {
                return TRUE;
            }
        } else {
            if ($this->input->post('sale_type') === 'reservation') {
                $this->load->model('Reservations_model');
                if (!$this->Reservations_model->validateReservation($sale_id)) {
                    $this->form_validation->set_message('_check_sale_id', $this->lang->line('error_not_found_in_reservation'));
                    return FALSE;
                } else {
                    return TRUE;
                }
            }
        }
    }