/** * @param SelectStatement|Subselect $AST * @param AclConditionStorage|SubRequestAclConditionStorage $aclCondition */ protected function addRequestConditions($AST, $aclCondition) { $whereConditions = $aclCondition->getWhereConditions(); if (count($whereConditions)) { $this->addAclToWhereClause($AST, $whereConditions); } $joinConditions = $aclCondition->getJoinConditions(); if (count($joinConditions)) { $this->addAclToJoinClause($AST, $joinConditions); } }
public function testSubRequestAclConditionStorage() { $storage = new SubRequestAclConditionStorage([new AclCondition('test', 'id', [2])], [new JoinAclCondition('testClass', 'owner', [1])]); $this->assertFalse($storage->isEmpty()); $storage->setFactorId(1); $this->assertEquals(1, $storage->getFactorId()); $storage->setWhereConditions([]); $this->assertFalse($storage->isEmpty()); $storage->setJoinConditions([]); $this->assertTrue($storage->isEmpty()); }