Symfony\Component\Console\Command\Command::setApplication PHP Метод

setApplication() публичный Метод

Sets the application instance for this command.
public setApplication ( Application $application = null )
$application Symfony\Component\Console\Application An Application instance
    public function setApplication(Application $application = null)
    {
        $this->application = $application;
        if ($application) {
            $this->setHelperSet($application->getHelperSet());
        } else {
            $this->helperSet = null;
        }
    }

Usage Example

 /**
  * @param string $entityManagerName
  * @return string
  */
 protected function wrapCommand($entityManagerName)
 {
     if (!$this->isVersionCompatible()) {
         throw new \RuntimeException(sprintf('"%s" requires doctrine-orm "%s" or newer', $this->getName(), $this->getMinimalVersion()));
     }
     DoctrineCommandHelper::setApplicationEntityManager($this->getApplication(), $entityManagerName);
     $this->command->setApplication($this->getApplication());
     return $this->command;
 }
All Usage Examples Of Symfony\Component\Console\Command\Command::setApplication