Doctrine\Common\Annotations\DocParser::setImports PHP Method

setImports() public method

Sets the imports.
public setImports ( array $imports ) : void
$imports array
return void
    public function setImports(array $imports)
    {
        if ($this->namespaces) {
            throw new \RuntimeException('You must either use addNamespace(), or setImports(), but not both.');
        }
        $this->imports = $imports;
    }

Usage Example

 /**
  * Set imports for annotations
  *
  * @param array $imports
  */
 public function setImports(array $imports)
 {
     $convertedImports = array();
     foreach ($imports as $aliasName => $fullName) {
         $convertedImports[strtolower($aliasName)] = $fullName;
     }
     $this->parser->setImports($convertedImports);
 }
All Usage Examples Of Doctrine\Common\Annotations\DocParser::setImports