<?php
namespace Modules\Orders\Details\OrderNotes;

class Model
{
	/**
	 *
	 * @var int
	 */
	private $idOrder;

	public function __construct($idOrder)
	{
		$this->idOrder = $idOrder;
	}

	/**
	 *
	 * @throws \Exception
	 * @return String
	 */
	public function getOrderNotes()
	{
		$orderEnt = \Entity\Order::select($this->idOrder);

		if (!$orderEnt->recordExists()) {
			throw new \Exception("Id order is invalid. Check database.");
		}


		return $orderEnt->notes;

	}

}