Esempio n. 1
0
 /**
  * Returns array of blogs by URLs
  *
  * @param array $aBlogsUrl
  *
  * @return array
  */
 public function GetBlogsByUrl($aBlogsUrl)
 {
     $sCacheKey = 'blogs_by_url_' . serialize($aBlogsUrl);
     if (false === ($aBlogs = E::ModuleCache()->Get($sCacheKey))) {
         if ($aBlogsId = $this->oMapper->GetBlogsIdByUrl($aBlogsUrl)) {
             $aBlogs = $this->GetBlogsAdditionalData($aBlogsId);
             $aOrders = array_flip($aBlogsUrl);
             foreach ($aBlogs as $oBlog) {
                 $oBlog->setProp('_order', $aOrders[$oBlog->getUrl()]);
             }
             $aBlogs = F::Array_SortEntities($aBlogs, '_order');
             $aAdditionalCacheKeys = F::Array_ChangeValues($aBlogsUrl, 'blog_update_');
         } else {
             $aBlogs = array();
             $aAdditionalCacheKeys = array();
         }
         $aAdditionalCacheKeys[] = 'blog_update';
         $aAdditionalCacheKeys[] = 'blog_new';
         E::ModuleCache()->Set(array(), $sCacheKey, $aAdditionalCacheKeys, 'P30D');
     }
     return $aBlogs;
 }