public function __get($name) { if ($name == "links") { if (!isset($this->links)) { //Get the list of lists that are being displayed for the widget $this->links = array(); $listWidgetListLinks = new ListWidgetListsLinks(); $listWidgetListLinks->listWidgetListsId = $this->id; $listWidgetListLinks->orderBy('weight ASC'); $listWidgetListLinks->find(); while ($listWidgetListLinks->fetch()) { $this->links[$listWidgetListLinks->id] = clone $listWidgetListLinks; } } return $this->links; } }
private function deleteLink($linkId) { $listWidgetLinks = new ListWidgetListsLinks(); $listWidgetLinks->get($linkId); $listWidgetLinks->delete(); }