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
cc998bf1
Commit
cc998bf1
authored
Jun 07, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
7bacdf07
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
17 deletions
+13
-17
AuditLog.php
lib/Doctrine/AuditLog.php
+10
-16
Configurable.php
lib/Doctrine/Configurable.php
+3
-1
No files found.
lib/Doctrine/AuditLog.php
View file @
cc998bf1
...
...
@@ -36,7 +36,7 @@ class Doctrine_AuditLog
'deleteTrigger'
=>
'%TABLE%_ddt'
,
'updateTrigger'
=>
'%TABLE%_dut'
,
'versionTable'
=>
'%TABLE%_dvt'
,
'
identifier'
=>
'__
version'
,
'
versionColumn'
=>
'
version'
,
);
protected
$_table
;
...
...
@@ -54,7 +54,7 @@ class Doctrine_AuditLog
public
function
__get
(
$option
)
{
if
(
isset
(
$this
->
options
[
$option
]))
{
return
$this
->
options
[
$option
];
return
$this
->
_
options
[
$option
];
}
return
null
;
}
...
...
@@ -65,7 +65,7 @@ class Doctrine_AuditLog
*/
public
function
__isset
(
$option
)
{
return
isset
(
$this
->
options
[
$option
]);
return
isset
(
$this
->
_
options
[
$option
]);
}
/**
* getOptions
...
...
@@ -75,7 +75,7 @@ class Doctrine_AuditLog
*/
public
function
getOptions
()
{
return
$this
->
options
;
return
$this
->
_
options
;
}
/**
* setOption
...
...
@@ -92,7 +92,7 @@ class Doctrine_AuditLog
if
(
!
isset
(
$this
->
_options
[
$name
]))
{
throw
new
Doctrine_Exception
(
'Unknown option '
.
$name
);
}
$this
->
options
[
$name
]
=
$value
;
$this
->
_
options
[
$name
]
=
$value
;
}
/**
* getOption
...
...
@@ -103,8 +103,8 @@ class Doctrine_AuditLog
*/
public
function
getOption
(
$name
)
{
if
(
isset
(
$this
->
options
[
$name
]))
{
return
$this
->
options
[
$name
];
if
(
isset
(
$this
->
_
options
[
$name
]))
{
return
$this
->
_
options
[
$name
];
}
return
null
;
}
...
...
@@ -142,13 +142,6 @@ class Doctrine_AuditLog
}
$data
[
'columns'
]
=
array_merge
(
array
(
$this
->
_options
[
'identifier'
]
=>
array
(
'type'
=>
'integer'
,
'primary'
=>
true
,
'length'
=>
8
,
'autoinc'
=>
true
)),
$data
[
'columns'
]);
$className
=
str_replace
(
'%CLASS%'
,
$this
->
_table
->
getComponentName
(),
$this
->
_options
[
'className'
]);
$definition
=
'class '
.
$className
.
' extends Doctrine_Record { '
...
...
@@ -161,10 +154,11 @@ class Doctrine_AuditLog
'foreign'
=>
$this
->
_table
->
getIdentifier
(),
'type'
=>
Doctrine_Relation
::
MANY
));
print
$definition
;
$this
->
_table
->
addListener
(
new
Doctrine_AuditLog_Listener
(
$this
));
eval
(
$definition
);
$data
[
'options'
][
'primary'
]
=
array
(
$this
->
_options
[
'identifier'
]);
$conn
->
export
->
createTable
(
$data
[
'tableName'
],
$data
[
'columns'
],
$data
[
'options'
]);
}
...
...
lib/Doctrine/Configurable.php
View file @
cc998bf1
...
...
@@ -175,7 +175,9 @@ abstract class Doctrine_Configurable
*/
public
function
addListener
(
$listener
,
$name
=
null
)
{
if
(
!
(
$this
->
attributes
[
Doctrine
::
ATTR_LISTENER
]
instanceof
Doctrine_EventListener_Chain
))
{
if
(
!
isset
(
$this
->
attributes
[
Doctrine
::
ATTR_LISTENER
])
||
!
(
$this
->
attributes
[
Doctrine
::
ATTR_LISTENER
]
instanceof
Doctrine_EventListener_Chain
))
{
$this
->
attributes
[
Doctrine
::
ATTR_LISTENER
]
=
new
Doctrine_EventListener_Chain
();
}
$this
->
attributes
[
Doctrine
::
ATTR_LISTENER
]
->
add
(
$listener
,
$name
);
...
...
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