public function getLinks($pg = null) { $this->calcItems($pg); $this->createLinks($pg); return $this->links; }