lineLimit() public static method

public static lineLimit ( $string, integer $line_count, integer $protect, string $delimiter = " ", string $joiner = ', ' ) : string
$string
$line_count integer
$protect integer
$delimiter string
$joiner string
return string $result
Beispiel #1
0
 /**
  * Element based name and value pair.
  *
  * @param \Event $event
  * @return array
  */
 protected function getStructuredDataForPrintPDF($event)
 {
     $data = array();
     $elements_array = array('Clinical', 'Clerical', 'ConsentSignature', 'Demographics');
     foreach ($elements_array as $el_name) {
         $element = $this->{"get{$el_name}ElementForEvent"}($event);
         if (method_exists($element, 'getStructuredDataForPrint')) {
             $data = array_merge($data, $element->getStructuredDataForPrint());
         }
     }
     $address = \Institution::model()->getCurrent()->getLetterAddress(array('include_name' => false, 'delimiter' => '\\n'));
     $data['hospitalAddress'] = \Helper::lineLimit($address, 2, 1, '\\n');
     $data['hospitalAddressMultiline'] = \Helper::lineLimit($address, 4, 1, '\\n');
     $data['hospitalNumber'] = $event->episode->patient->hos_num;
     return $data;
 }
 /**
  * Return the element data
  * @return array
  */
 public function getStructuredDataForPrint()
 {
     $data = array('patientName' => $this->title_surname, 'otherNames' => $this->other_names, 'patientDateOfBirth' => $this->date_of_birth, 'nhsNumber' => $this->nhs_number, 'gender' => $this->gender->name, 'patientAddress' => \Helper::lineLimit($this->address, 1), 'patientEmail' => $this->email, 'patientTel' => $this->telephone, 'gpName' => $this->gp_name, 'gpAddress' => \Helper::lineLimit($this->gp_address, 1), 'gpTel' => $this->gp_telephone, 'localAuthorityName' => $this->la_name, 'localAuthorityAddress' => \Helper::lineLimit($this->la_address, 1), 'localAuthorityTel' => $this->la_telephone);
     if ($group = $this->ethnic_group) {
         $data['ethnicGroup' . $group->code] = 'X';
     }
     $data['signatureName'] = $this->getCompleteName();
     $data['demographicSummaryTable'] = $this->generateStructuredSummaryTable();
     return $data;
 }