public function mergeFromClass(GClass $gClass) {
    try {
      foreach ($gClass->getImports()->toArray() as $alias => $import) {
        $this->add($import, $alias);
      }
    } catch (InvalidArgumentException $e) {
      \Doctrine\Common\Util\Debug::dump($gClass->getImports()->toArray());
      throw new InvalidArgumentException('Cannot add all imports from '.$gClass->getFQN().' into imports.', 0, $e);
    }
    
    return $this;
  }
public function mergeFromClass(GClass $gClass) {
    try {
      foreach ($gClass->getImports()->toArray() as $alias => $import) {
        $this->add($import, $alias);
      }
    } catch (InvalidArgumentException $e) {
      \Doctrine\Common\Util\Debug::dump($gClass->getImports()->toArray());
      throw new InvalidArgumentException('Cannot add all imports from '.$gClass->getFQN().' into imports.', 0, $e);
    }
    
    return $this;
  }
public function mergeFromClass ( GClass $ gClass ) { try { foreach ( $ gClass -> getImports ( ) -> toArray ( ) as $ alias => $ import ) { $ this -> add ( $ import , $ alias ) ; } } catch ( InvalidArgumentException $ e ) { \ Doctrine \ Common \ Util \ Debug :: dump ( $ gClass -> getImports ( ) -> toArray ( ) ) ; throw new InvalidArgumentException ( 'Cannot add all imports from ' . $ gClass -> getFQN ( ) . ' into imports.' , 0 , $ e ) ; } return $ this ; }
Merges all Imports from a GClass to this imports

@chainable
Merges all Imports from a GClass to this imports