You are here

public function SocialAlbumController::deleteImage in Open Social 10.1.x

Same name and namespace in other branches
  1. 10.3.x modules/social_features/social_album/src/Controller/SocialAlbumController.php \Drupal\social_album\Controller\SocialAlbumController::deleteImage()
  2. 10.0.x modules/social_features/social_album/src/Controller/SocialAlbumController.php \Drupal\social_album\Controller\SocialAlbumController::deleteImage()
  3. 10.2.x modules/social_features/social_album/src/Controller/SocialAlbumController.php \Drupal\social_album\Controller\SocialAlbumController::deleteImage()

Provides a page with a form for deleting image from post and post view.

Parameters

\Drupal\node\NodeInterface $node: The node object.

\Drupal\social_post\Entity\PostInterface $post: The post entity object.

int $fid: The file entity ID.

Return value

array The renderable array.

1 string reference to 'SocialAlbumController::deleteImage'
social_album.routing.yml in modules/social_features/social_album/social_album.routing.yml
modules/social_features/social_album/social_album.routing.yml

File

modules/social_features/social_album/src/Controller/SocialAlbumController.php, line 158

Class

SocialAlbumController
Returns responses for Album routes.

Namespace

Drupal\social_album\Controller

Code

public function deleteImage(NodeInterface $node, PostInterface $post, $fid) {
  return [
    'form' => $this
      ->entityFormBuilder()
      ->getForm($post, 'delete_image', [
      'fid' => $fid,
    ]),
    'view' => $this
      ->entityTypeManager()
      ->getViewBuilder('post')
      ->view($post, 'featured'),
  ];
}