Example #1
0
 public function updateLocation(Document\Location $location, \Craft\UserBundle\Document\User $user, \Symfony\Component\HttpFoundation\Request $request)
 {
     if ($location->getId() == null) {
         $this->insertLocation($location, $user, $request);
     } else {
         $updateInfo = new Document\User($user, $request->getClientIp());
         $location->addUpdated($updateInfo);
         //$oldDoc = new Document\LocationHistory($this->findLocation('id', $location->getId()));
         //   $this->doctrine->persist($oldDoc);
         $this->doctrine->flush();
     }
     return $this;
 }