/**
  * Create a new product
  *
  * This command creates a new product with the given name.
  *
  * @param string $name The product name
  * @return void
  */
 public function createProductCommand($name)
 {
     if ($this->productRepository->findOneByName($name) !== NULL) {
         $this->outputLine('Product "%s" already exists.', array($name));
         $this->quit(1);
     }
     $product = new Product();
     $product->setName($name);
     $this->productRepository->add($product);
     $this->outputLine('Created new product "%s".', array($name));
 }
Exemple #2
0
 /**
  * Returns a label for this branch
  *
  * @return string
  */
 public function getLabel()
 {
     return $this->product->getName() . ' ' . $this->version;
 }