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;
  }