예제 #1
0
파일: LeDb.php 프로젝트: guidamedia/leroy
 /**
  * @param LeDbData $data
  * @param LeDbTypeEnum $leDbEnum
  * @param array $formattedData
  */
 public function setDbData(LeDbData $data, LeDbTypeEnum $leDbEnum, array $formattedData)
 {
     $accountId = $data->getAccountId();
     $dsn = $data->getDsn();
     $dbData = parent::getJsonDecodedData();
     if (!array_key_exists($accountId, $dbData)) {
         $dbData[$accountId] = [];
         $dbData[$accountId][$dsn] = [];
         $dbData[$accountId][$dsn][$leDbEnum->getValue()] = [];
     } elseif (!array_key_exists($dsn, $dbData[$accountId])) {
         $dbData[$accountId][$dsn] = [];
         $dbData[$accountId][$dsn][$leDbEnum->getValue()] = [];
     } elseif (!array_key_exists($leDbEnum->getValue(), $dbData[$accountId][$dsn])) {
         $dbData[$accountId][$dsn][$leDbEnum->getValue()] = [];
     }
     if (LeDbTypeEnum::master() == $leDbEnum) {
         $dbData[$accountId][$dsn][$leDbEnum->getValue()] = $formattedData;
     } else {
         $dbData[$accountId][$dsn][$leDbEnum->getValue()][$formattedData['server']] = $formattedData;
     }
     parent::setJsonDecodedData($dbData);
 }
예제 #2
0
 public function init(LeConfigData $data)
 {
     parent::init($data);
 }