Skip to content

Instantly share code, notes, and snippets.

@armetiz
Created March 28, 2013 15:13
Show Gist options
  • Save armetiz/5263936 to your computer and use it in GitHub Desktop.
Save armetiz/5263936 to your computer and use it in GitHub Desktop.
ConnectionBundle - QueryBuilder draft
$queryBuilder = $connectionManager->getQueryBuilder();
$destinationConstraints = $queryBuilder->getDestinationConstraints();
$destinationConstraints->getPropertyConstraints()->property('createdAt', QueryBuilderContrainst::greaterThan('23-03-2013'));
$destinationConstraints->getPropertyConstraints()->property('enabled', QueryBuilderContrainst::equals('23-03-2013'));
$destinationConstraints->setType(array('Acme\Models\User', 'Acme\Models\Book'));
$sourceConstraints = $queryBuilder->getSourceContraints();
$sourceConstraints->getPropertyConstraints()->property('createdAt', QueryBuilderContrainst::greaterThan('23-03-2013'));
$connectionConstraints = $queryBuilder->getConnectionConstraints();
$connectionConstraints->typeConnection(array('like', 'follow'));
$connectionConstraints->getPropertyContraints()->property('scoring', QueryBuilderConstraints::greaterThan(12));
$connectionConstraints->getPropertyContraints()->property('createdAt', QueryBuilderConstraints::greaterThan('23-03-2013'));
$queryBuilder->countConnections();
$queryBuilder->getConnections();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment