public function splitByClass()
    {

        $classes = array();
        foreach( $this->collection as $key => $entity ) {
            $classes[get_class($entity)][] = $key;
        }
        ksort( $classes );

        $output = array();
        foreach( $classes as $class => $splHashes ) {
            $container = $this->newContainer();
            $container->class = $class;
            $container->collection = array_intersect_key(
                $this->collection,
                array_flip( $splHashes )
            );
            $output[$class] = $container;
        }
        return $output;

    }
public function splitByClass()
    {

        $classes = array();
        foreach( $this->collection as $key => $entity ) {
            $classes[get_class($entity)][] = $key;
        }
        ksort( $classes );

        $output = array();
        foreach( $classes as $class => $splHashes ) {
            $container = $this->newContainer();
            $container->class = $class;
            $container->collection = array_intersect_key(
                $this->collection,
                array_flip( $splHashes )
            );
            $output[$class] = $container;
        }
        return $output;

    }
public function splitByClass ( ) { $ classes = array ( ) ; foreach ( $ this -> collection as $ key => $ entity ) { $ classes [ get_class ( $ entity ) ] [ ] = $ key ; } ksort ( $ classes ) ; $ output = array ( ) ; foreach ( $ classes as $ class => $ splHashes ) { $ container = $ this -> newContainer ( ) ; $ container -> class = $ class ; $ container -> collection = array_intersect_key ( $ this -> collection , array_flip ( $ splHashes ) ) ; $ output [ $ class ] = $ container ; } return $ output ; }
Split by class
@return array of containers
Split by class