Skip to content
Permalink
Browse files

Documenting new id() function

  • Loading branch information...
lorenzo committed Mar 3, 2013
1 parent 46223c6 commit ef0f3f1fcdc73ade3f1939adff27d0a61eee7574
Showing with 11 additions and 2 deletions.
  1. +11 −2 lib/Cake/Model/Datasource/Database/Expression/QueryExpression.php
@@ -101,8 +101,8 @@ class QueryExpression implements ExpressionInterface, Countable {
* @return void
*/
public function __construct($conditions = [], $types = [], $conjunction = 'AND') {
$this->_conjunction = strtoupper($conjunction);
$this->_identifier = substr(spl_object_hash($this), 7, 9);
$this->type(strtoupper($conjunction));
$this->id(substr(spl_object_hash($this), 7, 9));
if (!empty($conditions)) {
$this->add($conditions, $types);
}
@@ -439,6 +439,15 @@ public function traverse($callable) {
$callable($this);
}
/**
* Sets the unique identifier string for this object, which is used for generating
* placeholders. If called with no arguments it will return the currently defined
* identifier.
*
* @param string $identifier the string to be used as prefix for generating
* placeholders. If null current identifier is returned
* @return string|QueryExpression
*/
public function id($identifier = null) {
if ($identifier === null) {
return $this->_identifier;

0 comments on commit ef0f3f1

Please sign in to comment.
You can’t perform that action at this time.