Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
1 | <?php |
2 | |
3 | namespace MediaWiki\WikispeechSpeechDataCollector\Domain; |
4 | |
5 | /** |
6 | * @file |
7 | * @ingroup Extensions |
8 | * @license GPL-2.0-or-later |
9 | */ |
10 | |
11 | /** |
12 | * Interface Persistent |
13 | * @since 0.1.0 |
14 | * |
15 | * A persistent class represents a domain object |
16 | * that can be stored and retrieved from a database. |
17 | * |
18 | * A persistent class is a pure data container. |
19 | * Any per subclass business logic should be implemented |
20 | * using the visitor pattern {@link PersistentVisitor}. |
21 | * Database access uses a CRUD-pattern {@link AbstractRdbmsCrud}. |
22 | */ |
23 | interface Persistent { |
24 | |
25 | /** @return mixed object identity */ |
26 | public function getIdentity(); |
27 | |
28 | /** |
29 | * @param mixed $identity object identity |
30 | */ |
31 | public function setIdentity( $identity ): void; |
32 | |
33 | /** |
34 | * Visitor pattern accepting function. |
35 | * https://en.wikipedia.org/wiki/Visitor_pattern |
36 | * |
37 | * Used to separate business logic from this pure data container class. |
38 | * |
39 | * @param PersistentVisitor $visitor |
40 | * @return mixed|null |
41 | */ |
42 | public function accept( PersistentVisitor $visitor ); |
43 | |
44 | public function __toString(): string; |
45 | } |