/**
  * Load a single DatagridColumnPreference object,
  * by DatagridId, DatagridColumnId, UserAccountId Index(es)
  * @param integer $intDatagridId
  * @param integer $intDatagridColumnId
  * @param integer $intUserAccountId
  * @return DatagridColumnPreference
  */
 public static function LoadByDatagridShortDescriptionColumnNameUserAccountId($strDatagridShortDescription, $strColumnName, $intUserAccountId)
 {
     $objDatagrid = Datagrid::LoadByShortDescription($strDatagridShortDescription);
     if ($objDatagrid) {
         return DatagridColumnPreference::LoadByDatagridIdColumnNameUserAccountId($objDatagrid->DatagridId, $strColumnName, $intUserAccountId);
     } else {
         throw new Exception(sprintf('The datagrid %s is not represented in the datagrid table in the database', $strDatagridShortDescription));
     }
 }
Пример #2
0
 public function SaveDisplayPreference($strDatagridName)
 {
     $objDatagridColumnPreference = DatagridColumnPreference::LoadByDatagridShortDescriptionColumnNameUserAccountId($strDatagridName, $this->Name, QApplication::$objUserAccount->UserAccountId);
     if (!$objDatagridColumnPreference) {
         $objDatagridColumnPreference = new DatagridColumnPreference();
         $objDatagrid = Datagrid::LoadByShortDescription($strDatagridName);
         if ($objDatagrid) {
             $objDatagridColumnPreference->DatagridId = $objDatagrid->DatagridId;
         } else {
             throw new Exception(sprintf("The datagrid %s is not represented in the database", $strDatagridName));
         }
         $objDatagridColumnPreference->ColumnName = $this->Name;
         $objDatagridColumnPreference->UserAccountId = QApplication::$objUserAccount->UserAccountId;
     }
     $objDatagridColumnPreference->DisplayFlag = $this->Display;
     $objDatagridColumnPreference->Save();
 }