/** * Creates and stores Dashboards * * If the Dashboard is found in the Volcano, then it is returned. * Otherwise, a new dashboard is created and stored in the Volcano. * * @access private * @since 3.0.0 * @uses \Khill\Lavacharts\Dashboards\Dashboard * @param \Khill\Lavacharts\Values\Label $label Label of the dashboard. * @return \Khill\Lavacharts\Dashboards\Dashboard */ private function dashboardFactory(Label $label) { if ($this->volcano->checkDashboard($label) === false) { $dashboard = new Dashboard($label); $this->volcano->storeDashboard($dashboard); } return $this->volcano->getDashboard($label); }
/** * Creates and stores Dashboards * * If the Dashboard is found in the Volcano, then it is returned. * Otherwise, a new chart is created and stored in the Volcano. * * @access private * @since v2.0.0 * * @uses Dashboard * @param string $type Type of chart to fetch or create. * @param string $label Label of the chart. * * @return Chart */ private function dashboardFactory($type, $label) { $chartObject = __NAMESPACE__ . '\\Controls\\' . $type; if (!$this->volcano->checkDashboard($type, $label)) { $chart = new $chartObject($label); $this->volcano->storeDashboard($chart); } return $this->volcano->getDashboard($type, $label); }