src-empire/Empire/Core/Warrant.php line 62

Open in your IDE?
  1. <?php
  2. namespace Empire\Core;
  3. use Empire\Legacy\db;
  4. use App\Service\WarrantImageService;
  5. class Warrant extends AbstractEntity implements Named {
  6.     const PRIMARY_FIELD "BOUN_ID";
  7.     const TABLE "BOUNTY";
  8.     const RESULT_DEAD 1;
  9.     const RESULT_ALIVE 2;
  10.     const RESULT_DEAD_OR_ALIVE 3;
  11.     const RESULTS = [
  12.         self::RESULT_DEAD => "Dead",
  13.         self::RESULT_ALIVE => "Alive",
  14.         self::RESULT_DEAD_OR_ALIVE => "Dead or Alive",
  15.     ];
  16.     const STATUS_ACTIVE 1;
  17.     const STATUS_CAPTURED 2;
  18.     const STATUS_KILLED 3;
  19.     const STATI = [
  20.         self::STATUS_ACTIVE => "Active",
  21.         self::STATUS_CAPTURED => "Captured",
  22.         self::STATUS_KILLED => "Killed",
  23.     ];
  24.     private $BOUN_ID$BOUN_NAME$BOUN_AMOUNT$BOUN_DESC$BOUN_AVATAR$BOUN_CRIMES$BOST_ID$BORE_ID;
  25.     public $name$amount$desc$avatar$crimes$status$result;
  26.     public function initialize() {
  27.         $this->id $this->BOUN_ID;
  28.         $this->name $this->BOUN_NAME;
  29.         $this->amount $this->BOUN_AMOUNT;
  30.         $this->desc html_entity_decode($this->BOUN_DESC);
  31.         $this->avatar WarrantImageService::getWarrantUrl($this->namefalse);
  32.         $this->crimes html_entity_decode($this->BOUN_CRIMES);
  33.         $this->status self::STATI[$this->BOST_ID];
  34.         $this->result self::RESULTS[$this->BORE_ID];
  35.     }
  36.     public function getPrimaryField() {
  37.         return self::PRIMARY_FIELD;
  38.     }
  39.     public function getTable() {
  40.         return self::TABLE;
  41.     }
  42.     public function getName() {
  43.         return $this->name;
  44.     }
  45.     /**
  46.      * @return Warrant[]
  47.      * @throws \Exception
  48.      */
  49.     public static function loadAll() {
  50.         $stmt db::prepare("SELECT * FROM BOUNTY ORDER BY BOUN_NAME ASC");
  51.         return db::fetchArrayOfObjects($stmtWarrant::class);
  52.     }
  53. }