You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Libs/Entity/StateEntity.php
+83
Original file line number
Diff line number
Diff line change
@@ -13,24 +13,75 @@ final class StateEntity implements iState
13
13
{
14
14
use LoggerAwareTrait;
15
15
16
+
/**
17
+
* @var array $data Holds the original entity data.
18
+
*/
16
19
privatearray$data = [];
20
+
/**
21
+
* @var bool $tainted Flag indicating if the data is tainted based on its event type.
22
+
*/
17
23
privatebool$tainted = false;
18
24
25
+
/**
26
+
* @var string|int|null $id The corresponding database id.
27
+
*/
19
28
publicnull|string|int$id = null;
29
+
30
+
/**
31
+
* @var string $type What type of data this entity holds.
32
+
*/
20
33
publicstring$type = '';
34
+
/**
35
+
* @var int $updated When was the entity last updated.
36
+
*/
21
37
publicint$updated = 0;
38
+
39
+
/**
40
+
* @var int $watched Whether the entity is watched or not.
41
+
*/
22
42
publicint$watched = 0;
23
43
44
+
/**
45
+
* @var string $via The backend that this entity data belongs to.
46
+
*/
24
47
publicstring$via = '';
48
+
49
+
/**
50
+
* @var string $title The title of the entity usually in format of "Movie Title (Year)" if event type is movie. Or "Series Title (Year) - Season x Episode" if event type is episode.
51
+
*/
25
52
publicstring$title = '';
26
53
54
+
/**
55
+
* @var int|null $year The year of the entity.
56
+
*/
27
57
publicint|null$year = null;
58
+
/**
59
+
* @var int|null $season The season number of the episode if event type is episode.
60
+
*/
28
61
publicint|null$season = null;
62
+
/**
63
+
* @var int|null $episode The episode number of the episode event type is episode.
64
+
*/
29
65
publicint|null$episode = null;
30
66
67
+
/**
68
+
* @var array $parent The parent guids for this entity. Empty if event type is movie.
69
+
*/
31
70
publicarray$parent = [];
71
+
72
+
/**
73
+
* @var array $guids The guids for this entity. Empty if event type is episode.
74
+
*/
32
75
publicarray$guids = [];
76
+
77
+
/**
78
+
* @var array $metadata holds the metadata from various backends.
79
+
*/
33
80
publicarray$metadata = [];
81
+
82
+
/**
83
+
* @var array $extra holds the extra data from various backends.
84
+
*/
34
85
publicarray$extra = [];
35
86
36
87
publicfunction__construct(array$data)
@@ -455,6 +506,17 @@ public function getPlayProgress(): int
455
506
return$lastProgress;
456
507
}
457
508
509
+
/**
510
+
* Checks if the value of a given key in the entity object is equal to the corresponding value in the current object.
511
+
* Some keys are special and require special logic to compare. For example, the updated and watched keys are special
512
+
* because they are tied together.
513
+
*
514
+
* @param string $key The key to check in the entity object.
515
+
* @param iState $entity The entity object to compare the key value with.
516
+
*
517
+
* @return bool Returns true if the value of the key in the entity object is equal to the value in the current object,
0 commit comments