Commit 93b9605f authored by Ad Schellevis's avatar Ad Schellevis

(captiveportal/mvc) add getByZoneID to model

parent 64f0dae2
...@@ -36,4 +36,18 @@ use OPNsense\Base\BaseModel; ...@@ -36,4 +36,18 @@ use OPNsense\Base\BaseModel;
*/ */
class CaptivePortal extends BaseModel class CaptivePortal extends BaseModel
{ {
/**
* retrieve zone by number
* @param $zoneid zone number
* @return null|BaseField zone details
*/
public function getByZoneID($zoneid)
{
foreach ($this->zones->zone->__items as $zone) {
if ($zoneid == (string)$zone->zoneid) {
return $zone;
}
}
return null;
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment