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
c26ed844
Commit
c26ed844
authored
Jul 23, 2007
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
--no commit message
--no commit message
parent
3a6ce5a6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
Import.php
lib/Doctrine/Import.php
+2
-1
Builder.php
lib/Doctrine/Import/Builder.php
+9
-5
No files found.
lib/Doctrine/Import.php
View file @
c26ed844
...
@@ -192,7 +192,8 @@ class Doctrine_Import extends Doctrine_Connection_Module
...
@@ -192,7 +192,8 @@ class Doctrine_Import extends Doctrine_Connection_Module
foreach
(
$this
->
listTables
()
as
$table
)
{
foreach
(
$this
->
listTables
()
as
$table
)
{
$builder
->
buildRecord
(
array
(
'tableName'
=>
$table
,
$builder
->
buildRecord
(
array
(
'tableName'
=>
$table
,
'className'
=>
Doctrine
::
classify
(
$table
)),
'className'
=>
Doctrine
::
classify
(
$table
)),
$this
->
listTableColumns
(
$table
));
$this
->
listTableColumns
(
$table
),
array
());
$classes
[]
=
Doctrine
::
classify
(
$table
);
$classes
[]
=
Doctrine
::
classify
(
$table
);
}
}
...
...
lib/Doctrine/Import/Builder.php
View file @
c26ed844
...
@@ -224,9 +224,13 @@ END;
...
@@ -224,9 +224,13 @@ END;
return
$content
;
return
$content
;
}
}
public
function
buildRecord
(
$
table
,
$columns
,
$relations
)
public
function
buildRecord
(
$
options
,
$columns
,
$relations
)
{
{
if
(
empty
(
$fileName
))
{
if
(
!
isset
(
$options
[
'className'
]))
{
throw
new
Doctrine_Import_Builder_Exception
(
'Missing class name.'
);
}
if
(
!
isset
(
$options
[
'fileName'
]))
{
if
(
empty
(
$this
->
path
))
{
if
(
empty
(
$this
->
path
))
{
$errMsg
=
'No build target directory set.'
;
$errMsg
=
'No build target directory set.'
;
throw
new
Doctrine_Import_Builder_Exception
(
$errMsg
);
throw
new
Doctrine_Import_Builder_Exception
(
$errMsg
);
...
@@ -238,15 +242,15 @@ END;
...
@@ -238,15 +242,15 @@ END;
throw
new
Doctrine_Import_Builder_Exception
(
$errMsg
);
throw
new
Doctrine_Import_Builder_Exception
(
$errMsg
);
}
}
$
fileName
=
$this
->
path
.
DIRECTORY_SEPARATOR
.
$className
.
$this
->
suffix
;
$
options
[
'fileName'
]
=
$this
->
path
.
DIRECTORY_SEPARATOR
.
$options
[
'className'
]
.
$this
->
suffix
;
}
}
$content
=
$this
->
buildDefinition
(
$options
,
$columns
,
$relations
);
$content
=
$this
->
buildDefinition
(
$options
,
$columns
,
$relations
);
$bytes
=
file_put_contents
(
$
fileName
,
'<?php'
.
PHP_EOL
.
$content
);
$bytes
=
file_put_contents
(
$
options
[
'fileName'
]
,
'<?php'
.
PHP_EOL
.
$content
);
if
(
$bytes
===
false
)
{
if
(
$bytes
===
false
)
{
throw
new
Doctrine_Import_Builder_Exception
(
"Couldn't write file "
.
$
fileName
);
throw
new
Doctrine_Import_Builder_Exception
(
"Couldn't write file "
.
$
options
[
'fileName'
]
);
}
}
}
}
}
}
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