MediaSourceFieldConstraintsInterface.php

Same filename in other branches
  1. 9 core/modules/media/src/MediaSourceFieldConstraintsInterface.php
  2. 10 core/modules/media/src/MediaSourceFieldConstraintsInterface.php
  3. 11.x core/modules/media/src/MediaSourceFieldConstraintsInterface.php

Namespace

Drupal\media

File

core/modules/media/src/MediaSourceFieldConstraintsInterface.php

View source
<?php

namespace Drupal\media;


/**
 * Defines an interface for a media source with source field constraints.
 *
 * This allows a media source to optionally add source field validation
 * constraints for media items. To add constraints at the entity level, a
 * media source can also implement MediaSourceEntityConstraintsInterface.
 *
 * @see \Drupal\media\MediaSourceInterface
 * @see \Drupal\media\MediaSourceEntityConstraintsInterface
 * @see \Drupal\media\MediaSourceBase
 * @see \Drupal\media\Entity\Media
 */
interface MediaSourceFieldConstraintsInterface extends MediaSourceInterface {
    
    /**
     * Gets media source-specific validation constraints for a source field.
     *
     * @return \Symfony\Component\Validator\Constraint[]
     *   An array of validation constraint definitions, keyed by constraint name.
     *   Each constraint definition can be used for instantiating
     *   \Symfony\Component\Validator\Constraint objects.
     */
    public function getSourceFieldConstraints();

}

Interfaces

Title Deprecated Summary
MediaSourceFieldConstraintsInterface Defines an interface for a media source with source field constraints.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.