check if router has plan

This commit is contained in:
Ibnu Maksum 2023-09-21 12:09:13 +07:00
parent c5b96df43f
commit c9eeefcf3d
No known key found for this signature in database
GPG key ID: 7FC82848810579E5
2 changed files with 119 additions and 98 deletions

View file

@ -299,4 +299,23 @@ class Validator
return (bool)in_array($format, $formats);
}
public static function countRouterPlan($plans, $router){
$n = 0;
foreach ($plans as $plan){
if($plan['routers'] == $router){
$n++;
}
}
return $n;
}
public static function isRouterHasPlan($plans, $router){
foreach ($plans as $plan){
if($plan['routers'] == $router){
return true;
}
}
return false;
}
}