forked from kevinowino869/mitrobill
check if router has plan
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user