FileSelection.php

Contains \Drupal\file\Plugin\Type\selection\FileSelection.

Namespace

Drupal\file\Plugin\entity_reference\selection

File

drupal/core/modules/file/lib/Drupal/file/Plugin/entity_reference/selection/FileSelection.php
View source
<?php

/**
 * @file
 * Contains \Drupal\file\Plugin\Type\selection\FileSelection.
 */
namespace Drupal\file\Plugin\entity_reference\selection;

use Drupal\Component\Annotation\Plugin;
use Drupal\Core\Annotation\Translation;
use Drupal\Core\Database\Query\SelectInterface;
use Drupal\entity_reference\Plugin\entity_reference\selection\SelectionBase;

/**
 * Provides specific access control for the file entity type.
 *
 * @Plugin(
 *   id = "file_default",
 *   module = "file",
 *   label = @Translation("File selection"),
 *   entity_types = {"file"},
 *   group = "default",
 *   weight = 1
 * )
 */
class FileSelection extends SelectionBase {

  /**
   * Overrides SelectionBase::buildEntityQuery().
   */
  public function buildEntityQuery($match = NULL, $match_operator = 'CONTAINS') {
    $query = parent::buildEntityQuery($match, $match_operator);
    $query
      ->condition('status', FILE_STATUS_PERMANENT);
  }

}

Classes

Namesort descending Description
FileSelection Provides specific access control for the file entity type.