Oihana PHP Arango

formatBindVariable.php

Table of Contents

Functions

formatBindVariable()  : string
Formats a string as an ArangoDB bind variable.

Functions

formatBindVariable()

Formats a string as an ArangoDB bind variable.

formatBindVariable(string $name[, bool $isCollection = false ]) : string
  • If the name already starts with @, it is wrapped (using wrap()) to escape it.
  • If $isCollection is true, the resulting bind variable is prefixed with @@ for collection bind variables.
  • Otherwise, it is prefixed with a single @.
Parameters
$name : string

The name of the bind variable.

$isCollection : bool = false

Whether this is a collection bind variable (prefixed with @@).

Tags
example
formatBindVariable('userId');
// returns '@userId'

formatBindVariable('@userId');
// returns '@`@userId`'

formatBindVariable('users', true);
// returns '@@users'

formatBindVariable('@users', true);
// returns '@@`@users`'
since
1.0.0
author

Marc Alcaraz

Return values
string

The properly formatted bind variable name.

On this page

Search results