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
38331335
Commit
38331335
authored
Oct 15, 2007
by
Jonathan.Wage
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes to indexes and to not call parent::setUp() in the base classes.
parent
34af8e3a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
19 deletions
+23
-19
Builder.php
lib/Doctrine/Import/Builder.php
+21
-18
Schema.php
lib/Doctrine/Import/Schema.php
+2
-1
No files found.
lib/Doctrine/Import/Builder.php
View file @
38331335
...
...
@@ -268,6 +268,7 @@ END;
return
"
\n\t
public function setTableDefinition()"
.
"
\n\t
{\n"
.
implode
(
"
\n
"
,
$ret
)
.
"
\n\t
}"
;
}
}
public
function
buildSetUp
(
array
$options
,
array
$columns
,
array
$relations
)
{
$ret
=
array
();
...
...
@@ -413,6 +414,7 @@ END;
$options
[
'className'
]
=
'Base'
.
$options
[
'className'
];
$options
[
'abstract'
]
=
true
;
$options
[
'fileName'
]
=
$generatedPath
.
DIRECTORY_SEPARATOR
.
$options
[
'className'
]
.
$this
->
suffix
;
$options
[
'override_parent'
]
=
true
;
$this
->
writeDefinition
(
$options
,
$columns
,
$relations
,
$indexes
);
}
else
{
...
...
@@ -422,24 +424,25 @@ END;
public
function
writeDefinition
(
array
$options
,
array
$columns
,
array
$relations
=
array
(),
array
$indexes
=
array
())
{
$content
=
$this
->
buildDefinition
(
$options
,
$columns
,
$relations
,
$indexes
);
$code
=
"<?php
\n
"
;
if
(
isset
(
$options
[
'requires'
]))
{
if
(
!
is_array
(
$options
[
'requires'
]))
{
$options
[
'requires'
]
=
array
(
$options
[
'requires'
]);
}
foreach
(
$options
[
'requires'
]
as
$require
)
{
$code
.=
"require_once('"
.
$require
.
"');"
;
}
}
$code
.=
PHP_EOL
.
$content
;
$bytes
=
file_put_contents
(
$options
[
'fileName'
],
$code
);
$content
=
$this
->
buildDefinition
(
$options
,
$columns
,
$relations
,
$indexes
);
$code
=
"<?php
\n
"
;
if
(
$bytes
===
false
)
{
throw
new
Doctrine_Import_Builder_Exception
(
"Couldn't write file "
.
$options
[
'fileName'
]);
}
if
(
isset
(
$options
[
'requires'
]))
{
if
(
!
is_array
(
$options
[
'requires'
]))
{
$options
[
'requires'
]
=
array
(
$options
[
'requires'
]);
}
foreach
(
$options
[
'requires'
]
as
$require
)
{
$code
.=
"require_once('"
.
$require
.
"');"
;
}
}
$code
.=
PHP_EOL
.
$content
;
$bytes
=
file_put_contents
(
$options
[
'fileName'
],
$code
);
if
(
$bytes
===
false
)
{
throw
new
Doctrine_Import_Builder_Exception
(
"Couldn't write file "
.
$options
[
'fileName'
]);
}
}
}
lib/Doctrine/Import/Schema.php
View file @
38331335
...
...
@@ -119,8 +119,9 @@ class Doctrine_Import_Schema
$options
=
$this
->
getOptions
(
$properties
,
$directory
);
$columns
=
$this
->
getColumns
(
$properties
);
$relations
=
$this
->
getRelations
(
$properties
);
$indexes
=
$this
->
getIndexes
(
$properties
);
$builder
->
buildRecord
(
$options
,
$columns
,
$relations
);
$builder
->
buildRecord
(
$options
,
$columns
,
$relations
,
$indexes
);
}
}
...
...
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