namespace wcf\system\condition;
use wcf\data\DatabaseObject;
use wcf\data\DatabaseObjectList;
-use wcf\util\ClassUtil;
/**
* Abstract condition implementation for check a text-typed property of a database
* @see \wcf\system\condition\IObjectListCondition::addObjectListCondition()
*/
public function addObjectListCondition(DatabaseObjectList $objectList, array $conditionData) {
- if (!ClassUtil::isInstanceOf($objectList, $this->getListClassName())) return;
+ $className = $this->getListClassName();
+ if (!($objectList instanceof $className)) return;
if ($this->supportsMultipleValues) {
$objectList->getConditionBuilder()->add($objectList->getDatabaseTableAlias().'.'.$this->getPropertyName().' IN (?)', [ $conditionData[$this->fieldName] ]);
* @see \wcf\system\condition\IObjectCondition::checkObject()
*/
public function checkObject(DatabaseObject $object, array $conditionData) {
- if (!ClassUtil::isInstanceOf($object, $this->getClassName())) return;
+ $className = $this->getClassName();
+ if (!($object instanceof $className)) return;
return in_array($object->{$this->getPropertyName()}, $conditionData[$this->fieldName]);
}
use wcf\data\DatabaseObjectList;
use wcf\system\exception\UserInputException;
use wcf\system\WCF;
-use wcf\util\ClassUtil;
/**
* Condition implementation for compairing a user-bound timestamp with a fixed time
* @see \wcf\system\condition\IObjectListCondition::addObjectListCondition()
*/
public function addObjectListCondition(DatabaseObjectList $objectList, array $conditionData) {
- if (!ClassUtil::isInstanceOf($objectList, $this->getListClassName())) return;
+ $className = $this->getListClassName();
+ if (!($objectList instanceof $className)) return;
$objectList->getConditionBuilder()->add($objectList->getDatabaseTableAlias().'.'.$this->getPropertyName().' <> ?', [ 0 ]);
if (isset($conditionData['endTime'])) {
* @see \wcf\system\condition\IObjectCondition::checkObject()
*/
public function checkObject(DatabaseObject $object, array $conditionData) {
- if (!ClassUtil::isInstanceOf($object, $this->getClassName())) return;
+ $className = $this->getClassName();
+ if (!($object instanceof $className)) return;
if (isset($conditionData['startTime']) && $object->{$this->getPropertyName()} < strtotime($conditionData['startTime'])) {
return false;