original_string: protected function getCollection($type)
      {
          $collection = new ArrayCollection();
          $key        = $this->config[$type]['key'];
          $hydrator   = $this->getHydrator($type);
          $filter     = 'filter' . rtrim($type, 's');
          $entity     = $this->getEntity($type);
          $dataArray  = $this->getData($key);
          
          if ($dataArray) {
              foreach ($dataArray as $data) {
                  $data    = $this->$filter($data);
                  if (!count($data)) {
                      continue;
                  }
                  $current = $hydrator->hydrate($data, clone $entity);
                  $collection->add($current);
              }
          }
          return $collection;
      }
code: protected function getCollection($type)
      {
          $collection = new ArrayCollection();
          $key        = $this->config[$type]['key'];
          $hydrator   = $this->getHydrator($type);
          $filter     = 'filter' . rtrim($type, 's');
          $entity     = $this->getEntity($type);
          $dataArray  = $this->getData($key);
          
          if ($dataArray) {
              foreach ($dataArray as $data) {
                  $data    = $this->$filter($data);
                  if (!count($data)) {
                      continue;
                  }
                  $current = $hydrator->hydrate($data, clone $entity);
                  $collection->add($current);
              }
          }
          return $collection;
      }
code_tokens: protected function getCollection ( $ type ) { $ collection = new ArrayCollection ( ) ; $ key = $ this -> config [ $ type ] [ 'key' ] ; $ hydrator = $ this -> getHydrator ( $ type ) ; $ filter = 'filter' . rtrim ( $ type , 's' ) ; $ entity = $ this -> getEntity ( $ type ) ; $ dataArray = $ this -> getData ( $ key ) ; if ( $ dataArray ) { foreach ( $ dataArray as $ data ) { $ data = $ this -> $ filter ( $ data ) ; if ( ! count ( $ data ) ) { continue ; } $ current = $ hydrator -> hydrate ( $ data , clone $ entity ) ; $ collection -> add ( $ current ) ; } } return $ collection ; }
docstring: Creates a collection of normalized embedded documents.
  
  @param string $type
  @uses getHydrator(), getEntity(), getData()
  @return \Core\Entity\Collection\ArrayCollection
docstring_tokens: Creates a collection of normalized embedded documents .