(No version information available, might only be in Git)
CollectionFind::bind — Bind value to query placeholder
$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
?>