コード例 #1
0
 /**
  * Update user band.
  * @param $json
  * @return \Oak\MVC\JsonViewModel
  */
 public function updateAction($json)
 {
     $bandDto = $this->convertJson($json);
     $userBand = $this->userBandRepository->find($bandDto->id);
     $this->bandHelper->populateUserBandWithDto($userBand, $bandDto);
     $band = $this->bandRepository->findByName($userBand->getName());
     if ($band == null) {
         $band = $this->bandHelper->convertDtoToBand($bandDto);
         $this->bandRepository->persist($band);
     }
     $userBand->setBand($band);
     $this->userBandRepository->flush();
     $resultDto = $this->bandHelper->convertUserBandToDto($userBand);
     return new JsonViewModel($resultDto, $this->jsonUtils);
 }
コード例 #2
0
ファイル: BandTest.php プロジェクト: rigobertbot/meta-player
 /**
  * @covers {className}::{origMethodName}
  * @todo Implement testGetId().
  */
 public function testGetId()
 {
     self::assertNotEmpty($this->bandRepository->findAll());
 }