original_string: public function all(array $collections = [], $groupByCollection = false)
      {
          if (count($collections) === 0) {
              if ($groupByCollection === false) {
                  return $this->items;
              }
  
              return $this->itemCollections;
          }
  
          $result = [];
  
          foreach ($collections as $collection) {
              if (isset($this->itemCollections[$collection]) === false) {
                  continue;
              }
  
              if ($groupByCollection === false) {
                  $result = array_merge($result, $this->itemCollections[$collection]);
  
                  continue;
              }
  
              $result[$collection] = $this->itemCollections[$collection];
          }
  
          return $result;
      }
code: public function all(array $collections = [], $groupByCollection = false)
      {
          if (count($collections) === 0) {
              if ($groupByCollection === false) {
                  return $this->items;
              }
  
              return $this->itemCollections;
          }
  
          $result = [];
  
          foreach ($collections as $collection) {
              if (isset($this->itemCollections[$collection]) === false) {
                  continue;
              }
  
              if ($groupByCollection === false) {
                  $result = array_merge($result, $this->itemCollections[$collection]);
  
                  continue;
              }
  
              $result[$collection] = $this->itemCollections[$collection];
          }
  
          return $result;
      }
code_tokens: public function all ( array $ collections = [ ] , $ groupByCollection = false ) { if ( count ( $ collections ) === 0 ) { if ( $ groupByCollection === false ) { return $ this -> items ; } return $ this -> itemCollections ; } $ result = [ ] ; foreach ( $ collections as $ collection ) { if ( isset ( $ this -> itemCollections [ $ collection ] ) === false ) { continue ; } if ( $ groupByCollection === false ) { $ result = array_merge ( $ result , $ this -> itemCollections [ $ collection ] ) ; continue ; } $ result [ $ collection ] = $ this -> itemCollections [ $ collection ] ; } return $ result ; }
docstring: Returns all items in this collection.
  
  @param string[] $collections       The name of the item collections affected.
  Array empty means all
  @param bool     $groupByCollection First level of array is the collection name
  
  @return array
docstring_tokens: Returns all items in this collection .