WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
класс не описан

ComparisonOperation() WC 1.0

Compare two operands using the specified operation.

Хуков нет.

Возвращает

Null. Ничего.

Использование

$ComparisonOperation = new ComparisonOperation();
// use class methods

Методы

  1. compare( $left_operand, $right_operand, $operation )

Код ComparisonOperation: woocommerce/packages/woocommerce-admin/src/RemoteInboxNotifications/ComparisonOperation.php WC 4.3.1

<?php
class ComparisonOperation {
	/**
	 * Compare two operands using the specified operation.
	 *
	 * @param object $left_operand  The left hand operand.
	 * @param object $right_operand The right hand operand.
	 * @param string $operation     The operation used to compare the operands.
	 */
	public static function compare( $left_operand, $right_operand, $operation ) {
		switch ( $operation ) {
			case '=':
				return $left_operand === $right_operand;
			case '<':
				return $left_operand < $right_operand;
			case '<=':
				return $left_operand <= $right_operand;
			case '>':
				return $left_operand > $right_operand;
			case '>=':
				return $left_operand >= $right_operand;
			case '!=':
				return $left_operand !== $right_operand;
		}

		return false;
	}
}