Add book

try put all constraint in array and then use method addConstrain inside foreach. Like this
'''php
foreach ($constraintsArray as $value) {
$validator->addConstraint($value)
}
'''