コード例 #1
0
ファイル: BoxberryApi.php プロジェクト: morfin60/boxberry-api
 /**
  * {@inheritdoc}
  */
 public function pointsDescription($code, $photo = 0)
 {
     $values = ['code' => $code, 'photo' => $photo];
     $constraint = new Assert\Collection(['code' => new Assert\Required([new Assert\Type(['type' => 'numeric', 'message' => 'code should be {{ type }}']), new Assert\GreaterThan(['value' => 0, 'message' => 'code should be greater than {{ compared_value }}'])]), 'photo' => new Assert\Required([new Assert\Type(['type' => 'numeric', 'message' => 'photo should be {{ type }}']), new Assert\Choice(['value' => [0, 1], 'message' => 'photo should be either 0 or 1'])])]);
     $this->validator->validateValues($values, $constraint);
     return $this->mapper->map($this->impl->pointsDescription($code, $photo), 'PointDescription');
 }