Storm\Core\Relational\ResultRow::GetAllDataFromColumns PHP Method

GetAllDataFromColumns() final public static method

Gets the data from the supplied columns from all of the supplied result rows NOTE: Keys are preserved.
final public static GetAllDataFromColumns ( array $ResultRows, array $Columns ) : ResultRow[]
$ResultRows array The result rows to get the data from
$Columns array The columns to get the from
return ResultRow[] The data of the supplied columns
    public static final function GetAllDataFromColumns(array $ResultRows, array $Columns)
    {
        $NewResultRow = new ResultRow($Columns);
        $NewResultRows = [];
        foreach ($ResultRows as $Key => $ResultRow) {
            $NewResultRows[$Key] = $NewResultRow->Another($ResultRow->GetData());
        }
        return $NewResultRows;
    }

Usage Example

Ejemplo n.º 1
0
 protected final function GroupRowsByColumnValues(array $ResultRows, array $Columns)
 {
     $GroupedRelatedRows = [];
     $GroupByKeys = Relational\ResultRow::GetAllDataFromColumns($ResultRows, $Columns);
     foreach ($ResultRows as $Key => $ResultRow) {
         $Hash = $GroupByKeys[$Key]->HashData();
         if (!isset($GroupedRelatedRows[$Hash])) {
             $GroupedRelatedRows[$Hash] = [];
         }
         $GroupedRelatedRows[$Hash][] = $ResultRow;
     }
     return $GroupedRelatedRows;
 }
All Usage Examples Of Storm\Core\Relational\ResultRow::GetAllDataFromColumns