Skip to content

Instantly share code, notes, and snippets.

@dantleech
Forked from anonymous/gist:6452479
Last active December 22, 2015 09:29
Show Gist options
  • Save dantleech/6452511 to your computer and use it in GitHub Desktop.
Save dantleech/6452511 to your computer and use it in GitHub Desktop.

Method by method

n/c = no change

In general I think I (and maybe lukas) agreed with dbu about talking about properties instead of fields as I think this consistent with mapping.

  • addJoinInner(): n/c
  • addJoinLeftOuter(): n/c
  • addJoinRightOuter(): n/c
  • addOrderBy(): n/c
  • addSelect(): n/c
  • andWhere(): n/c
  • andX(): n/c
  • ascending(): ->orderBy()->asc()
  • bindVariable($name): ->setParameter - same as with Doctrine ORM
  • childDocument($selectorName, $parentPath): ->where()->child($selectorName, $ancestorPath) ?
  • descendantDocument($selectorName, $ancestorPath): ->where()->decendant($selectorName, $ancestorPath) ?
  • descending(): ->orderBy()->desc()
  • document($documentFqn, $selectorName): n/c (->from()->document('Foobar', 'a'))
  • documentLocalName($selectorName): docLocalName($selectorName) ? localName ?
  • documentName($selectorName): docName ? name ?
  • eq(): n/c
  • from(): n/c
  • fullTextSearchScore($selectorName): n/c
  • fullTextSearch($selectorName, $propertyName, $fullTextSearchExpression): n/c
  • gt(): n/c
  • gte(): n/c
  • joinInner(): n/c
  • joinLeftOuter(): n/c
  • joinRightOuter(): n/c
  • length($selectorName, $propertyName):
  • like(): n/c
  • literal($value):
  • lowerCase(): n/c
  • lt(): n/c
  • lte(): n/c
  • neq(): n/c
  • not(): n/c
  • orderBy(): n/c
  • orWhere(): n/
  • orX(): n/c
  • propertyExists($selectorName, $propertyName): propExist ?
  • property($selectorName, $propertyName): ->select()->prop() ?
  • propertyValue($selectorName, $propertyName): eq()->prop ? propValue ? field ? (generally I think we might change this to field)
  • sameDocument($selectorName, $path): sameDoc ? same ?
  • select(): n/c
  • upperCase(): n/c
  • where(): n/c

With abbreviation

        $this->node
            ->select()
                ->prop('foobar', 'a') // instead of property()
                ->prop('barfoo', 'a')
            ->end()
            ->addSelect()
                ->prop('foobar', 'a')
                ->prop('barfoo', 'a')
            ->end()
            ->from()
                ->joinInner()
                    ->left()->doc('foobar', 'a')->end()
                    ->right()->doc('barfoo', 'b')->end()
                    ->condition()->equi('prop_1', 'a', 'prop_2', 'b')->end()
                ->end()
            ->end()
            ->fromDoc('foobar', 'a')
            ->addJoinInner()
                ->right()->document('foobar', 'a')->end()
                ->condition()->equi('prop_1', 'a', 'prop_2', 'b')->end()
            ->end()
            ->addJoinLeftOuter()
                ->right()->doc('foobar', 'a')->end()
                ->condition()->equi('prop_1', 'a', 'prop_2', 'b')->end()
            ->end()
            ->addJoinRightOuter()
                ->right()->doc('foobar', 'a')->end() // instead of document()
                ->condition()->equi('prop_1', 'a', 'prop_2', 'b')->end()
            ->end()
            ->where()
                ->andX()
                    ->eq()
                        ->propVal('foobar', 'a') // instead of propertyValue() or even just prop() ?
                        ->literal('foo_value')
                    ->end()
                    ->like()
                        ->name('my_doc')
                        ->bindParameter('my_var') // instead of bindVariable
                    ->end()
                ->end()
            ->end()
            ->andWhere()
                ->propExists('sel_1', 'foobar') // instead of propertyExists
            ->end()
            ->orWhere()
                ->propExists('sel_1', 'foobar')
            ->end()
            ->orderBy()
                ->asc()->docName('a')->end() // instead of ascending()->documentName
                ->desc()->docName('b')->end() // instead of descending()->documentName
            ->end()
            ->addOrderBy()
                ->asc()->docName('c')->end()
            ->end();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment