diff --git a/core/lib/Drupal/Core/TempStore/SessionTempStore.php b/core/lib/Drupal/Core/TempStore/SessionTempStore.php index 5cd9336..4bb5798 100644 --- a/core/lib/Drupal/Core/TempStore/SessionTempStore.php +++ b/core/lib/Drupal/Core/TempStore/SessionTempStore.php @@ -15,9 +15,9 @@ class SessionTempStore extends TempStoreBase { /** * Overrides TempStoreBase::__construct(). */ - function __construct($subsystem, $ownerId = NULL) { - $ownerId = isset($ownerId) ? $ownerId : session_id(); - parent::__construct($subsystem, $ownerId); + function __construct($subsystem, $owner_id = NULL) { + $owner_id = isset($owner_id) ? $owner_id : session_id(); + parent::__construct($subsystem, $owner_id); } /** @@ -39,7 +39,7 @@ class SessionTempStore extends TempStoreBase { * Overrides TempStoreBase::testStoredObjects(). */ public static function testStoredObjects($subsystem, $keys) { - return db_query("SELECT t.temp_key, s.uid, t.updated FROM {temp_store} t INNER JOIN {sessions} s ON t.ownerId = s.ownerId WHERE t.subsystem = :subsystem AND t.temp_key IN (:keys) ORDER BY t.updated ASC", array(':subsystem' => $subsystem, ':temp_keys' => $keys)) + return db_query("SELECT t.temp_key, s.uid, t.updated FROM {temp_store} t INNER JOIN {sessions} s ON t.owner_id = s.owner_id WHERE t.subsystem = :subsystem AND t.temp_key IN (:keys) ORDER BY t.updated ASC", array(':subsystem' => $subsystem, ':temp_keys' => $keys)) ->fetchAllAssoc('temp_key'); } @@ -47,7 +47,7 @@ class SessionTempStore extends TempStoreBase { * Overrides TempStoreBase::getLockOwner(). */ public function getLockOwner($key, $exclude_owner = FALSE) { - $lock_owner = db_query('SELECT s.uid, t.updated FROM {temp_store} t INNER JOIN {sessions} s ON t.ownerId = s.sid WHERE t.subsystem = :subsystem AND t.temp_key = :temp_key ORDER BY t.updated ASC', array( + $lock_owner = db_query('SELECT s.uid, t.updated FROM {temp_store} t INNER JOIN {sessions} s ON t.owner_id = s.sid WHERE t.subsystem = :subsystem AND t.temp_key = :temp_key ORDER BY t.updated ASC', array( ':subsystem' => $this->subsystem, ':temp_key' => $key, ))->fetchObject(); diff --git a/core/lib/Drupal/Core/TempStore/SpecialTempStore.php b/core/lib/Drupal/Core/TempStore/SpecialTempStore.php index b4e501d..09be3b9 100644 --- a/core/lib/Drupal/Core/TempStore/SpecialTempStore.php +++ b/core/lib/Drupal/Core/TempStore/SpecialTempStore.php @@ -15,21 +15,21 @@ class SpecialTempStore extends TempStoreBase { /** * Overrides TempStoreBase::__construct(). */ - function __construct($subsystem, $ownerId = NULL) { + function __construct($subsystem, $owner_id = NULL) { // Since session IDs are not used, an exception is thrown if no // identifier is provided. - if (!isset($ownerId)) { + if (!isset($owner_id)) { throw new TempStoreException(); } - parent::__construct($subsystem, $ownerId); + parent::__construct($subsystem, $owner_id); } /** * Overrides TempStoreBase::getLockOwner(). */ public function getLockOwner($key, $exclude_owner = FALSE) { - return db_query('SELECT ownerId FROM {temp_store} WHERE subsystem = :subsystem AND temp_key = :temp_key', array( + return db_query('SELECT owner_id FROM {temp_store} WHERE subsystem = :subsystem AND temp_key = :temp_key', array( ':subsystem' => $this->subsystem, ':temp_key' => $key, ))->fetchField(); diff --git a/core/lib/Drupal/Core/TempStore/TempStoreBase.php b/core/lib/Drupal/Core/TempStore/TempStoreBase.php index ff9a0d6..04911d9 100644 --- a/core/lib/Drupal/Core/TempStore/TempStoreBase.php +++ b/core/lib/Drupal/Core/TempStore/TempStoreBase.php @@ -45,13 +45,13 @@ abstract class TempStoreBase { * @param string $subsystem * The module or subsystem. Possible values might include 'entity', * 'form', 'views', etc. - * @param string $ownerId + * @param string $owner_id * (optional) A unique identifier for the owner of the temporary storage * data. Defaults to NULL. */ - function __construct($subsystem, $ownerId = NULL) { + function __construct($subsystem, $owner_id = NULL) { $this->subsystem = $subsystem; - $this->ownerId = $ownerId; + $this->ownerId = $owner_id; } /** @@ -67,9 +67,9 @@ abstract class TempStoreBase { // @todo We may wish to add static caching here in the future, either // as a static cache on the object or using drupal_static(). $data = db_query( - 'SELECT * FROM {temp_store} WHERE ownerId = :ownerID AND subsystem = :subsystem AND temp_key = :temp_key', + 'SELECT * FROM {temp_store} WHERE owner_id = :owner_id AND subsystem = :subsystem AND temp_key = :temp_key', array( - ':ownerID' => $this->ownerId, + ':owner_id' => $this->ownerId, ':subsystem' => $this->subsystem, ':temp_key' => $key, ) @@ -102,7 +102,7 @@ abstract class TempStoreBase { // Store the new data. db_insert('temp_store') ->fields(array( - 'ownerId' => $this->ownerId, + 'owner_id' => $this->ownerId, 'subsystem' => $this->subsystem, 'temp_key' => $key, 'data' => serialize($data), @@ -151,7 +151,7 @@ abstract class TempStoreBase { ->condition('subsystem', $this->subsystem); if (!$all) { - $query->condition('ownerId', $this->ownerId); + $query->condition('owner_id', $this->ownerId); } $query->execute(); diff --git a/core/modules/system/system.install b/core/modules/system/system.install index 4a62a53..4c92101 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -1376,7 +1376,7 @@ function system_schema() { $schema['temp_store'] = array( 'description' => t('A special cache used to store objects that are being edited; it serves to save state in an ordinarily stateless environment.'), 'fields' => array( - 'ownerId' => array( + 'owner_id' => array( 'type' => 'varchar', 'length' => '64', 'not null' => TRUE, @@ -1408,7 +1408,7 @@ function system_schema() { 'serialize' => TRUE, ), ), - 'primary key' => array('ownerId', 'subsystem', 'temp_key'), + 'primary key' => array('owner_id', 'subsystem', 'temp_key'), 'indexes' => array('updated' => array('updated')), ); @@ -1970,7 +1970,7 @@ function system_update_8011() { $table = array( 'description' => t('A special cache used to store objects that are being edited; it serves to save state in an ordinarily stateless environment.'), 'fields' => array( - 'ownerId' => array( + 'owner_id' => array( 'type' => 'varchar', 'length' => '64', 'not null' => TRUE, @@ -2002,7 +2002,7 @@ function system_update_8011() { 'serialize' => TRUE, ), ), - 'primary key' => array('ownerId', 'subsystem', 'temp_key'), + 'primary key' => array('owner_id', 'subsystem', 'temp_key'), 'indexes' => array('updated' => array('updated')), );