src/CRUDlex/MySQLData.php
protected function enrichWithMany(array $rows)
    {
        $manyFields = $this->getManyFields();
        $idToData   = [];
        foreach ($rows as $row) {
            foreach ($manyFields as $manyField) {
                $row[$manyField] = [];
            }
            $idToData[$row['id']] = $row;
        }
        foreach ($manyFields as $manyField) {
            $this->enrichWithManyField($idToData, $manyField);
        }
        return array_values($idToData);
    }
protected function enrichWithMany(array $rows)
    {
        $manyFields = $this->getManyFields();
        $idToData   = [];
        foreach ($rows as $row) {
            foreach ($manyFields as $manyField) {
                $row[$manyField] = [];
            }
            $idToData[$row['id']] = $row;
        }
        foreach ($manyFields as $manyField) {
            $this->enrichWithManyField($idToData, $manyField);
        }
        return array_values($idToData);
    }
protected function enrichWithMany ( array $ rows ) { $ manyFields = $ this -> getManyFields ( ) ; $ idToData = [ ] ; foreach ( $ rows as $ row ) { foreach ( $ manyFields as $ manyField ) { $ row [ $ manyField ] = [ ] ; } $ idToData [ $ row [ 'id' ] ] = $ row ; } foreach ( $ manyFields as $ manyField ) { $ this -> enrichWithManyField ( $ idToData , $ manyField ) ; } return array_values ( $ idToData ) ; }
Fetches to the rows belonging many-to-many entries and adds them to the rows.

@param array $rows
the rows to enrich
@return array
the enriched rows
Fetches to the rows belonging many - to - many entries and adds them to the rows .