_init('widget', 'widget_id'); } /** * Retrieves pre-configured parameters for widget * * @param int $widgetId * @return array|false */ public function loadPreconfiguredWidget($widgetId) { $connection = $this->getConnection(); $select = $connection->select()->from( $this->getMainTable() )->where( $this->getIdFieldName() . '=:' . $this->getIdFieldName() ); $bind = [$this->getIdFieldName() => $widgetId]; $widget = $connection->fetchRow($select, $bind); if (is_array($widget)) { if ($widget['parameters']) { $widget['parameters'] = $this->getSerializer()->unserialize($widget['parameters']); } return $widget; } return false; } }