Semantic MediaWiki and related extensions
Public Member Functions | Public Attributes | List of all members
SMW\Property\Constraint\Constraint Interface Reference
Inheritance diagram for SMW\Property\Constraint\Constraint:
Inheritance graph
[legend]

Public Member Functions

 hasViolation ()
 
 isType ( $type)
 
 checkConstraint (array $constraint, $value)
 

Public Attributes

const TYPE_INSTANT = 'type/instant'
 
const TYPE_DEFERRED = 'type/deferred'
 

Detailed Description

GNU GPL v2+

Since
3.1
Author
mwjames

Member Function Documentation

◆ checkConstraint()

SMW\Property\Constraint\Constraint::checkConstraint ( array  $constraint,
  $value 
)

Checks a constraint against a single value. Any error that occurred during the processing should be attached to an individual value using the ConstraintError class.

Since
3.1
Parameters
array$constraint
mixed$value

Implemented in SMW\Property\Constraint\Constraints\UniqueValueConstraint, SMW\Property\Constraint\Constraints\CommonConstraint, and SMW\Property\Constraint\Constraints\NullConstraint.

◆ hasViolation()

SMW\Property\Constraint\Constraint::hasViolation ( )

Returns true when a violation during the check occurred.

Since
3.1
Returns
boolean

Implemented in SMW\Property\Constraint\Constraints\UniqueValueConstraint, SMW\Property\Constraint\Constraints\CommonConstraint, and SMW\Property\Constraint\Constraints\NullConstraint.

◆ isType()

SMW\Property\Constraint\Constraint::isType (   $type)

Member Data Documentation

◆ TYPE_DEFERRED

const SMW\Property\Constraint\Constraint::TYPE_DEFERRED = 'type/deferred'

The constraint check happens after a GET request using the job queue.

◆ TYPE_INSTANT

const SMW\Property\Constraint\Constraint::TYPE_INSTANT = 'type/instant'

The constraint check happens instantaneous on a GET request (aka. online) and should be used for "light" checks that doesn't involve the QueryEngine or a rule resolver given the potential computational requirements that are required to run checks on each individual value.


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

About | General disclaimer | Privacy policy