private function renderGadget(Gadget $gadget) { $view = $this->getView(); $attribs = []; $attribs['class'] = 'zui-gadget'; $attribs['data-update-url'] = $view->url($this->options['update_url'], ['id' => $gadget->getId()]); $attribs['data-zource-gadget-type'] = $gadget->getGadgetType(); $attribs['data-zource-gadget-id'] = $gadget->getId(); return sprintf('<div %s></div>', $this->renderAttribs($attribs)); }
public function __construct(Gadget $item) { $this->id = $item->getId(); $this->installationDate = $item->getInstallationDate(); $this->updateDate = $item->getUpdateDate(); $this->gadgetContainer = $item->getGadgetContainer()->getId(); $this->gadgetType = $item->getGadgetType(); $this->options = $item->getOptions(); $this->column = $item->getColumn(); $this->position = $item->getPosition(); }