annotate core/modules/media/src/Annotation/MediaSource.php @ 0:c75dbcec494b

Initial commit from drush-created site
author Chris Cannam
date Thu, 05 Jul 2018 14:24:15 +0000
parents
children 12f9dff5fda9
rev   line source
Chris@0 1 <?php
Chris@0 2
Chris@0 3 namespace Drupal\media\Annotation;
Chris@0 4
Chris@0 5 use Drupal\Component\Annotation\Plugin;
Chris@0 6
Chris@0 7 /**
Chris@0 8 * Defines a media source plugin annotation object.
Chris@0 9 *
Chris@0 10 * Media sources are responsible for implementing all the logic for dealing
Chris@0 11 * with a particular type of media. They provide various universal and
Chris@0 12 * type-specific metadata about media of the type they handle.
Chris@0 13 *
Chris@0 14 * Plugin namespace: Plugin\media\Source
Chris@0 15 *
Chris@0 16 * For a working example, see \Drupal\media\Plugin\media\Source\File.
Chris@0 17 *
Chris@0 18 * @see \Drupal\media\MediaSourceInterface
Chris@0 19 * @see \Drupal\media\MediaSourceBase
Chris@0 20 * @see \Drupal\media\MediaSourceManager
Chris@0 21 * @see hook_media_source_info_alter()
Chris@0 22 * @see plugin_api
Chris@0 23 *
Chris@0 24 * @Annotation
Chris@0 25 */
Chris@0 26 class MediaSource extends Plugin {
Chris@0 27
Chris@0 28 /**
Chris@0 29 * The plugin ID.
Chris@0 30 *
Chris@0 31 * @var string
Chris@0 32 */
Chris@0 33 public $id;
Chris@0 34
Chris@0 35 /**
Chris@0 36 * The human-readable name of the media source.
Chris@0 37 *
Chris@0 38 * @var \Drupal\Core\Annotation\Translation
Chris@0 39 *
Chris@0 40 * @ingroup plugin_translatable
Chris@0 41 */
Chris@0 42 public $label;
Chris@0 43
Chris@0 44 /**
Chris@0 45 * A brief description of the media source.
Chris@0 46 *
Chris@0 47 * @var \Drupal\Core\Annotation\Translation
Chris@0 48 *
Chris@0 49 * @ingroup plugin_translatable
Chris@0 50 */
Chris@0 51 public $description = '';
Chris@0 52
Chris@0 53 /**
Chris@0 54 * The field types that can be used as a source field for this media source.
Chris@0 55 *
Chris@0 56 * @var string[]
Chris@0 57 */
Chris@0 58 public $allowed_field_types = [];
Chris@0 59
Chris@0 60 /**
Chris@0 61 * A filename for the default thumbnail.
Chris@0 62 *
Chris@0 63 * The thumbnails are placed in the directory defined by the config setting
Chris@0 64 * 'media.settings.icon_base_uri'. When using custom icons, make sure the
Chris@0 65 * module provides a hook_install() implementation to copy the custom icons
Chris@0 66 * to this directory. The media_install() function provides a clear example
Chris@0 67 * of how to do this.
Chris@0 68 *
Chris@0 69 * @var string
Chris@0 70 *
Chris@0 71 * @see media_install()
Chris@0 72 */
Chris@0 73 public $default_thumbnail_filename = 'generic.png';
Chris@0 74
Chris@0 75 /**
Chris@0 76 * The metadata attribute name to provide the thumbnail URI.
Chris@0 77 *
Chris@0 78 * @var string
Chris@0 79 */
Chris@0 80 public $thumbnail_uri_metadata_attribute = 'thumbnail_uri';
Chris@0 81
Chris@0 82 /**
Chris@0 83 * (optional) The metadata attribute name to provide the thumbnail alt.
Chris@0 84 *
Chris@0 85 * "Thumbnail" will be used if the attribute name is not provided.
Chris@0 86 *
Chris@0 87 * @var string|null
Chris@0 88 */
Chris@0 89 public $thumbnail_alt_metadata_attribute;
Chris@0 90
Chris@0 91 /**
Chris@0 92 * (optional) The metadata attribute name to provide the thumbnail title.
Chris@0 93 *
Chris@0 94 * The name of the media item will be used if the attribute name is not
Chris@0 95 * provided.
Chris@0 96 *
Chris@0 97 * @var string|null
Chris@0 98 */
Chris@0 99 public $thumbnail_title_metadata_attribute;
Chris@0 100
Chris@0 101 /**
Chris@0 102 * The metadata attribute name to provide the default name.
Chris@0 103 *
Chris@0 104 * @var string
Chris@0 105 */
Chris@0 106 public $default_name_metadata_attribute = 'default_name';
Chris@0 107
Chris@0 108 }