コード例 #1
0
ファイル: EveInfo.php プロジェクト: kingboard/kingboard
 public function eveItem(array $data)
 {
     $context = array();
     $context['item'] = \Kingboard\Model\EveItem::getByItemId($data['itemid']);
     // sort attributes by categoryName so we can split 'em up in templates
     $attributes = array();
     foreach ($context['item']['Attributes'] as $attribute) {
         // hack to ignore weird NULL category by ccp
         if ($attribute['categoryName'] == "NULL") {
             continue;
         }
         // initialize if empty category
         if (!isset($attributes[$attribute['categoryName']])) {
             $attributes[$attribute['categoryName']] = array();
         }
         $attributes[$attribute['categoryName']][] = $attribute;
     }
     $context['item']['Attributes'] = $attributes;
     $context['item']['description'] = strip_tags($context['item']['description'], "<br><br/><b><i>");
     return $this->render('eve_item.html', $context);
 }
コード例 #2
0
ファイル: EveAPI.php プロジェクト: kingboard/kingboard
 private function parseItem($row)
 {
     // Build the standard item
     $item = $row;
     $item['typeName'] = EveItem::getByItemId($row['typeID'])->typeName;
     $item['iskValue'] = EveItem::getItemValue($row['typeID']);
     // Check for nested items (container)
     if (isset($row['items']) && is_null($row['items'])) {
         foreach ($row['items'] as $id => $innerRow) {
             $item['items'][$id] = $this->parseItem($innerRow);
         }
     }
     return $item;
 }
コード例 #3
0
 /**
  * update item values from eve central
  * @param array $options
  */
 public function item_values(array $options)
 {
     $log = Registry::getInstance()->getLogger();
     $log->info("item value updating running");
     $result = EveItem::getMarketIDs();
     foreach ($result as $item) {
         $isk = \Kingboard\Lib\EveCentral\Api::getValue($item->typeID);
         if ($isk > 0) {
             $instance = EveItem::getByItemId($item->typeID);
             $instance->iskValue = $isk;
             $instance->save();
             $log->info("Successfully updated " . $item->typeID . " to " . $isk);
         } else {
             $log->info("Did not update " . $item->typeID . ", it had a value of 0");
         }
     }
 }