/**
  * The function update product attribute
  */
 public function updateProduct($attributes, models\Category $category)
 {
     $product = new models\Product();
     $product->setCode($attributes['Code']);
     $product->setArticle($attributes['Article']);
     $product->setName($attributes['Name']);
     $product->setBasicMeasure($attributes['Basic_measure']);
     $product->setMeasure($attributes['Measure']);
     $product->setCost($attributes['Cost']);
     $product->setCurrency($attributes['Currency']);
     $product->setIdCodeCategory($category);
     $this->entityManager->merge($product);
     $this->entityManager->flush();
 }