Example #1
0
 public static function getNameByEveId($id)
 {
     if ($data = parent::doFindOne(__CLASS__, array("value.id" => $id))) {
         return $data['_id'];
     }
     return false;
 }
Example #2
0
 /**
  * get all settings for battles which have started within the time span from $hours to now, 7 days by default
  * @param int $hours
  * @return \King23\Mongo\MongoResult
  */
 public static function getActiveSettings($hours = 168)
 {
     $ts = 3600 * $hours;
     // lets only refresh the last 3 days for now
     $qry = array("startdate" => array('$gt' => new \MongoDate(time() - $ts)));
     return parent::doFind(__CLASS__, $qry);
 }
 /**
  * @param integer $factionid
  */
 public static function getInstanceByFactionId($factionid)
 {
     return parent::doGetInstanceByCriteria(__CLASS__, array("_id" => (int) $factionid));
 }
 /**
  * @param integer $allianceid
  */
 public static function getInstanceByAllianceId($allianceid)
 {
     return parent::doGetInstanceByCriteria(__CLASS__, array("_id" => (int) $allianceid));
 }
Example #5
0
 public static function find($criteria = array())
 {
     return parent::doFind(__CLASS__, $criteria);
 }
Example #6
0
 public function save()
 {
     $this->_data['lastrun'] = new \MongoDate();
     parent::save();
 }
Example #7
0
 public function save()
 {
     if (!$this->_data['killTime'] instanceof \MongoDate) {
         if (is_array($this->_data['killTime'])) {
             $this->_data['killTime'] = new \MongoDate($this->_data['killTime']['sec'], $this->_data['killTime']['usec']);
         }
     }
     $this->_data['saved'] = new \MongoDate();
     parent::save();
 }
Example #8
0
 /**
  * counts the amount of m/r results
  * @static
  * @return int
  */
 public static function count()
 {
     return parent::doFind(__CLASS__, array())->count();
 }
Example #9
0
 public static function findOne($criteria = array())
 {
     return parent::doGetInstanceByCriteria(__CLASS__, $criteria);
 }
Example #10
0
 public static function getBySolarSystemId($solarSystemID)
 {
     return parent::doGetInstanceByCriteria(__CLASS__, array('itemID' => (int) $solarSystemID));
 }
Example #11
0
 public static function getByUserId($userID)
 {
     return parent::doGetInstanceByCriteria(__CLASS__, array('userid' => $userID));
 }
Example #12
0
 /**
  * find stats about the day
  * @static
  * @param MongoDate $date day to get
  * @return MongoResult
  */
 public static function findOne(MongoDate $date)
 {
     return parent::doFindOne(__CLASS__, array("_id" => $date));
 }
Example #13
0
 public static function getInstanceByCriteria($criteria)
 {
     return parent::doGetInstanceByCriteria(__CLASS__, $criteria);
 }
 /**
  * find stats about the day
  * @static
  * @param int $date day to get
  * @param String $entity
  * @return MongoResult
  */
 public static function findOne($date, $entity)
 {
     return parent::doFindOne(__CLASS__, array("_id" => $date . "-" . $entity));
 }
Example #15
0
 /**
  * returns MongoResult of type EveItem, stripped down to
  * type ID contents.
  * @static
  * @return \King23\Mongo\MongoResult
  */
 public static function getMarketIDs()
 {
     // Only needed when we update, all the market IDs here are stuff that are on the market ingame
     // 2 blueprints 4 ships 9 ship equipment 10 turrets & bays 11 ammo 24 implants & boosters 27 implants
     return parent::doFind(__CLASS__, array("marketGroupID" => array('$gt' => 0)), array("typeID" => 1));
 }