diff --git a/hwe/sammo/Constraint/ConstraintHelper.php b/hwe/sammo/Constraint/ConstraintHelper.php index e354eaf6..e90bf713 100644 --- a/hwe/sammo/Constraint/ConstraintHelper.php +++ b/hwe/sammo/Constraint/ConstraintHelper.php @@ -156,6 +156,10 @@ class ConstraintHelper{ return [__FUNCTION__]; } + static function NotOccupiedCity():array{ + return [__FUNCTION__]; + } + static function NotOccupiedDestCity():array{ return [__FUNCTION__]; } diff --git a/hwe/sammo/Constraint/NotOccupiedCity.php b/hwe/sammo/Constraint/NotOccupiedCity.php new file mode 100644 index 00000000..a3026569 --- /dev/null +++ b/hwe/sammo/Constraint/NotOccupiedCity.php @@ -0,0 +1,37 @@ +general)){ + if(!$throwExeception){return false; } + throw new \InvalidArgumentException("require nation in general"); + } + + if(!key_exists('nation', $this->city)){ + if(!$throwExeception){return false; } + throw new \InvalidArgumentException("require nation in city"); + } + + return true; + } + + public function test():bool{ + $this->checkInputValues(); + $this->tested = true; + + if($this->city['nation'] != $this->general['nation']){ + return true; + } + + $this->reason = "아국입니다."; + return false; + } +} \ No newline at end of file