<?php

namespace Apps\Calendar\Widget\AdminDashBoard;

use Core\View\View;
use Core\View\ElementView;
use Apps\Calendar\Entity\CalendarEvent;

class AdminDashBoard {
    
    public function __construct($core) {
        $this->Core = $core;
    }
    
    /***
     * Render the widget
     */
    public function Render(){
        $view = new View(__DIR__ . "/View/adminDashboard.tpl", $this->Core);
       
        $event = new CalendarEvent($this->Core);
        
        $view->AddElement(new ElementView("Events", $event->Find(" 1 =1 order by DateStart desc limit 0,5")));
        
        return $view->Render();
    }
}
