Evaluate a script and retunr its result.

@param  string  $script
@param  int  $numberOfKeys
@param  dynamic  $arguments
@return mixed
344638
public function eval($script, $numberOfKeys, ...$arguments)
    {
        return $this->client->eval($script, $arguments, $numberOfKeys);
    }
657104
protected function addRetrieveByPK_MultiPK(&$script)
    {
        $table = $this->getTable();
        $script .= "
    /**
     * Retrieve object using using composite pkey values.";
        foreach ($table->getPrimaryKey() as $col) {
            $clo = strtolower($col->getName());
            $cptype = $col->getPhpType();
            $script .= "
     * @param   $cptype $" . $clo;
        }
        $script .= "
     * @param      PropelPDO \$con
     * @return " . $this->getObjectClassname() . "
     */
    public static function " . $this->getRetrieveMethodName() . "(";

        $php = array();
        foreach ($table->getPrimaryKey() as $col) {
            $clo = strtolower($col->getName());
            $php[] = '$' . $clo;
        } /* foreach */

        $script .= implode(', ', $php);

        $script .= ", PropelPDO \$con = null) {
        \$_instancePoolKey = " . $this->getInstancePoolKeySnippet($php) . ";";
        $script .= "
         if (null !== (\$obj = " . $this->getPeerClassname() . "::getInstanceFromPool(\$_instancePoolKey))) {
             return \$obj;
        }

        if (\$con === null) {
            \$con = Propel::getConnection(" . $this->getPeerClassname() . "::DATABASE_NAME, Propel::CONNECTION_READ);
        }
        \$criteria = new Criteria(" . $this->getPeerClassname() . "::DATABASE_NAME);";
        foreach ($table->getPrimaryKey() as $col) {
            $clo = strtolower($col->getName());
            $script .= "
        \$criteria->add(" . $this->getColumnConstant($col) . ", $" . $clo . ");";
        }
        $script .= "
        \$v = " . $this->getPeerClassname() . "::doSelect(\$criteria, \$con);

        return !empty(\$v) ? \$v[0] : null;
    }";
    }
552311
public static function run($script, $openTag, $closeChar, $phpFunc, $phpClose)
    {
        return self::open($script, $openTag, $closeChar, $phpFunc, $phpClose);
    }
627036
protected function addFKMutator(&$script, ForeignKey $fk)
    {
        $table = $this->getTable();
        $fkTable = $fk->getForeignTable();

        if ($interface = $fk->getInterface()) {
            $className = $this->declareClass($interface);
        } else {
            $className = $this->getClassNameFromTable($fkTable);
        }

        $varName = $this->getFKVarName($fk);

        $script .= "
    /**
     * Declares an association between this object and a $className object.
     *
     * @param  $className \$v
     * @return \$this|".$this->getObjectClassName(true)." The current object (for fluent API support)
     * @throws PropelException
     */
    public function set".$this->getFKPhpNameAffix($fk, false)."($className \$v = null)
    {";

        foreach ($fk->getMapping() as $map) {
            list($column, $rightValueOrColumn) = $map;

            if ($rightValueOrColumn instanceof Column) {
                $script .= "
        if (\$v === null) {
            \$this->set" . $column->getPhpName() . "(" . $this->getDefaultValueString($column) . ");
        } else {
            \$this->set" . $column->getPhpName() . "(\$v->get" . $rightValueOrColumn->getPhpName() . "());
        }
";
            } else {
                $val = var_export($rightValueOrColumn, true);
                $script .= "
        if (\$v === null) {
            \$this->set" . $column->getPhpName() . "(null);
        } else {
            \$this->set" . $column->getPhpName() . "($val);
        }
                ";
            }

        } /* foreach local col */

        $script .= "
        \$this->$varName = \$v;
";

        // Now add bi-directional relationship binding, taking into account whether this is
        // a one-to-one relationship.

        if ($fk->isLocalPrimaryKey()) {
            $script .= "
        // Add binding for other direction of this 1:1 relationship.
        if (\$v !== null) {
            \$v->set".$this->getRefFKPhpNameAffix($fk, false)."(\$this);
        }
";
        } else {
            $script .= "
        // Add binding for other direction of this n:n relationship.
        // If this object has already been added to the $className object, it will not be re-added.
        if (\$v !== null) {
            \$v->add".$this->getRefFKPhpNameAffix($fk, false)."(\$this);
        }
";

        }

        $script .= "

        return \$this;
    }
";
    }
316004
public function addScript($script = array())
	{
		foreach ($script as $file => $options)
		{
			$this->scripts = array_add($this->scripts, $file, $options);
		}
	}
617440
public function script($scripts)
    {
        return collect((array) $scripts)->map(function ($script) {
            return $this->driver->executeScript($script);
        })->all();
    }
1065577
public function evaluate($method, $arguments = array())
    {
        $callable = $this->mapper->getCallable($method);
        $arguments = $this->mapper->getArguments($callable, $arguments);

        return $this->execute($callable, $arguments);
    }
477597
public static Object eval(String script, ScriptContext context) throws ScriptRuntimeException {
		try {
			return compile(script).eval(context);
		} catch (ScriptException e) {
			throw new ScriptRuntimeException(e);
		}
	}
8978
def evaluate(self, script):
        
        if WEBENGINE:
            return self.dom.runJavaScript("{}".format(script))
        else:
            return self.dom.evaluateJavaScript("{}".format(script))
479878
public function handle(string $method, array $arguments)
    {
        /**
         * @var Context $arguments[0]
         */
        try {
            if ($this->isRandom) {
                return $this->random($method, $arguments);
            }

            if ($method === 'evalMock') {
                return $this->evalMock($arguments);
            } else {
                $key = $arguments[1];
                //单key操作
                if (!is_array($key)) {
                    return $this->single($method, $key, $arguments);
                    // 批量操作
                } else {
                    return $this->multi($method, $key, $arguments);
                }
            }
        } catch (\Exception $e) {
            return false;
        }
    }
582276
def eval_script(self, expr):
    
    ret = self.conn.issue_command("Evaluate", expr)
    return json.loads("[%s]" % ret)[0]
775971
public function evaluate(FlowQuery $flowQuery, array $arguments)
    {
        $context = $flowQuery->getContext();
        if (count($context) > 0) {
            $flowQuery->setContext([end($context)]);
        } else {
            $flowQuery->setContext([]);
        }
    }
1056580
public Object eval(String script) {
//        // use Java's ScriptEngine at the moment
//        ScriptEngineManager manager = new ScriptEngineManager();
//        ScriptEngine jsEngine = manager.getEngineByName("JavaScript");
//        try {
//            return jsEngine.eval(script);
//        } catch (ScriptException e) {
//            throw new RuntimeException(e);
//        }
        return eval(script, Collections.<String, Object>emptyMap());
    }
1292579
public function evaluate ($script, $args, $quantity) {
        return $this->getHandler($this->judge(__FUNCTION__))->eval($script, $args, $quantity);
    }
1108732
protected function addRefFKGet(&$script, ForeignKey $refFK)
    {
        $fkQueryClassName = $this->getClassNameFromBuilder($this->getNewStubQueryBuilder($refFK->getTable()));
        $relCol = $this->getRefFKPhpNameAffix($refFK, $plural = true);
        $collName = $this->getRefFKCollVarName($refFK);

        $className = $this->getClassNameFromTable($refFK->getTable());

        $script .= "
    /**
     * Gets an array of $className objects which contain a foreign key that references this object.
     *
     * If the \$criteria is not null, it is used to always fetch the results from the database.
     * Otherwise the results are fetched from the database the first time, then cached.
     * Next time the same method is called without \$criteria, the cached collection is returned.
     * If this ".$this->getObjectClassName()." is new, it will return
     * an empty collection or the current collection; the criteria is ignored on a new object.
     *
     * @param      Criteria \$criteria optional Criteria object to narrow the query
     * @param      ConnectionInterface \$con optional connection object
     * @return ObjectCollection|{$className}[] List of $className objects
     * @throws PropelException
     */
    public function get$relCol(Criteria \$criteria = null, ConnectionInterface \$con = null)
    {
        \$partial = \$this->{$collName}Partial && !\$this->isNew();
        if (null === \$this->$collName || null !== \$criteria  || \$partial) {
            if (\$this->isNew() && null === \$this->$collName) {
                // return empty collection
                \$this->init" . $this->getRefFKPhpNameAffix($refFK, $plural = true) . "();
            } else {
                \$$collName = $fkQueryClassName::create(null, \$criteria)
                    ->filterBy" . $this->getFKPhpNameAffix($refFK) . "(\$this)
                    ->find(\$con);

                if (null !== \$criteria) {
                    if (false !== \$this->{$collName}Partial && count(\$$collName)) {
                        \$this->init" . $this->getRefFKPhpNameAffix($refFK, $plural = true) . "(false);

                        foreach (\$$collName as \$obj) {
                            if (false == \$this->{$collName}->contains(\$obj)) {
                                \$this->{$collName}->append(\$obj);
                            }
                        }

                        \$this->{$collName}Partial = true;
                    }

                    return \$$collName;
                }

                if (\$partial && \$this->$collName) {
                    foreach (\$this->$collName as \$obj) {
                        if (\$obj->isNew()) {
                            \${$collName}[] = \$obj;
                        }
                    }
                }

                \$this->$collName = \$$collName;
                \$this->{$collName}Partial = false;
            }
        }

        return \$this->$collName;
    }
";
    }
228667
public function count(...$arguments): ?int
    {
        $where       = $arguments[0] ?? null;
        $whereParams = $arguments[1] ?? null;

        $query = $this->initQueryBuilder();
        try {
            $query->select('1');

            if ($where != null) {
                $query->where($where, $whereParams);
            }

            return $query->count();
        } catch (\Exception $e) {
            $this->setFail($e);

            return null;
        }
    }
1259170
function eval$if(params) {
  var script = params.$if
              ? params.$then
              : typeof params.$else == 'undefined' ? null : params.$else;
  return isScript(script)
          ? new this.js.Script(script)
          : script;
}