Class OrOperator
Implementierung der ODER-Regel. Es werden von den beiden Operanden jeweils die Constraint::isValid() Methode aufgerufen und das Ergebnis mit ODER verknüpft.
$operatorA = new \Alvine\Util\Constraint\Number(10, 40, true, true, 0); $operatorB = new \Alvine\Util\Constraint\Number(60, 100, true, true, 0); // Einzelprüfung $value = 66; echo $operatorA->isValid($value)?'true':'false'; // false echo $operatorB->isValid($value)?'true':'false'; // true // Oder-Operation (Wert soll entweder im BereichA oder B liegen) $or = new Alvine\Util\Constraint\OrOperator($operatorA, $operatorB); $value = 66; echo $or->isValid($value)?'true':'false'; // true $value = 22; echo $or->isValid($value)?'true':'false'; // true $value = 50; echo $or->isValid($value)?'true':'false'; // false
Der Aufruf der Regeln erfolgt rekursiv durch alle verknüpfte Constraints. Nur wenn alle Constraint true zurückgeben ist das Gesamtergebnis true
- Alvine\Core\Alvine implements Serializable uses Alvine\Core\SerializableImplementation
- Alvine\Util\Constraint
- Alvine\Util\Constraint\Operator
- Alvine\Util\Constraint\OrOperator
Namespace: Alvine\Util\Constraint
Package: Alvine\Util\Constraint
Category: Framework
License: Licence
Author: schukai GmbH info@schukai.de
Version: Release: $Revision: 173 $
Since: 20110904
Link: Alvine
Link: Constraintprogrammierung (Wikipedia)
Located at util/constraint/OrOperator.class.php
Package: Alvine\Util\Constraint
Category: Framework
License: Licence
Author: schukai GmbH info@schukai.de
Version: Release: $Revision: 173 $
Since: 20110904
Link: Alvine
Link: Constraintprogrammierung (Wikipedia)
Located at util/constraint/OrOperator.class.php
public
boolean
|
__construct()
|
__call(),
__clone(),
__get(),
__set(),
__toString(),
equals(),
getClass(),
getClone(),
getClosure(),
getHashCode(),
getID(),
getShortID(),
isCallable(),
isInstanceOf(),
propertyExists()
|
serialize(),
unserialize()
|
checkAndAdjustSerialisation(),
serialize(),
unserialize()
|
APIVERSION,
IDENTIFICATION,
SERIALVERSION,
VERSION
|
$operantA,
$operantB
|
$hash,
$properties
|