public static function attachEmailGroups($researchId, $groups)
{
$research = \Entity\Research::findOne($researchId);
$type = \Entity\Research::findOneBy([ 'type' => $research->getType() ]);
$research->setIdEmailGroups($groups);
print_r($research);die();
if ($research->save()) {
return true;
} else {
throw new Exception(json_encode($research->getErrors()));
return false;
}
}