BakingArticle.php 500 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
<?php

namespace Drupal\typed_entity_example\WrappedEntities;

/**
 * The wrapped entity for the article content type tagged with Baking.
 */
final class BakingArticle extends Article {

e0ipso's avatar
e0ipso committed
10
11
12
13
14
15
16
17
  /**
   * An example method that is specific for articles about baking.
   *
   * This is not useful at all, but used only as an example.
   *
   * @return string
   *   Either yeast or baking soda.
   */
18
19
20
21
22
  public function yeastOrBakingSoda(): string {
    return mt_rand(0, 1) ? 'yeast' : 'baking soda';
  }

}