Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

naming collision patch #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Schemaless behavior.
* MongodbSchemaless behavior.
*
* Adds functionality specific to MongoDB/schemaless dbs
* Allow /not/ specifying the model's schema, and derive it (for cake-compatibility) from the data
Expand All @@ -25,21 +25,21 @@
*/

/**
* SchemalessBehavior class
* MongodbSchemalessBehavior class
*
* @uses ModelBehavior
* @package mongodb
* @subpackage mongodb.models.behaviors
*/
class SchemalessBehavior extends ModelBehavior {
class MongodbSchemalessBehavior extends ModelBehavior {

/**
* name property
*
* @var string 'Schemaless'
* @var string 'MongodbSchemaless'
* @access public
*/
public $name = 'Schemaless';
public $name = 'MongodbSchemaless';

/**
* settings property
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,21 @@
*/

/**
* SqlCompatibleBehavior class
* MongodbSqlCompatibleBehavior class
*
* @uses ModelBehavior
* @package mongodb
* @subpackage mongodb.models.behaviors
*/
class SqlCompatibleBehavior extends ModelBehavior {
class MongodbSqlCompatibleBehavior extends ModelBehavior {

/**
* name property
*
* @var string 'SqlCompatible'
* @var string 'MongodbSqlCompatible'
* @access public
*/
public $name = 'SqlCompatible';
public $name = 'MongodbSqlCompatible';

/**
* Runtime settings
Expand Down
2 changes: 1 addition & 1 deletion models/datasources/mongodb_source.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ public function describe(&$Model, $field = null) {
$schema = $Model->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);
}
Expand Down
6 changes: 3 additions & 3 deletions tests/cases/datasources/mongodb_source.test.php
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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,
Expand Down