mysql_xdevapi\CollectionModify
PHP Manual

CollectionModify::bind

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

CollectionModify::bindBind value to query placeholder

说明

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

Bind a parameter to the placeholder in the search condition of the modify operation.

The placeholder has the form of :NAME where ':' is a common prefix that must always exists before any NAME where NAME is the name of the placeholder. The bind method accepts a list of placeholders if multiple entities have to be substituted in the search condition of the modify operation.

参数

placeholder_values

Placeholder values to substitute in the search condition. Multiple values are allowed and have to be passed as an array of mappings PLACEHOLDER_NAME->PLACEHOLDER_VALUE.

返回值

A CollectionModify object that can be used to execute the command, or to add additional operations.

范例

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

<?php
// Assuming $coll is a valid Collection object

// Add a new job to the document which field name is equal to 'Sakila'
$coll->modify('name like :param')->set("job""Unemployed")->bind(['param' => 'Sakila'])->execute();

?>

mysql_xdevapi\CollectionModify
PHP Manual