Example #1
0
 /**
  * Returns an instance of class (singleton pattern implementation).
  *
  * @return BOL_DocumentDao
  */
 public static function getInstance()
 {
     if (self::$classInstance === null) {
         self::$classInstance = new self();
     }
     return self::$classInstance;
 }
Example #2
0
 public function getCustomPage($key)
 {
     if ($key == 'Terms') {
         $document = BOL_DocumentDao::getInstance()->findStaticDocument('terms-of-use');
         $content = OW::getLanguage()->text('base', "local_page_content_{$document->getKey()}");
         return $content;
     }
     return 'No content yet';
 }
Example #3
0
 public function isDocumentUriUnique($uri)
 {
     return $this->documentDao->isDocumentUriUnique($uri);
 }
Example #4
0
 /**
  * Returns all active items for provided menu types.
  *
  * @param string $menuType
  * @return array
  */
 public function findMenuItemsForMenuTypes($menuTypes)
 {
     return $this->dbo->queryForList("\r\n\t\t\tSELECT `mi`.*, `mi`.`key` AS `menu_key`, `d`.`class`, `d`.`action`, `d`.`uri`, `d`.`isStatic`\r\n\t\t\tFROM `" . $this->getTableName() . "` AS `mi`\r\n\t\t\tLEFT JOIN `" . $this->documentDao->getTableName() . "` AS `d` ON ( `mi`.`" . self::DOCUMENT_KEY . "` = `d`.`" . BOL_DocumentDao::KEY . "`)\r\n\t\t\tWHERE `mi`.`" . self::TYPE . "` IN (" . $this->dbo->mergeInClause($menuTypes) . ") ORDER BY `mi`.`order` ASC");
 }
Example #5
0
 public function getCustomPage($uri)
 {
     $document = BOL_DocumentDao::getInstance()->findStaticDocument($uri);
     if ($document === null) {
         return null;
     }
     return OW::getLanguage()->text('base', "local_page_content_{$document->getKey()}");
 }