. */ namespace App\OSM\Widgets; use App\OSM\ComponentManager; /** * Classe dedicata alla gestione di base dei widget del gestionale. * Introduce un rendering di base e definisce i comportamenti standard da estendere per un utilizzo più completo. * * @since 2.5 */ abstract class Manager extends ComponentManager { protected $record_id; public function setRecord(?int $record_id = null) { $this->record_id = $record_id; } /** * Get the view / contents that represent the component. * * @return \Illuminate\Contracts\View\View|string */ public function render() { $widget = $this->model; $title = $this->getTitle(); $content = $this->getContent(); $attributes = $this->getAttributes(); return view('components.widget', [ 'widget' => $widget, 'title' => $title, 'content' => $content, 'attrs' => $attributes, ]); } abstract public function getTitle(): string; abstract public function getContent(): string; public function getAttributes(): string { return 'href="#"'; } }