#1342 #1343 #1345 #1346 #1349 git-svn-id: http://78.47.251.156/svn/dev/sterntours-3@3340 f459cee4-fb09-11de-96c3-f9c5f16c3c76
This commit is contained in:
parent
27d2713283
commit
652eeb16cb
27 changed files with 994 additions and 204 deletions
|
|
@ -38,17 +38,29 @@ class BookingRequestValidator extends ConstraintValidator
|
|||
*/
|
||||
public function validate($bookingRequest, Constraint $constraint)
|
||||
{
|
||||
//die($bookingRequest->get);
|
||||
for ($i = 0; $i < $bookingRequest->getTravelerCount(); ++$i)
|
||||
|
||||
for($i = 0; $i < $bookingRequest->getSingleRoomCount(); ++$i)
|
||||
{
|
||||
//$this->context->atPa
|
||||
$this->context->getValidator()->inContext($this->context)
|
||||
->atPath('travelers['. $i .']')
|
||||
->validate($bookingRequest->getTravelers()[$i])
|
||||
->atPath('rooms['.$i.']')
|
||||
->validate($bookingRequest->getSingleRooms()[$i])
|
||||
;
|
||||
//$this->context->getValidator()->validate($bookingRequest->getTravelers()[$i]);
|
||||
}
|
||||
//$this->context->getValidator()->startContext()
|
||||
//->atPath('travelers')->
|
||||
|
||||
for($j = 0; $j < $bookingRequest->getDoubleRoomCount(); ++$j)
|
||||
{
|
||||
$this->context->getValidator()->inContext($this->context)
|
||||
->atPath('rooms['.($j+5).']')
|
||||
->validate($bookingRequest->getDoubleRooms()[$j])
|
||||
;
|
||||
}
|
||||
|
||||
for($k = 0; $k < $bookingRequest->getTripleRoomCount(); ++$k)
|
||||
{
|
||||
$this->context->getValidator()->inContext($this->context)
|
||||
->atPath('rooms['.($k + 10).']')
|
||||
->validate($bookingRequest->getTripleRooms()[$k])
|
||||
;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue