Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
dfd15a60
Commit
dfd15a60
authored
Oct 30, 2007
by
romanb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Introduced ATTR_TBLNAME_FORMAT. Closes #257
parent
b0c7dce4
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
2 deletions
+16
-2
Doctrine.php
lib/Doctrine.php
+1
-0
Formatter.php
lib/Doctrine/Formatter.php
+12
-0
Manager.php
lib/Doctrine/Manager.php
+1
-0
Abstract.php
lib/Doctrine/Record/Abstract.php
+1
-1
Table.php
lib/Doctrine/Table.php
+1
-1
No files found.
lib/Doctrine.php
View file @
dfd15a60
...
...
@@ -160,6 +160,7 @@ final class Doctrine
const
ATTR_CMPNAME_FORMAT
=
118
;
const
ATTR_DBNAME_FORMAT
=
117
;
const
ATTR_TBLCLASS_FORMAT
=
119
;
const
ATTR_TBLNAME_FORMAT
=
120
;
const
ATTR_EXPORT
=
140
;
const
ATTR_DECIMAL_PLACES
=
141
;
...
...
lib/Doctrine/Formatter.php
View file @
dfd15a60
...
...
@@ -226,4 +226,16 @@ class Doctrine_Formatter extends Doctrine_Connection_Module
return
sprintf
(
$this
->
conn
->
getAttribute
(
Doctrine
::
ATTR_IDXNAME_FORMAT
),
preg_replace
(
'/[^a-z0-9_\$]/i'
,
'_'
,
$idx
));
}
/**
* adds table name formatting to a table name
*
* @param string name of the table
* @return string formatted table name
*/
public
function
getTableName
(
$table
)
{
return
sprintf
(
$this
->
conn
->
getAttribute
(
Doctrine
::
ATTR_TBLNAME_FORMAT
),
preg_replace
(
'/[^a-z0-9_\$]/i'
,
'_'
,
$table
));
}
}
\ No newline at end of file
lib/Doctrine/Manager.php
View file @
dfd15a60
...
...
@@ -99,6 +99,7 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, Itera
Doctrine
::
ATTR_QUERY_LIMIT
=>
Doctrine
::
LIMIT_RECORDS
,
Doctrine
::
ATTR_IDXNAME_FORMAT
=>
"%s_idx"
,
Doctrine
::
ATTR_SEQNAME_FORMAT
=>
"%s_seq"
,
Doctrine
::
ATTR_TBLNAME_FORMAT
=>
"%s"
,
Doctrine
::
ATTR_QUOTE_IDENTIFIER
=>
false
,
Doctrine
::
ATTR_SEQCOL_NAME
=>
'id'
,
Doctrine
::
ATTR_PORTABILITY
=>
Doctrine
::
PORTABILITY_ALL
,
...
...
lib/Doctrine/Record/Abstract.php
View file @
dfd15a60
...
...
@@ -97,7 +97,7 @@ abstract class Doctrine_Record_Abstract extends Doctrine_Access
}
public
function
setTableName
(
$tableName
)
{
$this
->
_table
->
set
Option
(
'tableName'
,
$tableName
);
$this
->
_table
->
set
TableName
(
$tableName
);
}
public
function
setInheritanceMap
(
$map
)
{
...
...
lib/Doctrine/Table.php
View file @
dfd15a60
...
...
@@ -1467,7 +1467,7 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
*/
public
function
setTableName
(
$tableName
)
{
$this
->
_options
[
'tableName'
]
=
$tableName
;
$this
->
setOption
(
'tableName'
,
$this
->
_conn
->
formatter
->
getTableName
(
$tableName
))
;
}
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment