public function ChangeConnectionRole::executeMultiple in RedHen CRM 8
File
- modules/
redhen_connection/ src/ Plugin/ Action/ ChangeConnectionRole.php, line 120
Class
- ChangeConnectionRole
- Change the role of a Redhen Connection.
Namespace
Drupal\redhen_connection\Plugin\ActionCode
public function executeMultiple(array $objects) {
foreach ($objects as $entity) {
$this
->execute($entity);
}
// If there are mismatched roles/connection_types provide a warning.
if ($this->mismatch) {
$mismatch_plural = "@count connections could not be updated because the selected role was not associated with the connection type.";
$mismatch_singular = "@count connection could not be updated because the selected role was not associated with the connection type.";
$message = \Drupal::translation()
->formatPlural($this->mismatch, $mismatch_singular, $mismatch_plural, [
'@count' => $this->mismatch,
]);
\Drupal::messenger()
->addWarning($message);
}
}