From bd91fc60309dbafb3e23588786b9bb7feaad8be4 Mon Sep 17 00:00:00 2001 From: Jon Adams Date: Wed, 10 Nov 2010 16:08:36 -0800 Subject: [PATCH] adding Mongodb prefix to behaviors and updating references to avoid collisions with other app/plugins --- .../{schemaless.php => mongodb_schemaless.php} | 10 +++++----- .../{sql_compatible.php => mongodb_sql_compatible.php} | 8 ++++---- models/datasources/mongodb_source.php | 2 +- tests/cases/datasources/mongodb_source.test.php | 6 +++--- 4 files changed, 13 insertions(+), 13 deletions(-) rename models/behaviors/{schemaless.php => mongodb_schemaless.php} (90%) rename models/behaviors/{sql_compatible.php => mongodb_sql_compatible.php} (96%) diff --git a/models/behaviors/schemaless.php b/models/behaviors/mongodb_schemaless.php similarity index 90% rename from models/behaviors/schemaless.php rename to models/behaviors/mongodb_schemaless.php index 73ac04d..2da61d2 100644 --- a/models/behaviors/schemaless.php +++ b/models/behaviors/mongodb_schemaless.php @@ -1,6 +1,6 @@ mongoSchema; return $schema + $this->_defaultSchema; } elseif (is_a($Model, 'Model') && !empty($Model->Behaviors)) { - $Model->Behaviors->attach('Mongodb.Schemaless'); + $Model->Behaviors->attach('Mongodb.MongodbSchemaless'); } return $this->deriveSchemaFromData($Model); } diff --git a/tests/cases/datasources/mongodb_source.test.php b/tests/cases/datasources/mongodb_source.test.php index db46913..f929a89 100644 --- a/tests/cases/datasources/mongodb_source.test.php +++ b/tests/cases/datasources/mongodb_source.test.php @@ -489,14 +489,14 @@ public function testSort() { } /** - * testSchemaless method + * testMongodbSchemaless method * * Test you can save to a model without specifying mongodb. * * @return void * @access public */ - public function testSchemaless() { + public function testMongodbSchemaless() { $toSave = array( 'title' => 'A test article', 'body' => str_repeat('Lorum ipsum ', 100), @@ -543,7 +543,7 @@ public function testSchemaless() { * @access public */ public function testSqlComparisonOperators() { - $this->Post->Behaviors->attach('Mongodb.SqlCompatible'); + $this->Post->Behaviors->attach('Mongodb.MongodbSqlCompatible'); for ($i = 1; $i <= 20; $i++) { $data = array( 'title' => $i,