TelephoneItem.php 780 Bytes
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
<?php

/**
 * @file
 * Contains \Drupal\telephone\Type\TelephoneItem.
 */

namespace Drupal\telephone\Type;

use Drupal\Core\Entity\Field\FieldItemBase;

/**
 * Defines the 'telephone_field' entity field items.
 */
class TelephoneItem extends FieldItemBase {

  /**
   * Definitions of the contained properties.
   *
   * @see TelephoneItem::getPropertyDefinitions()
   *
   * @var array
   */
  static $propertyDefinitions;

  /**
   * Implements ComplexDataInterface::getPropertyDefinitions().
   */
  public function getPropertyDefinitions() {
    if (!isset(static::$propertyDefinitions)) {
      static::$propertyDefinitions['value'] = array(
        'type' => 'string',
        'label' => t('Telephone number'),
      );
    }
    return static::$propertyDefinitions;
  }
}