public function CpfItem::setValue in CPF 8
Same name and namespace in other branches
- 8.2 src/Plugin/Field/FieldType/CpfItem.php \Drupal\cpf\Plugin\Field\FieldType\CpfItem::setValue()
Overrides \Drupal\Core\TypedData\TypedData::setValue().
Parameters
array|null $values: An array of property values.
Overrides FieldItemBase::setValue
File
- src/
Plugin/ Field/ FieldType/ CpfItem.php, line 161
Class
- CpfItem
- Plugin implementation of the 'cpf' field type.
Namespace
Drupal\cpf\Plugin\Field\FieldTypeCode
public function setValue($values, $notify = TRUE) {
// Remove all characters except numbers.
$values['value'] = $this->cpfService
->digits($values['value']);
parent::setValue($values, $notify);
}