Practice::getCommissioningBodyOfType PHP Method

getCommissioningBodyOfType() public method

get the CommissioningBody of the CommissioningBodyType $type currently assumes there would only ever be one commissioning body of a given type.
public getCommissioningBodyOfType ( CommissioningBodyType $type ) : CommissioningBody
$type CommissioningBodyType
return CommissioningBody
    public function getCommissioningBodyOfType($type)
    {
        foreach ($this->commissioningbodies as $body) {
            if ($body->type->id == $type->id) {
                return $body;
            }
        }
    }