/** * Returns a list of all badges * * @return DataSet */ public function Get() { if (empty(self::$_Badges)) { self::$_Badges = $this->SQL->Select()->From('Badge')->OrderBy('BadgeID')->Get()->Result(); } return self::$_Badges; }
/** * Define all of the structure related to badges. */ public function StructureBadges() { // Define 'Answer' badges if (!$this->Badges || !class_exists('BadgeModel')) { return; } $BadgeModel = new BadgeModel(); // Answer Counts $BadgeModel->Define(array('Name' => 'First Answer', 'Slug' => 'answer', 'Type' => 'UserCount', 'Body' => 'Answering questions is a great way to show your support for a community!', 'Photo' => 'http://badges.vni.la/100/answer.png', 'Points' => 2, 'Attributes' => array('Column' => 'CountAcceptedAnswers'), 'Threshold' => 1, 'Class' => 'Answerer', 'Level' => 1, 'CanDelete' => 0)); $BadgeModel->Define(array('Name' => '5 Answers', 'Slug' => 'answer-5', 'Type' => 'UserCount', 'Body' => 'Your willingness to share knowledge has definitely been noticed.', 'Photo' => 'http://badges.vni.la/100/answer-2.png', 'Points' => 3, 'Attributes' => array('Column' => 'CountAcceptedAnswers'), 'Threshold' => 5, 'Class' => 'Answerer', 'Level' => 2, 'CanDelete' => 0)); $BadgeModel->Define(array('Name' => '25 Answers', 'Slug' => 'answer-25', 'Type' => 'UserCount', 'Body' => 'Looks like you’re starting to make a name for yourself as someone who knows the score!', 'Photo' => 'http://badges.vni.la/100/answer-3.png', 'Points' => 5, 'Attributes' => array('Column' => 'CountAcceptedAnswers'), 'Threshold' => 25, 'Class' => 'Answerer', 'Level' => 3, 'CanDelete' => 0)); $BadgeModel->Define(array('Name' => '50 Answers', 'Slug' => 'answer-50', 'Type' => 'UserCount', 'Body' => 'Why use Google when we could just ask you?', 'Photo' => 'http://badges.vni.la/100/answer-4.png', 'Points' => 10, 'Attributes' => array('Column' => 'CountAcceptedAnswers'), 'Threshold' => 50, 'Class' => 'Answerer', 'Level' => 4, 'CanDelete' => 0)); $BadgeModel->Define(array('Name' => '100 Answers', 'Slug' => 'answer-100', 'Type' => 'UserCount', 'Body' => 'Admit it, you read Wikipedia in your spare time.', 'Photo' => 'http://badges.vni.la/100/answer-5.png', 'Points' => 15, 'Attributes' => array('Column' => 'CountAcceptedAnswers'), 'Threshold' => 100, 'Class' => 'Answerer', 'Level' => 5, 'CanDelete' => 0)); $BadgeModel->Define(array('Name' => '250 Answers', 'Slug' => 'answer-250', 'Type' => 'UserCount', 'Body' => 'Is there *anything* you don’t know?', 'Photo' => 'http://badges.vni.la/100/answer-6.png', 'Points' => 20, 'Attributes' => array('Column' => 'CountAcceptedAnswers'), 'Threshold' => 250, 'Class' => 'Answerer', 'Level' => 6, 'CanDelete' => 0)); }