Ejemplo n.º 1
0
 public function getObjectTypeName($sLanguageId = null)
 {
     return FrontendModule::getDisplayNameByName($this->getObjectType(), $sLanguageId);
 }
Ejemplo n.º 2
0
 private function paramsForObject($oObject)
 {
     $aObject = array('id' => $oObject->getId());
     $aObject['language_objects'] = array();
     foreach (LanguageQuery::create()->orderById()->find() as $oLanguage) {
         $aLanguageInfo = array();
         $oLanguageObject = $oObject->getLanguageObject($oLanguage->getId());
         $aLanguageInfo['exists_in_language'] = $oLanguageObject !== null;
         if ($oLanguageObject === null) {
             $oLanguageObject = LanguageObjectHistoryQuery::create()->filterByLanguageId($oLanguage->getId())->filterByObjectId($oObject->getId())->sort()->findOne();
             $aLanguageInfo['is_draft'] = $oLanguageObject !== null;
         } else {
             $aLanguageInfo['is_draft'] = $oLanguageObject->getHasDraft();
         }
         if ($oLanguageObject !== null) {
             $sFrontendModuleClass = FrontendModule::getClassNameByName($oObject->getObjectType());
             if (class_exists($sFrontendModuleClass, true)) {
                 $mContentInfo = $sFrontendModuleClass::getContentInfo($oLanguageObject);
             } else {
                 $mContentInfo = null;
             }
             $aLanguageInfo['content_info'] = $mContentInfo;
         } else {
             $aLanguageInfo['content_info'] = null;
         }
         $aObject['language_objects'][$oLanguage->getId()] = $aLanguageInfo;
     }
     $aObject['object_type'] = $oObject->getObjectType();
     $aObject['has_condition'] = $oObject->getConditionSerialized() !== null;
     $aObject['object_type_display_name'] = FrontendModule::getDisplayNameByName($oObject->getObjectType());
     return $aObject;
 }