Practice::getCommissioningBodyOfType PHP 메소드

getCommissioningBodyOfType() 공개 메소드

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
리턴 CommissioningBody
    public function getCommissioningBodyOfType($type)
    {
        foreach ($this->commissioningbodies as $body) {
            if ($body->type->id == $type->id) {
                return $body;
            }
        }
    }