enumLogicalOperator
enum LogicalOperator: string
Public API: explicitly declared with
@visibility public.The binary logical operators of MySQL.
&& is a synonym of AND and, unless PIPES_AS_CONCAT is set, || is a synonym of OR; both are written in their keyword form. Each case holds the keyword. Source: https://dev.mysql.com/doc/refman/8.4/en/logical-operators.html.
$query = (new \SqlSemantics\Platform\MySql\Semantics())->analyze('SELECT a FROM t WHERE a || b');
$query->statement->where->operator // => \SqlSemantics\Platform\MySql\Statement\Expression\LogicalOperator::OrCases§
case Or = 'OR'case Xor = 'XOR'case And = 'AND'Methods§
public function level(): intAnswers the binding level of the operator on the scale of MYSQL-PRECEDENCE-001.
Returns
intCalled from 2
- method-call SqlSemantics\Platform\MySql\Statement\Expression\Logical::__construct() packages/sql-semantics-mysql/src/Statement/Expression/Logical.php:50
- method-call SqlSemantics\Platform\MySql\Statement\Expression\Logical::__construct() packages/sql-semantics-mysql/src/Statement/Expression/Logical.php:51
Calls 6
- class-const LogicalOperator::Or() line 34
- class-const Precedence::DISJUNCTION() line 34
- class-const LogicalOperator::Xor() line 35
- class-const Precedence::EXCLUSION() line 35
- class-const LogicalOperator::And() line 36
- class-const Precedence::CONJUNCTION() line 36
Test cases 10§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 2
Other tests reaching this symbol 8
ConditionRuleTest::testExpressionBuildsTheLeftAssociationOfAChaincallsGroupedTest::testRenderLetsAWeakerOperandStandOnTheRightcallsLogicalTest::testAnEqualRightOperandIsRejectedcallsLogicalTest::testAWeakerLeftOperandIsRejectedcallsLogicalTest::testDeriveScalarIsAnIntegerThatIsNullWhenAnOperandIscallsLogicalTest::testRenderWritesTheKeywordAndKeepsTheLeftAssociationcallsNotTest::testAConjunctionOperandIsRejectedcallsIntervalAdditionTest::testAConjunctionOperandIsRejectedcalls
Relations§
Method calls 2
- method-call SqlSemantics\Platform\MySql\Statement\Expression\Logical::__construct() packages/sql-semantics-mysql/src/Statement/Expression/Logical.php:50
- method-call SqlSemantics\Platform\MySql\Statement\Expression\Logical::__construct() packages/sql-semantics-mysql/src/Statement/Expression/Logical.php:51
Constant reads 3
- class-const SqlSemantics\Platform\MySql\Lowering\Expression\ConditionRule packages/sql-semantics-mysql/src/Lowering/Expression/ConditionRule.php:45
- class-const SqlSemantics\Platform\MySql\Lowering\Expression\ConditionRule packages/sql-semantics-mysql/src/Lowering/Expression/ConditionRule.php:45
- class-const SqlSemantics\Platform\MySql\Lowering\Expression\ConditionRule packages/sql-semantics-mysql/src/Lowering/Expression/ConditionRule.php:45