/** * Creates a syntax tree for an arry or an epObject * @param array|epObject &$v * @param string $prefix * @return false|epQueryNode */ protected function &_createSyntaxNodes(&$v, $prefix) { $nodes = array(); // create expression for primitve vars from array or object if (!($exprs = $this->_getPrimitiveExprs($v, $prefix))) { return $nodes; } // create comparison '=' nodes foreach ($exprs as $path => $value) { // insert path into tree if (!$this->pm->insertPath($path)) { // should not happen continue; } // create a comparison node if (!($node = new epQueryNode(EPQ_N_EXPR_COMPARISON))) { // should not happen continue; } // set operator '=' $node->setParam('op', '='); // create left hand side variable if (!($left = new epQueryNode(EPQ_N_VARIABLE))) { // should not happen continue; } // set param path $left->setParam('path', $path); // add left hand side $node->addChild($left, 'left'); // create right hand side value if (!($right = new epQueryNode(EPQ_N_STRING))) { // should not happen continue; } $right->setParam('val', $value); // add left hand side $node->addChild($right, 'right'); // collect node $nodes[] = $node; } return $nodes; }