protected static function Consumer::setDefaultTo in Consumers 8
Gets closure that will set is_default to the selected value for an entity.
Parameters
boolean $value: The final value of the "is_default" field.
Return value
\Closure
1 call to Consumer::setDefaultTo()
- Consumer::removeDefaultConsumerFlags in src/
Entity/ Consumer.php - Removes the is_default flag from other consumers.
File
- src/
Entity/ Consumer.php, line 229
Class
- Consumer
- Defines the Consumer entity.
Namespace
Drupal\consumers\EntityCode
protected static function setDefaultTo($value) {
return function (Consumer $consumer) use ($value) {
$consumer
->set('is_default', $value);
return $consumer;
};
}