Version 1
[yaffs-website] / web / modules / contrib / fontyourface / modules / local_fonts / src / Entity / LocalFontConfigEntity.php
1 <?php
2
3 namespace Drupal\local_fonts\Entity;
4
5 use Drupal\Core\Config\Entity\ConfigEntityBase;
6
7 /**
8  * Defines the Custom Font entity.
9  *
10  * @ConfigEntityType(
11  *   id = "local_font_config_entity",
12  *   label = @Translation("Custom Font"),
13  *   handlers = {
14  *     "list_builder" = "Drupal\local_fonts\LocalFontConfigEntityListBuilder",
15  *     "form" = {
16  *       "add" = "Drupal\local_fonts\Form\LocalFontConfigEntityForm",
17  *       "edit" = "Drupal\local_fonts\Form\LocalFontConfigEntityForm",
18  *       "delete" = "Drupal\local_fonts\Form\LocalFontConfigEntityDeleteForm"
19  *     },
20  *     "route_provider" = {
21  *       "html" = "Drupal\local_fonts\LocalFontConfigEntityHtmlRouteProvider",
22  *     },
23  *   },
24  *   config_prefix = "local_font_config_entity",
25  *   admin_permission = "administer font entities",
26  *   entity_keys = {
27  *     "id" = "id",
28  *     "label" = "label",
29  *     "uuid" = "uuid",
30  *     "font_family" = "font_family"
31  *   },
32  *   links = {
33  *     "canonical" = "/admin/appearance/font/local_font_config_entity/{local_font_config_entity}",
34  *     "add-form" = "/admin/appearance/font/local_font_config_entity/add",
35  *     "edit-form" = "/admin/appearance/font/local_font_config_entity/{local_font_config_entity}/edit",
36  *     "delete-form" = "/admin/appearance/font/local_font_config_entity/{local_font_config_entity}/delete",
37  *     "collection" = "/admin/appearance/font/local_font_config_entity"
38  *   }
39  * )
40  */
41 class LocalFontConfigEntity extends ConfigEntityBase implements LocalFontConfigEntityInterface {
42
43   /**
44    * The Custom Font ID.
45    *
46    * @var string
47    */
48   protected $id;
49
50   /**
51    * The Custom Font label.
52    *
53    * @var string
54    */
55   protected $label;
56
57   /**
58    * {@inheritdoc}
59    */
60   public function getFontWoffData() {
61     return $this->get('font_woff_data');
62   }
63
64   /**
65    * {@inheritdoc}
66    */
67   public function setFontWoffData($data) {
68     $this->set('font_woff_data', $data);
69     return $this;
70   }
71
72 }