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;
    }
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;
    }
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 ; }
Creates a collection of normalized embedded documents.

@param string $type
@uses getHydrator(), getEntity(), getData()
@return \Core\Entity\Collection\ArrayCollection
Creates a collection of normalized embedded documents .