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
3e39fcf3
Commit
3e39fcf3
authored
Oct 17, 2007
by
phuson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented generation for loadTemplate() from Schema file.
parent
e63393cd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
0 deletions
+22
-0
Builder.php
lib/Doctrine/Import/Builder.php
+20
-0
Schema.php
lib/Doctrine/Import/Schema.php
+2
-0
No files found.
lib/Doctrine/Import/Builder.php
View file @
3e39fcf3
...
...
@@ -210,6 +210,26 @@ END;
$i
++
;
}
if
(
isset
(
$options
[
'templates'
])
&&
!
empty
(
$options
[
'templates'
]))
{
$ret
[
$i
]
=
PHP_EOL
.
str_repeat
(
' '
,
8
)
.
'// Load Class Template(s)'
;
$i
++
;
if
(
!
is_array
(
$options
[
'templates'
]))
{
// explode to extract each template separated by commas
$templatesArray
=
explode
(
','
,
$options
[
'templates'
]);
}
else
{
// set the existing array to templatesArray to be traversed through
$templatesArray
=
$options
[
'templates'
];
}
foreach
(
$templatesArray
as
$templateName
)
{
$ret
[
$i
]
=
str_repeat
(
' '
,
8
)
.
'$this->loadTemplate(\''
.
trim
(
$templateName
)
.
'\');'
;
$i
++
;
}
$ret
[
$i
]
=
''
;
$i
++
;
}
foreach
(
$columns
as
$name
=>
$column
)
{
$ret
[
$i
]
=
' $this->hasColumn(\''
.
$name
.
'\', \''
.
$column
[
'type'
]
.
'\''
;
...
...
lib/Doctrine/Import/Schema.php
View file @
3e39fcf3
...
...
@@ -139,6 +139,7 @@ class Doctrine_Import_Schema
$options
[
'className'
]
=
$properties
[
'className'
];
$options
[
'fileName'
]
=
$directory
.
DIRECTORY_SEPARATOR
.
$properties
[
'className'
]
.
'.class.php'
;
$options
[
'tableName'
]
=
isset
(
$properties
[
'tableName'
])
?
$properties
[
'tableName'
]
:
null
;
$options
[
'templates'
]
=
isset
(
$properties
[
'templates'
])
?
$properties
[
'templates'
]
:
null
;
if
(
isset
(
$properties
[
'inheritance'
]))
{
$options
[
'inheritance'
]
=
$properties
[
'inheritance'
];
...
...
@@ -239,6 +240,7 @@ class Doctrine_Import_Schema
$build
[
$className
][
'tableName'
]
=
$tableName
;
$build
[
$className
][
'columns'
]
=
$columns
;
$build
[
$className
][
'templates'
]
=
isset
(
$table
[
'templates'
])
?
$table
[
'templates'
]
:
array
();
$build
[
$className
][
'relations'
]
=
isset
(
$table
[
'relations'
])
?
$table
[
'relations'
]
:
array
();
$build
[
$className
][
'indexes'
]
=
isset
(
$table
[
'indexes'
])
?
$table
[
'indexes'
]
:
array
();
$build
[
$className
][
'attributes'
]
=
isset
(
$table
[
'attributes'
])
?
$table
[
'attributes'
]
:
array
();
...
...
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