/**
  * Generate a barcode and save it to the database if it hasn't already been set against the unit
  *
  * @param Product\Unit\Event $event
  */
 public function saveBarcode(Product\Unit\Event $event)
 {
     $unit = $event->getUnit();
     if (!$unit->barcode) {
         $this->get('product.barcode.edit')->generateAndSave($unit);
     }
 }