public function toScript()
    {
        $script = "(";
        $first = true;
        foreach ($this->getCriteria() as $c) {
            $script .= $first ? "" :  " {$this->getLogicalOperator()} ";
            $script .= $c->toScript();
            $first = false;
        }
        $script .= ")";
        return $script;
    }