| Total Complexity | 5 |
| Total Lines | 51 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 14 | class PageBlockBlockQuote extends PageBlock |
||
| 15 | { |
||
| 16 | public const TYPE_NAME = 'pageBlockBlockQuote'; |
||
| 17 | |||
| 18 | /** |
||
| 19 | * Quote text. |
||
| 20 | * |
||
| 21 | * @var RichText |
||
| 22 | */ |
||
| 23 | protected RichText $text; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Quote credit. |
||
| 27 | * |
||
| 28 | * @var RichText |
||
| 29 | */ |
||
| 30 | protected RichText $credit; |
||
| 31 | |||
| 32 | public function __construct(RichText $text, RichText $credit) |
||
| 33 | { |
||
| 34 | parent::__construct(); |
||
| 35 | |||
| 36 | $this->text = $text; |
||
| 37 | $this->credit = $credit; |
||
| 38 | } |
||
| 39 | |||
| 40 | public static function fromArray(array $array): PageBlockBlockQuote |
||
| 41 | { |
||
| 42 | return new static( |
||
| 43 | TdSchemaRegistry::fromArray($array['text']), |
||
| 44 | TdSchemaRegistry::fromArray($array['credit']), |
||
| 45 | ); |
||
| 46 | } |
||
| 47 | |||
| 48 | public function typeSerialize(): array |
||
| 49 | { |
||
| 50 | return [ |
||
| 51 | '@type' => static::TYPE_NAME, |
||
| 52 | 'text' => $this->text->typeSerialize(), |
||
| 53 | 'credit' => $this->credit->typeSerialize(), |
||
| 54 | ]; |
||
| 55 | } |
||
| 56 | |||
| 57 | public function getText(): RichText |
||
| 58 | { |
||
| 59 | return $this->text; |
||
| 60 | } |
||
| 61 | |||
| 62 | public function getCredit(): RichText |
||
| 65 | } |
||
| 66 | } |
||
| 67 |