/** * Основной метод, выполняющий построение контроллера для просмотра постов. * Контроллер может быть отображен в двух случаях: * 1. На странице с просмотром всех постов * 2. На странице с рубрикой * * @return ShowcasesControllerPanel */ private function getScPanel($postType, Rubric $rubric = null) { $key = $postType . '-' . ($rubric ? $rubric->getIdent() : ''); if (!$this->CACHE->has($key)) { $plugins[] = $this->getBaseControllerIdents(); if ($rubric) { $plugins[] = Mappings::RUBRIC_2_SCCONTROLLERS($postType)->getMappedEntitys($rubric->getIdent()); } $insts = $this->getUserAcessibleClassInsts(to_array_expand($plugins)); $ctxt = new ShowcasesControllerCtxt($rubric); $result = array(); /** @var ShowcasesControllerItem */ foreach ($insts as $ident => $inst) { $inst->doProcess($ctxt); $result[$ident] = $inst; } $this->CACHE->set($key, new ShowcasesControllerPanel($result)); } return $this->CACHE->get($key); }
/** * Регистрация маппингов SDK */ private final function registerSdkMappings() { $this->register(Mappings::FOLDINGS2DB()); }
protected function __construct() { $this->CACHE = new SimpleDataCache(); $this->LOGGER = PsLogger::inst(__CLASS__); /** * Подключаем cache lite */ ExternalPluginsManager::CacheLite(); $liteOptions = array('readControl' => true, 'writeControl' => true, 'readControlType' => 'md5', 'automaticSerialization' => true, 'cacheDir' => DirManager::autogen('cache')->absDirPath(), 'lifeTime' => CACHE_LITE_LIFE_TIME * 60, 'caching' => true); $this->CACHELITE = new Cache_Lite($liteOptions); $GROUPS = self::getCacheGroups(); $TREE[self::CHILD_FOLDING] = Mappings::CACHE_FOLDINGS()->getAllMappedEntitys($GROUPS); $TREE[self::CHILD_DBENTITY] = Mappings::CACHE_DBENTITYS()->getAllMappedEntitys($GROUPS); $this->TREE = new PSCacheTree($this->LOGGER, $TREE); }
private function buildInquireMapping($xml) { $inquireMapping = new InquireMapping(); $inquireMapping->setRequestId((string) $xml->RequestId); $mappings = new Mappings(); $mappingArray = array(); foreach ($xml->Mappings->Mapping as $mapping) { $tmpMapping = new Mapping(); $tmpMapping->setMappingId((string) $mapping->MappingId); $tmpMapping->setSubscriberId((string) $mapping->SubscriberId); $tmpMapping->setAccountUsage((string) $mapping->AccountUsage); $tmpMapping->setDefaultIndicator((string) $mapping->DefaultIndicator); $tmpMapping->setAlias((string) $mapping->Alias); $tmpMapping->setICA((string) $mapping->ICA); $tmpMapping->setAccountNumber((string) $mapping->AccountNumber); $tmpCardholderFullName = new CardholderFullName(); $cardholderFullName = $mapping->CardholderFullName; $tmpCardholderFullName->setCardholderFirstName((string) $cardholderFullName->CardholderFirstName); $tmpCardholderFullName->setCardholderMiddleName((string) $cardholderFullName->CardholderMiddleName); $tmpCardholderFullName->setCardholderLastName((string) $cardholderFullName->CardholderLastName); $tmpAddress = new Address(); $address = $mapping->Address; $tmpAddress->setLine1((string) $address->line1); $tmpAddress->setLine2((string) $address->line2); $tmpAddress->setCity((string) $address->City); $tmpAddress->setCountrySubdivision((string) $address->CountrySubdivision); $tmpAddress->setPostalCode((string) $address->PostalCode); $tmpAddress->setCountry((string) $address->Country); $tmpReceivingEligibility = new ReceivingEligibility(); $receivingEligibility = $mapping->ReceivingEligibility; $tmpReceivingEligibility->setEligible((string) $receivingEligibility->Eligible); $tmpCurrency = new Currency(); $currency = $receivingEligibility->Currency; $tmpCurrency->setAlphaCurrencyCode((string) $currency->AlphaCurrencyCode); $tmpCurrency->setNumericCurrencyCode((string) $currency->NumericCurrencyCode); $tmpCountry = new Country(); $country = $receivingEligibility->Country; $tmpCountry->setAlphaCountryCode((string) $country->AlphaCountryCode); $tmpCountry->setAlphaCountryCode((string) $country->NumericCountryCode); $tmpBrand = new Brand(); $brand = $receivingEligibility->Brand; $tmpBrand->setAcceptanceBrandCode((string) $brand->AcceptanceBrandCode); $tmpBrand->setProductBrandCode((string) $brand->ProductBrandCode); $tmpMapping->setExpiryDate((string) $mapping->ExpiryDate); $tmpReceivingEligibility->setCurrency($tmpCurrency); $tmpReceivingEligibility->setCountry($tmpCountry); $tmpReceivingEligibility->setBrand($tmpBrand); $tmpMapping->setCardholderFullName($tmpCardholderFullName); $tmpMapping->setAddress($tmpAddress); $tmpMapping->setReceivingEligibility($tmpReceivingEligibility); array_push($mappingArray, $tmpMapping); } $mappings->setMapping($mappingArray); $inquireMapping->setMappings($mappings); return $inquireMapping; }
public function getTablesWithDependableCaches() { //Мы обратимся к маппингу, хранящему привязку ГруппаКешей -> СущностьБД $cacheMappingHash = Mappings::CACHE_DBENTITYS()->getHash(); return $this->getValues("select distinct rident as value from ps_mappings where mhash=? and rident not like 'v_%'", $cacheMappingHash); }