Example #1
0
 public function getRelatedItem($catalogGuid, $relateAs)
 {
     $this->catalogGuid = $catalogGuid;
     $a2 = array();
     $aNodesTraversed = array();
     $this->_traverseHistory($aNodesTraversed, $a2, $catalogGuid, $relateAs);
     $tblCatalogAttribute = new App_Model_Db_Table_CatalogAttribute();
     $aTmp2['node'] = $catalogGuid;
     $aTmp2['nodeLeft'] = 'tmpLeft';
     $aTmp2['nodeRight'] = 'tmpRight';
     $aTmp2['description'] = '';
     $aTmp2['relationType'] = '';
     $where2 = "catalogGuid='{$catalogGuid}' AND attributeGuid='fixedTitle'";
     $rowCatalogAttribute = $tblCatalogAttribute->fetchRow($where2);
     if (isset($rowCatalogAttribute->value)) {
         $aTmp2['title'] = $rowCatalogAttribute->value;
     } else {
         $aTmp2['title'] = 'No-Title';
     }
     $where2 = "catalogGuid='{$catalogGuid}' AND attributeGuid='fixedSubTitle'";
     $rowCatalogAttribute = $tblCatalogAttribute->fetchRow($where2);
     if (isset($rowCatalogAttribute->value)) {
         $aTmp2['subTitle'] = $rowCatalogAttribute->value;
     } else {
         $aTmp2['subTitle'] = 'No-Title';
     }
     $where2 = "catalogGuid='{$catalogGuid}' AND attributeGuid='fixedDate'";
     $rowCatalogAttribute = $tblCatalogAttribute->fetchRow($where2);
     if (isset($rowCatalogAttribute->value)) {
         $aTmp2['fixedDate'] = $rowCatalogAttribute->value;
     } else {
         $aTmp2['fixedDate'] = '00-00-00';
     }
     array_push($a2, $aTmp2);
     UtilHistorySort::sort($a2, 'fixedDate', false);
     return $a2;
 }
Example #2
0
 static function sort(&$v, $field, $asc = true)
 {
     self::$sortfield = $field;
     self::$sortorder = $asc ? 1 : -1;
     usort($v, array('UtilHistorySort', 'sort_callback'));
 }