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