Created
March 3, 2014 18:41
-
-
Save EclipseGc/9331657 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @file | |
* Contains \Drupal\Core\Database\Query\PlaceholderTrait. | |
*/ | |
namespace Drupal\Core\Database\Query; | |
/** | |
* @see \Drupal\Core\Database\Query\PlaceholderInterface | |
*/ | |
trait PlaceholderTrait { | |
/** | |
* A unique identifier for this query object. | |
*/ | |
protected $uniqueIdentifier; | |
/** | |
* The placeholder counter. | |
*/ | |
protected $placeholder = 0; | |
/** | |
* Implements \Drupal\Core\Database\Query\PlaceholderInterface::uniqueIdentifier(). | |
*/ | |
public function uniqueIdentifier() { | |
if (!isset($this->uniqueIdentifier)) { | |
$this->uniqueIdentifier = uniqid('', TRUE); | |
} | |
return $this->uniqueIdentifier; | |
} | |
/** | |
* {@inheritdoc} | |
*/ | |
public function nextPlaceholder() { | |
return $this->placeholder++; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment