public function setStockLevel(Unit $unit, array $row, $location = 'web')
 {
     $stockKey = $this->_headingKeys->getKey('stock');
     if (!is_string($location) && !$location instanceof Location\Location) {
         throw new \InvalidArgumentException('Location must be either a string or an instance of Location');
     } elseif (!array_key_exists($stockKey, $row)) {
         throw new \LogicException('No stock column in row!');
     }
     $stockLevel = (int) $row[$stockKey];
     if ($stockLevel > 0) {
         $location = $location instanceof Location\Location ? $location : $this->_locations->get($location);
         $this->_stockManager->setReason($this->_reason);
         $this->_stockManager->set($unit, $location, $stockLevel);
     }
 }
 protected function _setStockManager()
 {
     $this->writeln('Setting stock manager');
     $this->_stockManager = $this->get('stock.manager');
     $reason = $this->get('stock.movement.reasons')->get(self::REASON);
     $this->_stockManager->setReason($reason);
     $this->writeln('Stock manager set');
     return $this;
 }