<?php
namespace Modules\Orders\Details\OrderNotes; class Model { private $idOrder; public function __construct($idOrder) { $this->idOrder = $idOrder; } public function getOrderNotes() { $orderEnt = \Entity\Order::select($this->idOrder); if (!$orderEnt->recordExists()) { throw new \Exception("Id order is invalid. Check database."); } return $orderEnt->notes; } }