Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
/**
* @file
* Contains \Drupal\link\Type\LinkItem.
*/
namespace Drupal\link\Type;
use Drupal\Core\Entity\Field\FieldItemBase;
/**
* Defines the 'link_field' entity field item.
*/
class LinkItem extends FieldItemBase {
/**
* Property definitions of the contained properties.
*
* @see self::getPropertyDefinitions()
*
* @var array
*/
static $propertyDefinitions;
/**
* Implements ComplexDataInterface::getPropertyDefinitions().
*/
public function getPropertyDefinitions() {
if (!isset(self::$propertyDefinitions)) {
self::$propertyDefinitions['url'] = array(
'type' => 'uri',
'label' => t('URL'),
);
self::$propertyDefinitions['title'] = array(
'type' => 'string',
'label' => t('Title'),
);
self::$propertyDefinitions['attributes'] = array(
'type' => 'map',
'label' => t('Attributes'),
);
}
return self::$propertyDefinitions;
}
}