1
0
mirror of synced 2024-12-14 23:26:04 +03:00

Removed _ prefix from private functions.

This commit is contained in:
Alexander 2011-05-20 16:53:35 +02:00
parent 262ae7c942
commit cec62db2d8

View File

@ -88,7 +88,7 @@ class DatabaseDriver implements Driver
{ {
$this->tables = $this->manyToManyTables = $this->classToTableNames = array(); $this->tables = $this->manyToManyTables = $this->classToTableNames = array();
foreach ($entityTables AS $table) { foreach ($entityTables AS $table) {
$className = $this->_getClassNameForTable($table->getName()); $className = $this->getClassNameForTable($table->getName());
$this->classToTableNames[$className] = $table->getName(); $this->classToTableNames[$className] = $table->getName();
$this->tables[$table->getName()] = $table; $this->tables[$table->getName()] = $table;
} }
@ -130,7 +130,7 @@ class DatabaseDriver implements Driver
} else { } else {
// lower-casing is necessary because of Oracle Uppercase Tablenames, // lower-casing is necessary because of Oracle Uppercase Tablenames,
// assumption is lower-case + underscore separated. // assumption is lower-case + underscore separated.
$className = $this->_getClassNameForTable($tableName); $className = $this->getClassNameForTable($tableName);
$this->tables[$tableName] = $table; $this->tables[$tableName] = $table;
$this->classToTableNames[$className] = $tableName; $this->classToTableNames[$className] = $tableName;
} }
@ -182,7 +182,7 @@ class DatabaseDriver implements Driver
continue; continue;
} }
$fieldMapping['fieldName'] = $this->_getFieldNameForColumn($tableName, $column->getName(), false); $fieldMapping['fieldName'] = $this->getFieldNameForColumn($tableName, $column->getName(), false);
$fieldMapping['columnName'] = $column->getName(); $fieldMapping['columnName'] = $column->getName();
$fieldMapping['type'] = strtolower((string) $column->getType()); $fieldMapping['type'] = strtolower((string) $column->getType());
@ -236,10 +236,10 @@ class DatabaseDriver implements Driver
$localColumn = current($myFk->getColumns()); $localColumn = current($myFk->getColumns());
$associationMapping = array(); $associationMapping = array();
$associationMapping['fieldName'] = $this->_getFieldNameForColumn($manyTable->getName(), current($otherFk->getColumns()), true); $associationMapping['fieldName'] = $this->getFieldNameForColumn($manyTable->getName(), current($otherFk->getColumns()), true);
$associationMapping['targetEntity'] = $this->_getClassNameForTable($otherFk->getForeignTableName()); $associationMapping['targetEntity'] = $this->getClassNameForTable($otherFk->getForeignTableName());
if (current($manyTable->getColumns())->getName() == $localColumn) { if (current($manyTable->getColumns())->getName() == $localColumn) {
$associationMapping['inversedBy'] = $this->_getFieldNameForColumn($manyTable->getName(), current($myFk->getColumns()), true); $associationMapping['inversedBy'] = $this->getFieldNameForColumn($manyTable->getName(), current($myFk->getColumns()), true);
$associationMapping['joinTable'] = array( $associationMapping['joinTable'] = array(
'name' => strtolower($manyTable->getName()), 'name' => strtolower($manyTable->getName()),
'joinColumns' => array(), 'joinColumns' => array(),
@ -264,7 +264,7 @@ class DatabaseDriver implements Driver
); );
} }
} else { } else {
$associationMapping['mappedBy'] = $this->_getFieldNameForColumn($manyTable->getName(), current($myFk->getColumns()), true); $associationMapping['mappedBy'] = $this->getFieldNameForColumn($manyTable->getName(), current($myFk->getColumns()), true);
} }
$metadata->mapManyToMany($associationMapping); $metadata->mapManyToMany($associationMapping);
break; break;
@ -279,8 +279,8 @@ class DatabaseDriver implements Driver
$localColumn = current($cols); $localColumn = current($cols);
$associationMapping = array(); $associationMapping = array();
$associationMapping['fieldName'] = $this->_getFieldNameForColumn($tableName, $localColumn, true); $associationMapping['fieldName'] = $this->getFieldNameForColumn($tableName, $localColumn, true);
$associationMapping['targetEntity'] = $this->_getClassNameForTable($foreignTable); $associationMapping['targetEntity'] = $this->getClassNameForTable($foreignTable);
for ($i = 0; $i < count($cols); $i++) { for ($i = 0; $i < count($cols); $i++) {
$associationMapping['joinColumns'][] = array( $associationMapping['joinColumns'][] = array(
@ -345,7 +345,7 @@ class DatabaseDriver implements Driver
* @param string $tableName * @param string $tableName
* @return string * @return string
*/ */
private function _getClassNameForTable($tableName) private function getClassNameForTable($tableName)
{ {
if (isset($this->classNamesForTables[$tableName])) { if (isset($this->classNamesForTables[$tableName])) {
return $this->classNamesForTables[$tableName]; return $this->classNamesForTables[$tableName];
@ -362,7 +362,7 @@ class DatabaseDriver implements Driver
* @param boolean $fk Whether the column is a foreignkey or not. * @param boolean $fk Whether the column is a foreignkey or not.
* @return string * @return string
*/ */
private function _getFieldNameForColumn($tableName, $columnName, $fk = false) private function getFieldNameForColumn($tableName, $columnName, $fk = false)
{ {
if (isset($this->fieldNamesForColumns[$tableName]) && isset($this->fieldNamesForColumns[$tableName][$columnName])) { if (isset($this->fieldNamesForColumns[$tableName]) && isset($this->fieldNamesForColumns[$tableName][$columnName])) {
return $this->fieldNamesForColumns[$tableName][$columnName]; return $this->fieldNamesForColumns[$tableName][$columnName];