Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/vendor/doctrine/lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php b/vendor/doctrine/lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php
- index c2d9240..efdb760 100644
- --- a/vendor/doctrine/lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php
- +++ b/vendor/doctrine/lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php
- @@ -345,6 +345,7 @@ class DatabaseDriver implements Driver
- */
- public function setFieldNameForColumn($tableName, $columnName, $fieldName)
- {
- + $fieldName = $this->deprefixFieldName($fieldName);
- $this->fieldNamesForColumns[$tableName][$columnName] = $fieldName;
- }
- @@ -383,10 +384,23 @@ class DatabaseDriver implements Driver
- if ($fk) {
- $columnName = str_replace('_id', '', $columnName);
- }
- +
- + $columnName = $this->deprefixFieldName($columnName);
- +
- return Inflector::camelize($columnName);
- }
- /**
- + * Remove column name prefix from field name, i.e. user_is_active -> is_active
- + *
- + * @param string $fieldName
- + * @return string
- + */
- + private function deprefixFieldName( $fieldName ) {
- + return implode('_',array_slice(explode('_',$fieldName),1));
- + }
- +
- + /**
- * Set the namespace for the generated entities.
- *
- * @param string $namespace
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement