You are here

public function Submission::valueByCid in Little helpers 7.2

Same name and namespace in other branches
  1. 7 src/Webform/Submission.php \Drupal\little_helpers\Webform\Submission::valueByCid()

Get one value for a given component.

Parameters

int $cid: The component ID.

Return value

mixed The value of the component or NULL if there is no value.

1 call to Submission::valueByCid()
Submission::valuesByType in src/Webform/Submission.php
Get values for all components of a type.

File

src/Webform/Submission.php, line 124

Class

Submission
A useful wrapper for webform submission objects.

Namespace

Drupal\little_helpers\Webform

Code

public function valueByCid($cid) {
  if ($values = $this
    ->valuesByCid($cid)) {
    return reset($values);
  }
  return NULL;
}