mysql_xdevapi\CollectionFind
PHP Manual

CollectionFind::bind

(No version information available, might only be in Git)

CollectionFind::bindBind value to query placeholder

说明

public mysql_xdevapi\CollectionFind mysql_xdevapi\CollectionFind::bind ( array $placeholder_values )

It allows the user to bind a parameter to the placeholder in the search condition of the find operation. The placeholder has the form of :NAME where ':' is a common prefix that must always exists before any NAME, NAME is the actual name of the placeholder. The bind function accepts a list of placeholders if multiple entities have to be substituted in the search condition.

参数

placeholder_values

The values of the placeholder to substitute in the search condition, multiple values are allowed and have to be passed as an array of mappings PLACEHOLDER_NAME->PLACEHOLDER_VALUE, for more details see the examples.

返回值

A CollectionFind that can be used for further processing.

范例

Example #1 mysql_xdevapi\CollectionFind::bind() example

<?php

//Assuming $coll is a valid collection

//In this example we're binding :job and :age to 'Programmatore' and 20.
$res $coll->find('job like :job and age > :age');
$res $res->bind(['job' => 'Programmatore''age' => 20])->execute();
//At this point $res will contain the Result object

?>

mysql_xdevapi\CollectionFind
PHP Manual