/**
  * Chain all nodes into an AND expression
  * @param array $nodes
  * @return epQueryNode
  */
 private function _andNodes($nodes)
 {
     // if nodes array empty
     if (!$nodes) {
         // simply return it back
         return $nodes;
     }
     // if only one node
     if (1 == count($nodes)) {
         // simply return it back
         return $nodes[0];
     }
     // get the first node
     $node_last = array_pop($nodes);
     // consume nodes in array one by one
     while ($node = array_pop($nodes)) {
         // create an AND node
         $and_node = new epQueryNode(EPQ_N_EXPR_LOGIC);
         $and_node->setParam('op', 'AND');
         // add last node and this node as children
         $and_node->addChildren(array($node_last, $node));
         $node_last = $and_node;
     }
     return $node_last;
 }