/** * 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)); }
/** * Returns a label for this branch * * @return string */ public function getLabel() { return $this->product->getName() . ' ' . $this->version; }