Example #1
0
 public static function loadSeodata()
 {
     $mapper = Application_Model_Mappers_SeodataMapper::getInstance();
     $seoData = $mapper->fetchAll();
     if (is_array($seoData) && !empty($seoData)) {
         return $seoData[0];
     }
     return new Application_Model_Models_Seodata();
 }
 private function _addConversionCode()
 {
     $pageMapper = Application_Model_Mappers_PageMapper::getInstance();
     $seoDataMapper = Application_Model_Mappers_SeodataMapper::getInstance();
     $seoDataModel = new Application_Model_Models_Seodata();
     $seoData = $seoDataMapper->fetchAll();
     if (empty($seoData)) {
         $seoDataModel->setSeoTop('{$form:conversioncode}');
         $seoDataMapper->save($seoDataModel);
     } else {
         $seoTopData = $seoData[0]->getSeoTop();
         $seoHeadData = $seoData[0]->getSeoHead();
         $seoBottomData = $seoData[0]->getSeoBottom();
         $id = $seoData[0]->getId();
         if (!preg_match('~\\{\\$form\\:conversioncode\\}~', $seoTopData)) {
             $seoDataModel->setId($id);
             $seoDataModel->setSeoTop($seoTopData . ' {$form:conversioncode}');
             $seoDataModel->setSeoHead($seoHeadData);
             $seoDataModel->setSeoBottom($seoBottomData);
             $seoDataMapper->save($seoDataModel);
         }
     }
 }