Jackalope\Query\QOM\QueryObjectModelFactory::notConstraint PHP Метод

notConstraint() публичный Метод

{@inheritDoc}
public notConstraint ( PHPCR\Query\QOM\ConstraintInterface $constraint )
$constraint PHPCR\Query\QOM\ConstraintInterface
    public function notConstraint(ConstraintInterface $constraint)
    {
        return new NotConstraint($constraint);
    }

Usage Example

 public function testQueryWithNotConstraint()
 {
     $this->nodeTypeManager->expects($this->once())->method('getSubtypes')->will($this->returnValue(array()));
     $query = $this->factory->createQuery($this->factory->selector('nt:unstructured', 'nt:unstructured'), $this->factory->notConstraint($this->factory->comparison($this->factory->propertyValue('nt:unstructured', 'jcr:path'), '=', $this->factory->literal('/'))), array(), array());
     list($selectors, $selectorAliases, $sql) = $this->walker->walkQOMQuery($query);
     $this->assertEquals(sprintf("SELECT %s FROM phpcr_nodes n0 WHERE n0.workspace_name = ? AND n0.type IN ('nt:unstructured') AND NOT (n0.path = '/')", $this->defaultColumns), $sql);
 }