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
e0dcd111
Commit
e0dcd111
authored
Jan 10, 2008
by
lsmith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- implemented listTriggers and listTableTriggers()
parent
73d63af1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
2 deletions
+19
-2
Sqlite.php
lib/Doctrine/Import/Sqlite.php
+19
-2
No files found.
lib/Doctrine/Import/Sqlite.php
View file @
e0dcd111
...
@@ -59,7 +59,7 @@ class Doctrine_Import_Sqlite extends Doctrine_Import
...
@@ -59,7 +59,7 @@ class Doctrine_Import_Sqlite extends Doctrine_Import
*/
*/
public
function
listTriggers
(
$database
=
null
)
public
function
listTriggers
(
$database
=
null
)
{
{
return
$this
->
listTableTriggers
(
null
);
}
}
/**
/**
...
@@ -190,7 +190,24 @@ class Doctrine_Import_Sqlite extends Doctrine_Import
...
@@ -190,7 +190,24 @@ class Doctrine_Import_Sqlite extends Doctrine_Import
*/
*/
public
function
listTableTriggers
(
$table
)
public
function
listTableTriggers
(
$table
)
{
{
$query
=
"SELECT name FROM sqlite_master WHERE type='trigger' AND sql NOT NULL"
;
if
(
!
is_null
(
$table
))
{
if
(
$this
->
conn
->
getAttribute
(
Doctrine
::
ATTR_PORTABILITY
)
&
Doctrine
::
PORTABILITY_FIX_CASE
)
{
if
(
$this
->
conn
->
getAttribute
(
Doctrine
::
ATTR_FIELD_CASE
)
==
CASE_LOWER
)
{
$query
.=
' AND LOWER(tbl_name)='
.
$db
->
quote
(
strtolower
(
$table
),
'text'
);
}
else
{
$query
.=
' AND UPPER(tbl_name)='
.
$db
->
quote
(
strtoupper
(
$table
),
'text'
);
}
}
else
{
$query
.=
' AND tbl_name='
.
$db
->
quote
(
$table
,
'text'
);
}
}
$result
=
$this
->
conn
->
fetchColumn
(
$query
);
if
(
$this
->
conn
->
getAttribute
(
Doctrine
::
ATTR_PORTABILITY
)
&
Doctrine
::
PORTABILITY_FIX_CASE
)
{
$result
=
array_map
((
$this
->
conn
->
getAttribute
(
Doctrine
::
ATTR_FIELD_CASE
)
==
CASE_LOWER
?
'strtolower'
:
'strtoupper'
),
$result
);
}
return
$result
;
}
}
/**
/**
...
@@ -237,4 +254,4 @@ class Doctrine_Import_Sqlite extends Doctrine_Import
...
@@ -237,4 +254,4 @@ class Doctrine_Import_Sqlite extends Doctrine_Import
return
$this
->
conn
->
fetchColumn
(
$query
);
return
$this
->
conn
->
fetchColumn
(
$query
);
}
}
}
}
\ No newline at end of file
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