/** * Return the number of points and abbreviation as a string. * * <code> * $keys = array( * 'user_id' => 1, * 'points_id' => 2 * ); * * $userPoints = new Gamification\User\Points\Points(JFactory::getDbo()); * $userPoints->load($keys); * * $amount = $userPoints->__toString(); * * // Alternatively * echo $userPoints; * </code> * * @return string */ public function __toString() { if ($this->points !== null) { return $this->points_number . ' ' . $this->points->getAbbr(); } return (string) $this->points_number; }