private function getSafeBlogKey($blogKey)
 {
     if ($blogKey == null) {
         return PieCrustHelper::getDefaultBlogKey($this->pieCrust);
     } else {
         $blogKeys = $this->pieCrust->getConfig()->getValueUnchecked('site/blogs');
         if (!in_array($blogKey, $blogKeys)) {
             throw new PieCrustException("No such blog in the website: {$blogKey}");
         }
         return $blogKey;
     }
 }