-
-
Notifications
You must be signed in to change notification settings - Fork 26
/
Badge.php
43 lines (36 loc) · 1.08 KB
/
Badge.php
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
<?php
/*
* © Copyright 2022 · Willem Vervuurt, Studio Delfuego
*
* You can modify, use and distribute this package under one of two licenses:
* 1. GNU AGPLv3
* 2. A perpetual, non-revocable and 100% free (as in beer) do-what-you-want
* license that allows both non-commercial and commercial use, under conditions.
* See LICENSE.md for details.
*
* (it boils down to: do what you want as long as you're building and/or
* using calendar views, but don't embed this package or a modified version
* of it in free or paid-for software libraries and packages aimed at developers).
*/
namespace Wdelfuego\NovaCalendar;
class Badge
{
public $badge = '';
public $tooltip = null;
public function __construct(string $badge, string $tooltip = null)
{
$this->badge = $badge;
$this->tooltip = $tooltip;
}
public function toArray() : array
{
return [
'badge' => $this->badge,
'tooltip' => $this->tooltip
];
}
public function __toString()
{
return $this->badge;
}
}