Semantic MediaWiki and related extensions
Public Member Functions | Public Attributes | List of all members
SMW\Schema\Rule Class Reference
Inheritance diagram for SMW\Schema\Rule:
Inheritance graph
[legend]
Collaboration diagram for SMW\Schema\Rule:
Collaboration graph
[legend]

Public Member Functions

 incrFilterScore ()
 
 if (string $key, $default=null)
 
 then (string $key, $default=null)
 
- Public Member Functions inherited from SMW\Schema\Compartment
 __construct (array $data=[])
 
 isEmpty ()
 
 has ( $key)
 
 get ( $key, $default=null)
 
 jsonSerialize ()
 
 __toString ()
 
 getFingerprint ()
 
 getIterator ()
 

Public Attributes

 $filterScore = 0
 
- Public Attributes inherited from SMW\Schema\Compartment
const ASSOCIATED_SCHEMA = '___assoc_schema'
 
const ASSOCIATED_SECTION = '___assoc_section'
 

Additional Inherited Members

- Protected Attributes inherited from SMW\Schema\Compartment
 $data = []
 

Detailed Description

GNU GPL v2+

Since
3.2
Author
mwjames

Member Function Documentation

◆ if()

SMW\Schema\Rule::if ( string  $key,
  $default = null 
)
Since
3.2
Parameters
string$key
Returns
mixed

◆ incrFilterScore()

SMW\Schema\Rule::incrFilterScore ( )

When using a chained filter, the score allows to find the best filter rule by comparing the score on the matched filter condition.

For example, if an entity is annotated with [[Category:Lorem ipsum]] both rules would apply but when the entity is part of the SMW_NS_PROPERTY namespace, the second filter rule would get a higher score as its matches both the category and namespace filter.

"if": {
"category": "Lorem ipsum"
}

vs.

"if": {
"namespace": "SMW_NS_PROPERTY",
"category": "Lorem ipsum"
}
Since
3.2

◆ then()

SMW\Schema\Rule::then ( string  $key,
  $default = null 
)
Since
3.2
Parameters
string$key
Returns
mixed

The documentation for this class was generated from the following file:

About | General disclaimer | Privacy policy