CommissioningBodyService::getCorrespondenceName PHP Method

getCorrespondenceName() public method

Returns the appropriate name (first portion of address) for the service.
public getCorrespondenceName ( ) : array
return array
    public function getCorrespondenceName()
    {
        $cname = array($this->name);
        if ($static_type_name = $this->type->correspondence_name) {
            $cname[] = $static_type_name;
        }
        return $cname;
    }

Usage Example

 /**
  * @covers CommissioningBodyService::getCorrespondenceName()
  */
 public function testgetCorrespondenceAddress_withstatic()
 {
     $cbs_name = 'Test Name';
     $cbs_type_name = 'CBS Type Test Name';
     $cbs_type = new CommissioningBodyServiceType();
     $cbs_type->correspondence_name = $cbs_type_name;
     $cbs = new CommissioningBodyService();
     $cbs->name = $cbs_name;
     $cbs->type = $cbs_type;
     $this->assertEquals(array($cbs_name, $cbs_type_name), $cbs->getCorrespondenceName(), 'Correspondence Name should have type name appended when available in the CBS type');
 }