public function checkForTravelerIdMovement(TravelerId $liveTravelerId, TravelerId $travelerId)
 {
     $move = null;
     if ($liveTravelerId->getBin() !== $travelerId->getBin()) {
         $move = new InventoryTravelerIdMovement();
         $move->setTravelerId($liveTravelerId);
         $move->setByUser($this->getUser());
         $move->setMovedAt(new \DateTime());
         $move->setFromBin($liveTravelerId->getBin());
         $move->setToBin($travelerId->getBin());
         $this->getDoctrine()->getManager()->persist($move);
     }
     return $move;
 }
 public function getLogEntityForTravelerId(TravelerId $travelerId, User $user)
 {
     switch ($this->type) {
         case 'edit':
             $logEntity = new InventoryTravelerIdEdit();
             $logEntity->setOldAttributes($this->oldAttributes);
             $logEntity->setNewAttributes($this->newAttributes);
             $logEntity->setEditedAt(new \DateTime());
             $logEntity->setByUser($user);
             $logEntity->setTravelerId($travelerId);
             return $logEntity;
         case 'move':
             $logEntity = new InventoryTravelerIdMovement();
             $logEntity->fromBin($this->fromBin);
             $logEntity->toBin($this->toBin);
             $logEntity->setMovedAt(new \DateTime());
             $logEntity->setByUser($user);
             $logEntity->setTravelerId($travelerId);
             return $logEntity;
         default:
             throw new \Exception("Must Supply a type('edit','move') for a Mass TravelerId Update");
     }
 }
 public function createTravelerIdMovementIntoDeviation(TravelerId $travelerId, Bin $deviationBin)
 {
     $move = new InventoryTravelerIdMovement();
     $move->setTravelerId($travelerId);
     $move->setByUser($this->getByUser());
     $move->setMovedAt(new \DateTime());
     $move->setFromBin($this->getForBin());
     $move->setToBin($deviationBin);
     $move->addTag('audit');
     return $move;
 }