X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=Civi%2FToken%2FTokenRow.php;h=5287219a9401ed6045b790bc2d597c790140202a;hb=fd9172a486c207bdcaec658dfbc07fca0b52002f;hp=883e29089a2ebf1360efd9bdf15c2760ce640219;hpb=b5e184a67100a7c1ce756b51bcf295a68ab5df13;p=civicrm-core.git diff --git a/Civi/Token/TokenRow.php b/Civi/Token/TokenRow.php index 883e29089a..5287219a94 100644 --- a/Civi/Token/TokenRow.php +++ b/Civi/Token/TokenRow.php @@ -65,7 +65,8 @@ class TokenRow { public function __construct(TokenProcessor $tokenProcessor, $key) { $this->tokenProcessor = $tokenProcessor; $this->tokenRow = $key; - $this->format('text/plain'); // Set a default. + // Set a default. + $this->format('text/plain'); $this->context = new TokenRowContext($tokenProcessor, $key); } @@ -138,7 +139,7 @@ class TokenRow { $customFieldName = "custom_" . $customFieldID; $record = civicrm_api3($entity, "getSingle", [ 'return' => $customFieldName, - 'id' => $entityID, + 'id' => $entityID, ]); $fieldValue = \CRM_Utils_Array::value($customFieldName, $record, ''); @@ -205,10 +206,10 @@ class TokenRow { } if (!isset($this->tokenProcessor->rowValues[$this->tokenRow]['text/html'])) { - $this->tokenProcessor->rowValues[$this->tokenRow]['text/html'] = array(); + $this->tokenProcessor->rowValues[$this->tokenRow]['text/html'] = []; } if (!isset($this->tokenProcessor->rowValues[$this->tokenRow]['text/plain'])) { - $this->tokenProcessor->rowValues[$this->tokenRow]['text/plain'] = array(); + $this->tokenProcessor->rowValues[$this->tokenRow]['text/plain'] = []; } $htmlTokens = &$this->tokenProcessor->rowValues[$this->tokenRow]['text/html']; @@ -218,7 +219,7 @@ class TokenRow { case 'text/html': // Plain => HTML. foreach ($textTokens as $entity => $values) { - $entityFields = civicrm_api3($entity, "getFields", array('api_action' => 'get')); + $entityFields = civicrm_api3($entity, "getFields", ['api_action' => 'get']); foreach ($values as $field => $value) { if (!isset($htmlTokens[$entity][$field])) { // CRM-18420 - Activity Details Field are enclosed within

, @@ -305,8 +306,7 @@ class TokenRowContext implements \ArrayAccess, \IteratorAggregate, \Countable { * @return bool */ public function offsetExists($offset) { - return - isset($this->tokenProcessor->rowContexts[$this->tokenRow][$offset]) + return isset($this->tokenProcessor->rowContexts[$this->tokenRow][$offset]) || isset($this->tokenProcessor->context[$offset]); }