Beispiel #1
0
 /**
  * @param EveApiReadWriteInterface $data
  * @param EveApiRetrieverInterface $retrievers
  * @param EveApiPreserverInterface $preservers
  * @param int                      $interval
  *
  * @throws LogicException
  */
 public function autoMagic(EveApiReadWriteInterface $data, EveApiRetrieverInterface $retrievers, EveApiPreserverInterface $preservers, $interval)
 {
     $this->getLogger()->debug(sprintf('Starting autoMagic for %1$s/%2$s', $this->getSectionName(), $this->getApiName()));
     if ('Char' === $this->getSectionName()) {
         $active = $this->getActiveCharacters();
         $ownerID = 'characterID';
     } else {
         $active = $this->getActiveCorporations();
         $ownerID = 'corporationID';
     }
     if (0 === count($active)) {
         $mess = sprintf('No active registered keys found for %1$s/%2$s', $this->getSectionName(), $this->getApiName());
         $this->getLogger()->info($mess);
         return;
     }
     foreach ($active as $activeKey) {
         if ($this->cacheNotExpired($this->getApiName(), $this->getSectionName(), $activeKey[$ownerID])) {
             continue;
         }
         foreach ($this->getKeyList() as $accountKey) {
             $data->setEveApiSectionName(strtolower($this->getSectionName()))->setEveApiName($this->getApiName());
             $activeKey['accountKey'] = $accountKey;
             $activeKey['rowCount'] = '2560';
             $data->setEveApiArguments($activeKey)->setEveApiXml();
             if (!$this->oneShot($data, $retrievers, $preservers, $interval)) {
                 // Special handling for optional faction warfare account.
                 if ('10000' === $accountKey) {
                     continue 1;
                 }
                 continue 2;
             }
         }
         $this->updateCachedUntil($data->getEveApiXml(), $interval, $activeKey[$ownerID]);
     }
 }
 /**
  * @param EveApiReadWriteInterface $data
  *
  * @return self
  * @throws \LogicException
  */
 public function retrieveEveApi(EveApiReadWriteInterface $data)
 {
     $mess = sprintf('Started network retrieve for %1$s/%2$s', $data->getEveApiSectionName(), $data->getEveApiName());
     $this->getLogger()->debug($mess);
     $result = $this->readXmlData($this->prepareConnection($data));
     $data->setEveApiXml($this->addYapealProcessingInstructionToXml($result, $data->getEveApiArguments()));
     $this->__destruct();
     return $this;
 }
Beispiel #3
0
 /**
  * @param EveApiReadWriteInterface $data
  * @param EveApiRetrieverInterface $retrievers
  * @param EveApiPreserverInterface $preservers
  * @param int                      $interval
  *
  * @return bool
  * @throws \LogicException
  */
 public function oneShot(EveApiReadWriteInterface $data, EveApiRetrieverInterface $retrievers, EveApiPreserverInterface $preservers, &$interval)
 {
     $ids = $data->getEveApiArgument('ids');
     if (null === $ids || '' === $ids) {
         $mess = sprintf('Data is missing required "ids" parameter for %1$s/%2$s', strtolower($this->getSectionName()), $this->getApiName());
         $this->getLogger()->warning($mess);
         return false;
     }
     return parent::oneShot($data, $retrievers, $preservers, $interval);
 }
Beispiel #4
0
 /**
  * @param EveApiReadWriteInterface $data
  *
  * @return self Fluent interface.
  * @throws \LogicException
  */
 protected function preserveToCertificateTree(EveApiReadWriteInterface $data)
 {
     $tableName = 'eveCertificateTree';
     $sql = $this->getCsq()->getDeleteFromTable($tableName);
     $this->getYem()->triggerLogEvent('Yapeal.Log.log', Logger::DEBUG, $sql);
     $this->getPdo()->exec($sql);
     $columnDefaults = ['categoryID' => null, 'categoryName' => ''];
     $xPath = '//categories/row';
     $elements = (new \SimpleXMLElement($data->getEveApiXml()))->xpath($xPath);
     $this->attributePreserveData($elements, $columnDefaults, $tableName);
     return $this;
 }
Beispiel #5
0
 /**
  * @param EveApiReadWriteInterface $data
  *
  * @return self Fluent interface.
  * @throws \LogicException
  */
 protected function preserveToErrorList(EveApiReadWriteInterface $data)
 {
     $tableName = 'eveErrorList';
     $sql = $this->getCsq()->getDeleteFromTable($tableName);
     $this->getYem()->triggerLogEvent('Yapeal.Log.log', Logger::DEBUG, $sql);
     $this->getPdo()->exec($sql);
     $columnDefaults = ['errorCode' => null, 'errorText' => null];
     $xPath = '//errors/row';
     $elements = (new \SimpleXMLElement($data->getEveApiXml()))->xpath($xPath);
     $this->attributePreserveData($elements, $columnDefaults, $tableName);
     return $this;
 }
Beispiel #6
0
 /**
  * @param EveApiReadWriteInterface $data
  *
  * @return void
  * @throws \LogicException
  */
 protected function preserveToMailMessages(EveApiReadWriteInterface $data)
 {
     $tableName = 'charMailMessages';
     $ownerID = $this->extractOwnerID($data->getEveApiArguments());
     $sql = $this->getCsq()->getDeleteFromTableWithOwnerID($tableName, $ownerID);
     $this->getYem()->triggerLogEvent('Yapeal.Log.log', Logger::DEBUG, $sql);
     $this->getPdo()->exec($sql);
     $columnDefaults = ['messageID' => null, 'ownerID' => $ownerID, 'senderID' => null, 'senderName' => null, 'senderTypeID' => null, 'sentDate' => null, 'title' => null, 'toCharacterIDs' => null, 'toCorpOrAllianceID' => '0', 'toListID' => null];
     $xPath = '//messages/row';
     $elements = (new \SimpleXMLElement($data->getEveApiXml()))->xpath($xPath);
     $this->attributePreserveData($elements, $columnDefaults, $tableName);
 }
Beispiel #7
0
 /**
  * @param EveApiReadWriteInterface $data
  *
  * @return self Fluent interface.
  * @throws \LogicException
  */
 protected function preserveToFacWarSystems(EveApiReadWriteInterface $data)
 {
     $tableName = 'mapFacWarSystems';
     $sql = $this->getCsq()->getDeleteFromTable($tableName);
     $this->getYem()->triggerLogEvent('Yapeal.Log.log', Logger::DEBUG, $sql);
     $this->getPdo()->exec($sql);
     $columnDefaults = ['contested' => null, 'occupyingFactionID' => null, 'occupyingFactionName' => '', 'owningFactionID' => null, 'owningFactionName' => '', 'solarSystemID' => null, 'solarSystemName' => '', 'victoryPoints' => null, 'victoryPointThreshold' => null];
     $xPath = '//solarSystems/row';
     $elements = (new \SimpleXMLElement($data->getEveApiXml()))->xpath($xPath);
     $this->attributePreserveData($elements, $columnDefaults, $tableName);
     return $this;
 }
Beispiel #8
0
 /**
  * @param EveApiReadWriteInterface $data
  *
  * @return self Fluent interface.
  * @throws \LogicException
  */
 protected function preserveToServerStatus(EveApiReadWriteInterface $data)
 {
     $tableName = 'serverServerStatus';
     $sql = $this->getCsq()->getDeleteFromTable($tableName);
     $this->getYem()->triggerLogEvent('Yapeal.Log.log', Logger::DEBUG, $sql);
     $this->getPdo()->exec($sql);
     $columnDefaults = ['onlinePlayers' => null, 'serverOpen' => null];
     $xPath = '//result/child::*[not(*|@*|self::dataTime)]';
     $elements = (new \SimpleXMLElement($data->getEveApiXml()))->xpath($xPath);
     $this->valuesPreserveData($elements, $columnDefaults, $tableName);
     return $this;
 }
 /**
  * @param EveApiReadWriteInterface $data
  *
  * @return self Fluent interface.
  * @throws \LogicException
  */
 protected function preserveToConquerableStationList(EveApiReadWriteInterface $data)
 {
     $tableName = 'eveConquerableStationList';
     $sql = $this->getCsq()->getDeleteFromTable($tableName);
     $this->getYem()->triggerLogEvent('Yapeal.Log.log', Logger::DEBUG, $sql);
     $this->getPdo()->exec($sql);
     $columnDefaults = ['corporationID' => null, 'corporationName' => '', 'solarSystemID' => null, 'stationID' => null, 'stationName' => '', 'stationTypeID' => null, 'x' => null, 'y' => null, 'z' => null];
     $xPath = '//outposts/row';
     $elements = (new \SimpleXMLElement($data->getEveApiXml()))->xpath($xPath);
     $this->attributePreserveData($elements, $columnDefaults, $tableName);
     return $this;
 }
Beispiel #10
0
 /**
  * @param EveApiReadWriteInterface $data
  *
  * @return self Fluent interface.
  * @throws \LogicException
  */
 protected function preserveToJumps(EveApiReadWriteInterface $data)
 {
     $tableName = 'mapJumps';
     $sql = $this->getCsq()->getDeleteFromTable($tableName);
     $this->getYem()->triggerLogEvent('Yapeal.Log.log', Logger::DEBUG, $sql);
     $this->getPdo()->exec($sql);
     $columnDefaults = ['shipJumps' => null, 'solarSystemID' => null];
     $xPath = '//solarSystems/row';
     $elements = (new \SimpleXMLElement($data->getEveApiXml()))->xpath($xPath);
     $this->attributePreserveData($elements, $columnDefaults, $tableName);
     return $this;
 }
Beispiel #11
0
 /**
  * @param EveApiReadWriteInterface $data
  *
  * @return self Fluent interface.
  * @throws \LogicException
  */
 protected function preserveToResearch(EveApiReadWriteInterface $data)
 {
     $tableName = 'charResearch';
     $ownerID = $this->extractOwnerID($data->getEveApiArguments());
     $sql = $this->getCsq()->getDeleteFromTableWithOwnerID($tableName, $ownerID);
     $this->getYem()->triggerLogEvent('Yapeal.Log.log', Logger::DEBUG, $sql);
     $this->getPdo()->exec($sql);
     $columnDefaults = ['agentID' => null, 'ownerID' => $ownerID, 'pointsPerDay' => null, 'remainderPoints' => null, 'researchStartDate' => '1970-01-01 00:00:01', 'skillTypeID' => null];
     $xPath = '//research/row';
     $elements = (new \SimpleXMLElement($data->getEveApiXml()))->xpath($xPath);
     $this->attributePreserveData($elements, $columnDefaults, $tableName);
     return $this;
 }
Beispiel #12
0
 /**
  * @param EveApiReadWriteInterface $data
  *
  * @return self Fluent interface.
  * @throws \LogicException
  */
 protected function preserveToFacilities(EveApiReadWriteInterface $data)
 {
     $tableName = 'corpFacilities';
     $ownerID = $this->extractOwnerID($data->getEveApiArguments());
     $sql = $this->getCsq()->getDeleteFromTableWithOwnerID($tableName, $ownerID);
     $this->getYem()->triggerLogEvent('Yapeal.Log.log', Logger::DEBUG, $sql);
     $this->getPdo()->exec($sql);
     $columnDefaults = ['facilityID' => null, 'ownerID' => $ownerID, 'regionID' => null, 'regionName' => '', 'solarSystemID' => null, 'solarSystemName' => '', 'starbaseModifier' => null, 'tax' => '0.0', 'typeID' => null, 'typeName' => ''];
     $xPath = '//facilities/row';
     $elements = (new \SimpleXMLElement($data->getEveApiXml()))->xpath($xPath);
     $this->attributePreserveData($elements, $columnDefaults, $tableName);
     return $this;
 }
Beispiel #13
0
 /**
  * @param EveApiReadWriteInterface $data
  *
  * @return self Fluent interface.
  * @throws \LogicException
  */
 protected function preserveToMedals(EveApiReadWriteInterface $data)
 {
     $tableName = 'corpMedals';
     $ownerID = $this->extractOwnerID($data->getEveApiArguments());
     $sql = $this->getCsq()->getDeleteFromTableWithOwnerID($tableName, $ownerID);
     $this->getYem()->triggerLogEvent('Yapeal.Log.log', Logger::DEBUG, $sql);
     $this->getPdo()->exec($sql);
     $columnDefaults = ['created' => null, 'creatorID' => null, 'description' => '', 'medalID' => null, 'ownerID' => $ownerID, 'title' => null];
     $xPath = '//medals/row';
     $elements = (new \SimpleXMLElement($data->getEveApiXml()))->xpath($xPath);
     $this->attributePreserveData($elements, $columnDefaults, $tableName);
     return $this;
 }
Beispiel #14
0
 /**
  * @param EveApiReadWriteInterface $data
  *
  * @return self Fluent interface.
  * @throws \LogicException
  */
 protected function preserveToContainerLog(EveApiReadWriteInterface $data)
 {
     $tableName = 'corpContainerLog';
     $ownerID = $this->extractOwnerID($data->getEveApiArguments());
     $sql = $this->getCsq()->getDeleteFromTableWithOwnerID($tableName, $ownerID);
     $this->getYem()->triggerLogEvent('Yapeal.Log.log', Logger::DEBUG, $sql);
     $this->getPdo()->exec($sql);
     $columnDefaults = ['action' => null, 'actorID' => null, 'actorName' => '', 'flag' => null, 'itemID' => null, 'itemTypeID' => null, 'locationID' => null, 'logTime' => '1970-01-01 00:00:01', 'newConfiguration' => null, 'oldConfiguration' => null, 'ownerID' => $ownerID, 'passwordType' => null, 'quantity' => null, 'typeID' => null];
     $xPath = '//containerLog/row';
     $elements = (new \SimpleXMLElement($data->getEveApiXml()))->xpath($xPath);
     $this->attributePreserveData($elements, $columnDefaults, $tableName);
     return $this;
 }
Beispiel #15
0
 /**
  * @param EveApiReadWriteInterface $data
  *
  * @return self Fluent interface.
  * @throws \LogicException
  */
 protected function preserveToMarketOrders(EveApiReadWriteInterface $data)
 {
     $tableName = 'corpMarketOrders';
     $ownerID = $this->extractOwnerID($data->getEveApiArguments());
     $sql = $this->getCsq()->getDeleteFromTableWithOwnerID($tableName, $ownerID);
     $this->getYem()->triggerLogEvent('Yapeal.Log.log', Logger::DEBUG, $sql);
     $this->getPdo()->exec($sql);
     $columnDefaults = ['accountKey' => null, 'bid' => null, 'charID' => null, 'duration' => null, 'escrow' => null, 'issued' => null, 'minVolume' => null, 'orderID' => null, 'orderState' => null, 'ownerID' => $ownerID, 'price' => null, 'range' => null, 'stationID' => null, 'typeID' => null, 'volEntered' => null, 'volRemaining' => null];
     $xPath = '//orders/row';
     $elements = (new \SimpleXMLElement($data->getEveApiXml()))->xpath($xPath);
     $this->attributePreserveData($elements, $columnDefaults, $tableName);
     return $this;
 }
Beispiel #16
0
 /**
  * @param EveApiReadWriteInterface $data
  *
  * @return self Fluent interface.
  * @throws \LogicException
  */
 protected function preserveToBlueprints(EveApiReadWriteInterface $data)
 {
     $tableName = 'corpBlueprints';
     $ownerID = $this->extractOwnerID($data->getEveApiArguments());
     $sql = $this->getCsq()->getDeleteFromTableWithOwnerID($tableName, $ownerID);
     $this->getYem()->triggerLogEvent('Yapeal.Log.log', Logger::DEBUG, $sql);
     $this->getPdo()->exec($sql);
     $columnDefaults = ['flagID' => null, 'itemID' => null, 'locationID' => null, 'materialEfficiency' => null, 'ownerID' => $ownerID, 'quantity' => null, 'runs' => null, 'timeEfficiency' => null, 'typeID' => null, 'typeName' => ''];
     $xPath = '//blueprints/row';
     $elements = (new \SimpleXMLElement($data->getEveApiXml()))->xpath($xPath);
     $this->attributePreserveData($elements, $columnDefaults, $tableName);
     return $this;
 }
Beispiel #17
0
 /**
  * @param EveApiReadWriteInterface $data
  *
  * @return self Fluent interface.
  * @throws \LogicException
  */
 protected function preserveToShareholders(EveApiReadWriteInterface $data)
 {
     $tableName = 'corpShareholders';
     $ownerID = $this->extractOwnerID($data->getEveApiArguments());
     $sql = $this->getCsq()->getDeleteFromTableWithOwnerID($tableName, $ownerID);
     $this->getYem()->triggerLogEvent('Yapeal.Log.log', Logger::DEBUG, $sql);
     $this->getPdo()->exec($sql);
     $columnDefaults = ['ownerID' => $ownerID, 'shareholderCorporationID' => null, 'shareholderCorporationName' => '', 'shareholderID' => null, 'shareholderName' => '', 'shares' => null];
     $xPath = '//characters/row';
     $elements = (new \SimpleXMLElement($data->getEveApiXml()))->xpath($xPath);
     $this->attributePreserveData($elements, $columnDefaults, $tableName);
     return $this;
 }
Beispiel #18
0
 /**
  * @param EveApiReadWriteInterface $data
  *
  * @return self Fluent interface.
  * @throws \LogicException
  */
 protected function preserveToSkillQueue(EveApiReadWriteInterface $data)
 {
     $tableName = 'charSkillQueue';
     $ownerID = $this->extractOwnerID($data->getEveApiArguments());
     $sql = $this->getCsq()->getDeleteFromTableWithOwnerID($tableName, $ownerID);
     $this->getYem()->triggerLogEvent('Yapeal.Log.log', Logger::DEBUG, $sql);
     $this->getPdo()->exec($sql);
     $columnDefaults = ['endSP' => null, 'endTime' => '1970-01-01 00:00:01', 'level' => null, 'ownerID' => $ownerID, 'queuePosition' => null, 'startSP' => null, 'startTime' => '1970-01-01 00:00:01', 'typeID' => null];
     $xPath = '//skillqueue/row';
     $elements = (new \SimpleXMLElement($data->getEveApiXml()))->xpath($xPath);
     $this->attributePreserveData($elements, $columnDefaults, $tableName);
     return $this;
 }
Beispiel #19
0
 /**
  * @param EveApiReadWriteInterface $data
  *
  * @return self Fluent interface.
  * @throws \LogicException
  */
 protected function preserveToNotifications(EveApiReadWriteInterface $data)
 {
     $tableName = 'charNotifications';
     $ownerID = $this->extractOwnerID($data->getEveApiArguments());
     $sql = $this->getCsq()->getDeleteFromTableWithOwnerID($tableName, $ownerID);
     $this->getYem()->triggerLogEvent('Yapeal.Log.log', Logger::DEBUG, $sql);
     $this->getPdo()->exec($sql);
     $columnDefaults = ['notificationID' => null, 'ownerID' => $ownerID, 'read' => null, 'senderID' => null, 'senderName' => '', 'sentDate' => '1970-01-01 00:00:01', 'typeID' => null];
     $xPath = '//notifications/row';
     $elements = (new \SimpleXMLElement($data->getEveApiXml()))->xpath($xPath);
     $this->attributePreserveData($elements, $columnDefaults, $tableName);
     return $this;
 }
Beispiel #20
0
 /**
  * @param EveApiReadWriteInterface $data
  *
  * @return self Fluent interface.
  * @throws \LogicException
  */
 protected function preserveToAccountBalance(EveApiReadWriteInterface $data)
 {
     $tableName = 'corpAccountBalance';
     $ownerID = $this->extractOwnerID($data->getEveApiArguments());
     $sql = $this->getCsq()->getDeleteFromTableWithOwnerID($tableName, $ownerID);
     $this->getYem()->triggerLogEvent('Yapeal.Log.log', Logger::DEBUG, $sql);
     $this->getPdo()->exec($sql);
     $columnDefaults = ['accountID' => null, 'accountKey' => null, 'balance' => '0.0', 'ownerID' => $ownerID];
     $xPath = '//accounts/row';
     $elements = (new \SimpleXMLElement($data->getEveApiXml()))->xpath($xPath);
     $this->attributePreserveData($elements, $columnDefaults, $tableName);
     return $this;
 }
Beispiel #21
0
 /**
  * @param EveApiReadWriteInterface $data
  *
  * @return self Fluent interface.
  * @throws \LogicException
  */
 protected function preserveToContracts(EveApiReadWriteInterface $data)
 {
     $tableName = 'corpContracts';
     $ownerID = $this->extractOwnerID($data->getEveApiArguments());
     $sql = $this->getCsq()->getDeleteFromTableWithOwnerID($tableName, $ownerID);
     $this->getYem()->triggerLogEvent('Yapeal.Log.log', Logger::DEBUG, $sql);
     $this->getPdo()->exec($sql);
     $columnDefaults = ['acceptorID' => null, 'assigneeID' => null, 'availability' => null, 'buyout' => null, 'collateral' => null, 'contractID' => null, 'dateAccepted' => '1970-01-01 00:00:01', 'dateCompleted' => '1970-01-01 00:00:01', 'dateExpired' => '1970-01-01 00:00:01', 'dateIssued' => '1970-01-01 00:00:01', 'endStationID' => null, 'forCorp' => null, 'issuerCorpID' => null, 'issuerID' => null, 'numDays' => null, 'ownerID' => $ownerID, 'price' => null, 'reward' => null, 'startStationID' => null, 'status' => null, 'title' => null, 'type' => null, 'volume' => null];
     $xPath = '//contractList/row';
     $elements = (new \SimpleXMLElement($data->getEveApiXml()))->xpath($xPath);
     $this->attributePreserveData($elements, $columnDefaults, $tableName);
     return $this;
 }
Beispiel #22
0
 /**
  * @param EveApiReadWriteInterface $data
  *
  * @return self Fluent interface.
  * @throws \LogicException
  */
 protected function preserveToMemberSecurityLog(EveApiReadWriteInterface $data)
 {
     $tableName = 'corpMemberSecurityLog';
     $ownerID = $this->extractOwnerID($data->getEveApiArguments());
     $sql = $this->getCsq()->getDeleteFromTableWithOwnerID($tableName, $ownerID);
     $this->getYem()->triggerLogEvent('Yapeal.Log.log', Logger::DEBUG, $sql);
     $this->getPdo()->exec($sql);
     $columnDefaults = ['changeTime' => '1970-01-01 00:00:01', 'characterID' => null, 'issuerID' => null, 'ownerID' => $ownerID, 'roleLocationType' => null];
     $xPath = '//roleHistory/row';
     $elements = (new \SimpleXMLElement($data->getEveApiXml()))->xpath($xPath);
     $this->attributePreserveData($elements, $columnDefaults, $tableName);
     return $this;
 }
Beispiel #23
0
 /**
  * @param EveApiReadWriteInterface $data
  *
  * @return self Fluent interface.
  * @throws \LogicException
  */
 protected function preserveToCustomsOffices(EveApiReadWriteInterface $data)
 {
     $tableName = 'corpCustomsOffices';
     $ownerID = $this->extractOwnerID($data->getEveApiArguments());
     $sql = $this->getCsq()->getDeleteFromTableWithOwnerID($tableName, $ownerID);
     $this->getYem()->triggerLogEvent('Yapeal.Log.log', Logger::DEBUG, $sql);
     $this->getPdo()->exec($sql);
     $columnDefaults = ['allowAlliance' => null, 'allowStandings' => null, 'itemID' => null, 'ownerID' => $ownerID, 'reinforceHour' => null, 'solarSystemID' => null, 'solarSystemName' => '', 'standingLevel' => null, 'taxRateAlliance' => '0.0', 'taxRateCorp' => '0.0', 'taxRateStandingBad' => '0.0', 'taxRateStandingGood' => '0.0', 'taxRateStandingHigh' => '0.0', 'taxRateStandingHorrible' => '0.0', 'taxRateStandingNeutral' => '0.0'];
     $xPath = '//pocos/row';
     $elements = (new \SimpleXMLElement($data->getEveApiXml()))->xpath($xPath);
     $this->attributePreserveData($elements, $columnDefaults, $tableName);
     return $this;
 }
 /**
  * @param EveApiReadWriteInterface $data
  *
  * @return self Fluent interface.
  * @throws \LogicException
  */
 protected function preserveToOutpostServiceDetail(EveApiReadWriteInterface $data)
 {
     $tableName = 'corpOutpostServiceDetail';
     $ownerID = $this->extractOwnerID($data->getEveApiArguments());
     $sql = $this->getCsq()->getDeleteFromTableWithOwnerID($tableName, $ownerID);
     $this->getYem()->triggerLogEvent('Yapeal.Log.log', Logger::DEBUG, $sql);
     $this->getPdo()->exec($sql);
     $columnDefaults = ['discountPerGoodStanding' => null, 'minStanding' => null, 'ownerID' => $ownerID, 'serviceName' => '', 'stationID' => null, 'surchargePerBadStanding' => null];
     $xPath = '//outpostServiceDetails/row';
     $elements = (new \SimpleXMLElement($data->getEveApiXml()))->xpath($xPath);
     $this->attributePreserveData($elements, $columnDefaults, $tableName);
     return $this;
 }
Beispiel #25
0
 /**
  * @param EveApiReadWriteInterface $data
  *
  * @return self Fluent interface.
  * @throws \LogicException
  */
 protected function preserveToWalletJournal(EveApiReadWriteInterface $data)
 {
     $tableName = 'corpWalletJournal';
     $ownerID = $this->extractOwnerID($data->getEveApiArguments());
     $sql = $this->getCsq()->getDeleteFromTableWithOwnerID($tableName, $ownerID);
     $this->getYem()->triggerLogEvent('Yapeal.Log.log', Logger::DEBUG, $sql);
     $this->getPdo()->exec($sql);
     $columnDefaults = ['amount' => null, 'argID1' => null, 'argName1' => '', 'balance' => '0.0', 'date' => '1970-01-01 00:00:01', 'owner1TypeID' => null, 'owner2TypeID' => null, 'ownerID' => $ownerID, 'ownerID1' => null, 'ownerID2' => null, 'ownerName1' => '', 'ownerName2' => '', 'reason' => null, 'refID' => null, 'refTypeID' => null];
     $xPath = '//entries/row';
     $elements = (new \SimpleXMLElement($data->getEveApiXml()))->xpath($xPath);
     $this->attributePreserveData($elements, $columnDefaults, $tableName);
     return $this;
 }
Beispiel #26
0
 /**
  * @param EveApiReadWriteInterface $data
  *
  * @return self Fluent interface.
  * @throws \LogicException
  */
 protected function preserveToStarbaseList(EveApiReadWriteInterface $data)
 {
     $tableName = 'corpStarbaseList';
     $ownerID = $this->extractOwnerID($data->getEveApiArguments());
     $sql = $this->getCsq()->getDeleteFromTableWithOwnerID($tableName, $ownerID);
     $this->getYem()->triggerLogEvent('Yapeal.Log.log', Logger::DEBUG, $sql);
     $this->getPdo()->exec($sql);
     $columnDefaults = ['itemID' => null, 'locationID' => null, 'moonID' => null, 'onlineTimestamp' => '1970-01-01 00:00:01', 'ownerID' => $ownerID, 'standingOwnerID' => null, 'state' => null, 'stateTimestamp' => '1970-01-01 00:00:01', 'typeID' => null];
     $xPath = '//starbases/row';
     $elements = (new \SimpleXMLElement($data->getEveApiXml()))->xpath($xPath);
     $this->attributePreserveData($elements, $columnDefaults, $tableName);
     return $this;
 }
Beispiel #27
0
 /**
  * @param EveApiReadWriteInterface $data
  *
  * @return self Fluent interface.
  * @throws \LogicException
  */
 protected function preserveToWalletTransactions(EveApiReadWriteInterface $data)
 {
     $tableName = 'charWalletTransactions';
     $ownerID = $this->extractOwnerID($data->getEveApiArguments());
     $sql = $this->getCsq()->getDeleteFromTableWithOwnerID($tableName, $ownerID);
     $this->getYem()->triggerLogEvent('Yapeal.Log.log', Logger::DEBUG, $sql);
     $this->getPdo()->exec($sql);
     $columnDefaults = ['clientID' => null, 'clientName' => '', 'clientTypeID' => null, 'journalTransactionID' => null, 'ownerID' => $ownerID, 'price' => null, 'quantity' => null, 'stationID' => null, 'stationName' => '', 'transactionDateTime' => '1970-01-01 00:00:01', 'transactionFor' => null, 'transactionID' => null, 'transactionType' => null, 'typeID' => null, 'typeName' => ''];
     $xPath = '//transactions/row';
     $elements = (new \SimpleXMLElement($data->getEveApiXml()))->xpath($xPath);
     $this->attributePreserveData($elements, $columnDefaults, $tableName);
     return $this;
 }
Beispiel #28
0
 /**
  * @param EveApiReadWriteInterface $data
  *
  * @return self Fluent interface.
  * @throws \LogicException
  */
 protected function preserveToOutpostList(EveApiReadWriteInterface $data)
 {
     $tableName = 'corpOutpostList';
     $ownerID = $this->extractOwnerID($data->getEveApiArguments());
     $sql = $this->getCsq()->getDeleteFromTableWithOwnerID($tableName, $ownerID);
     $this->getYem()->triggerLogEvent('Yapeal.Log.log', Logger::DEBUG, $sql);
     $this->getPdo()->exec($sql);
     $columnDefaults = ['dockingCostPerShipVolume' => null, 'officeRentalCost' => null, 'ownerID' => $ownerID, 'reprocessingEfficiency' => null, 'reprocessingStationTake' => null, 'solarSystemID' => null, 'standingOwnerID' => null, 'stationID' => null, 'stationName' => '', 'stationTypeID' => null, 'x' => null, 'y' => null, 'z' => null];
     $xPath = '//corporationStarbases/row';
     $elements = (new \SimpleXMLElement($data->getEveApiXml()))->xpath($xPath);
     $this->attributePreserveData($elements, $columnDefaults, $tableName);
     return $this;
 }
 /**
  * @param EveApiReadWriteInterface $data
  *
  * @return self Fluent interface.
  * @throws \LogicException
  */
 protected function preserveToUpcomingCalendarEvents(EveApiReadWriteInterface $data)
 {
     $tableName = 'charUpcomingCalendarEvents';
     $ownerID = $this->extractOwnerID($data->getEveApiArguments());
     $sql = $this->getCsq()->getDeleteFromTableWithOwnerID($tableName, $ownerID);
     $this->getYem()->triggerLogEvent('Yapeal.Log.log', Logger::DEBUG, $sql);
     $this->getPdo()->exec($sql);
     $columnDefaults = ['duration' => null, 'eventDate' => '1970-01-01 00:00:01', 'eventID' => null, 'eventText' => null, 'eventTitle' => null, 'importance' => null, 'ownerID' => $ownerID, 'ownerName' => '', 'ownerTypeID' => null, 'response' => null];
     $xPath = '//upcomingEvents/row';
     $elements = (new \SimpleXMLElement($data->getEveApiXml()))->xpath($xPath);
     $this->attributePreserveData($elements, $columnDefaults, $tableName);
     return $this;
 }
Beispiel #30
0
 /**
  * @param EveApiReadWriteInterface $data
  *
  * @return self Fluent interface.
  * @throws \LogicException
  */
 protected function preserveToSkillInTraining(EveApiReadWriteInterface $data)
 {
     $tableName = 'charSkillInTraining';
     $ownerID = $this->extractOwnerID($data->getEveApiArguments());
     $sql = $this->getCsq()->getDeleteFromTableWithOwnerID($tableName, $ownerID);
     $this->getYem()->triggerLogEvent('Yapeal.Log.log', Logger::DEBUG, $sql);
     $this->getPdo()->exec($sql);
     $columnDefaults = ['currentTQTime' => '1970-01-01 00:00:01', 'offset' => '0', 'ownerID' => $ownerID, 'skillInTraining' => null, 'trainingDestinationSP' => null, 'trainingEndTime' => '1970-01-01 00:00:01', 'trainingStartSP' => null, 'trainingStartTime' => '1970-01-01 00:00:01', 'trainingToLevel' => null, 'trainingTypeID' => null];
     $xPath = '//result/child::*[not(*|@*|self::dataTime)]';
     $elements = (new \SimpleXMLElement($data->getEveApiXml()))->xpath($xPath);
     $this->valuesPreserveData($elements, $columnDefaults, $tableName);
     return $this;
 }