コード例 #1
0
 public function getEmptyLocationAction()
 {
     $location = new Location();
     $entityManager = $this->app->entityManager;
     $now = new DateTime();
     $userRepository = $entityManager->getRepository(EntityNames::USER);
     $origUser = $userRepository->findOneBy(array('id' => $_SESSION['user_id']));
     $location->setAuthor($origUser);
     $location->setCreationDate($now);
     $location->setLastEditDate($now);
     ResponseFactory::createJsonResponse($this->app, $location);
 }
コード例 #2
0
ファイル: Location.php プロジェクト: rmatil/angular-cms
 public function update(Location $location)
 {
     $this->setAddress($location->getAddress());
     $this->setDescription($location->getDescription());
     $this->setLatitude($location->getLatitude());
     $this->setLongitude($location->getLongitude());
     $this->setName($location->getName());
     $this->setLastEditDate($location->getLastEditDate());
     $this->setCreationDate($location->getCreationDate());
     $this->setAuthor($location->getAuthor());
 }