1 | <?php |
||
15 | class SMWDIBoolean extends SMWDataItem { |
||
|
|||
16 | |||
17 | /** |
||
18 | * Internal value. |
||
19 | * @var bool |
||
20 | */ |
||
21 | protected $m_boolean; |
||
22 | |||
23 | 14 | public function __construct( $boolean ) { |
|
24 | 14 | if ( !is_bool( $boolean ) ) { |
|
25 | throw new DataItemException( "Initialization value '$boolean' is not a boolean." ); |
||
26 | } |
||
27 | |||
28 | 14 | $this->m_boolean = ( $boolean == true ); |
|
29 | 14 | } |
|
30 | |||
31 | 12 | public function getDIType() { |
|
34 | |||
35 | 12 | public function getBoolean() { |
|
38 | |||
39 | 12 | public function getSerialization() { |
|
42 | |||
43 | 1 | public function getSortKey() { |
|
46 | |||
47 | /** |
||
48 | * Create a data item from the provided serialization string and type |
||
49 | * ID. |
||
50 | * @return SMWDIBoolean |
||
51 | */ |
||
52 | 2 | public static function doUnserialize( $serialization ) { |
|
61 | |||
62 | 4 | public function equals( SMWDataItem $di ) { |
|
68 | } |
||
69 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.