public function getWidget($replicator_id, $widget_id = null)
    {
        $widget = null;

        if ($widget_id === null) {
            if (isset($this->widgets[$replicator_id])) {
                $widget = current($this->widgets[$replicator_id]);
            }
        } else {
            if (isset($this->widgets[$replicator_id][$widget_id])) {
                $widget = $this->widgets[$replicator_id][$widget_id];
            }
        }

        return $widget;
    }