dashlets = $dashlets; return $this; } /** * Return this dashboard's dashlets * * @return array */ public function getDashlets() { uasort($this->dashlets, function (array $x, array $y) { return $x['priority'] <=> $y['priority']; }); return $this->dashlets; } /** * Add a new dashlet * * @param string $name * @param string $url * @param int $priority * * @return $this */ public function add($name, $url, $priority = null) { $this->dashlets[$name] = [ 'url' => $url, 'priority' => $priority ]; return $this; } }