applications/dashboard/models/class.dbamodel.php
public function HtmlEntityDecode($Table, $Column, $Limit = 100) {
      // Construct a model to save the results.
      $Model = $this->CreateModel($Table);
      
      // Get the data to decode.
      $Data = $this->SQL
         ->Select($Model->PrimaryKey)
         ->Select($Column)
         ->From($Table)
         ->Like($Column, '&%;', 'both')
         ->Limit($Limit)
         ->Get()->ResultArray();
      
      $Result = array();
      $Result['Count'] = count($Data);
      $Result['Complete'] = FALSE;
      $Result['Decoded'] = array();
      $Result['NotDecoded'] = array();
      
      // Loop through each row in the working set and decode the values.
      foreach ($Data as $Row) {
         $Value = $Row[$Column];
         $DecodedValue = HtmlEntityDecode($Value);
         
         $Item = array('From' => $Value, 'To' => $DecodedValue);
         
         if ($Value != $DecodedValue) {
            $Model->SetField($Row[$Model->PrimaryKey], $Column, $DecodedValue);
            $Result['Decoded'] = $Item;
         } else {
            $Result['NotDecoded'] = $Item;
         }
      }
      $Result['Complete'] = $Result['Count'] < $Limit;
      
      return $Result;
   }
public function HtmlEntityDecode($Table, $Column, $Limit = 100) {
      // Construct a model to save the results.
      $Model = $this->CreateModel($Table);
      
      // Get the data to decode.
      $Data = $this->SQL
         ->Select($Model->PrimaryKey)
         ->Select($Column)
         ->From($Table)
         ->Like($Column, '&%;', 'both')
         ->Limit($Limit)
         ->Get()->ResultArray();
      
      $Result = array();
      $Result['Count'] = count($Data);
      $Result['Complete'] = FALSE;
      $Result['Decoded'] = array();
      $Result['NotDecoded'] = array();
      
      // Loop through each row in the working set and decode the values.
      foreach ($Data as $Row) {
         $Value = $Row[$Column];
         $DecodedValue = HtmlEntityDecode($Value);
         
         $Item = array('From' => $Value, 'To' => $DecodedValue);
         
         if ($Value != $DecodedValue) {
            $Model->SetField($Row[$Model->PrimaryKey], $Column, $DecodedValue);
            $Result['Decoded'] = $Item;
         } else {
            $Result['NotDecoded'] = $Item;
         }
      }
      $Result['Complete'] = $Result['Count'] < $Limit;
      
      return $Result;
   }
public function HtmlEntityDecode ( $ Table , $ Column , $ Limit = 100 ) { // Construct a model to save the results. $ Model = $ this -> CreateModel ( $ Table ) ; // Get the data to decode. $ Data = $ this -> SQL -> Select ( $ Model -> PrimaryKey ) -> Select ( $ Column ) -> From ( $ Table ) -> Like ( $ Column , '&%;' , 'both' ) -> Limit ( $ Limit ) -> Get ( ) -> ResultArray ( ) ; $ Result = array ( ) ; $ Result [ 'Count' ] = count ( $ Data ) ; $ Result [ 'Complete' ] = FALSE ; $ Result [ 'Decoded' ] = array ( ) ; $ Result [ 'NotDecoded' ] = array ( ) ; // Loop through each row in the working set and decode the values. foreach ( $ Data as $ Row ) { $ Value = $ Row [ $ Column ] ; $ DecodedValue = HtmlEntityDecode ( $ Value ) ; $ Item = array ( 'From' => $ Value , 'To' => $ DecodedValue ) ; if ( $ Value != $ DecodedValue ) { $ Model -> SetField ( $ Row [ $ Model -> PrimaryKey ] , $ Column , $ DecodedValue ) ; $ Result [ 'Decoded' ] = $ Item ; } else { $ Result [ 'NotDecoded' ] = $ Item ; } } $ Result [ 'Complete' ] = $ Result [ 'Count' ] < $ Limit ; return $ Result ; }
Remove html entities from a column in the database.

@param string $Table The name of the table.
@param array $Column The column to decode.
@param int $Limit The number of records to work on.
Remove html entities from a column in the database .