use Drupal\field\FieldStorageConfigInterface;
use Drupal\node\NodeInterface;
use Drupal\user\RoleInterface;
+use Drupal\user\UserInterface;
/**
* Anonymous posters cannot enter their contact information.
* content language of the current request.
*
* @return array
- * An array as expected by drupal_render().
+ * An array as expected by \Drupal\Core\Render\RendererInterface::render().
*
* @deprecated in Drupal 8.x and will be removed before Drupal 9.0.
* Use \Drupal::entityManager()->getViewBuilder('comment')->view().
* Defaults to NULL.
*
* @return array
- * An array in the format expected by drupal_render().
+ * An array in the format expected by
+ * \Drupal\Core\Render\RendererInterface::render().
*
* @deprecated in Drupal 8.x and will be removed before Drupal 9.0.
* Use \Drupal::entityManager()->getViewBuilder('comment')->viewMultiple().
*
- * @see drupal_render()
+ * @see \Drupal\Core\Render\RendererInterface::render()
*/
function comment_view_multiple($comments, $view_mode = 'full', $langcode = NULL) {
return entity_view_multiple($comments, $view_mode, $langcode);
/**
* Implements hook_user_cancel().
*/
-function comment_user_cancel($edit, $account, $method) {
+function comment_user_cancel($edit, UserInterface $account, $method) {
switch ($method) {
case 'user_cancel_block_unpublish':
$comments = entity_load_multiple_by_properties('comment', ['uid' => $account->id()]);
foreach ($comments as $comment) {
- $comment->setPublished(CommentInterface::NOT_PUBLISHED);
+ $comment->setUnpublished();
$comment->save();
}
break;
* The current state of the form.
*
* @return array
- * An array as expected by drupal_render().
+ * An array as expected by \Drupal\Core\Render\RendererInterface::render().
*/
function comment_preview(CommentInterface $comment, FormStateInterface $form_state) {
$preview_build = [];