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
f2eb1537
Commit
f2eb1537
authored
Oct 29, 2007
by
pookey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replacing tabs with spaces
parent
ff7aac8b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
26 deletions
+26
-26
Builder.php
lib/Doctrine/Import/Builder.php
+26
-26
No files found.
lib/Doctrine/Import/Builder.php
View file @
f2eb1537
...
...
@@ -272,16 +272,16 @@ END;
$ret
=
''
;
foreach
(
$columns
as
$name
=>
$column
)
{
// getters
$ret
.=
"
\n
\t
public function get"
.
Doctrine
::
classify
(
$name
)
.
"(
\$
load = true)
\n
"
;
$ret
.=
"
\t
{\n"
;
$ret
.=
"
\t\t
return
\$
this->get('
{
$name
}
',
\$
load);
\n
"
;
$ret
.=
"
\t
}
\n
"
;
$ret
.=
"
\n
public function get"
.
Doctrine
::
classify
(
$name
)
.
"(
\$
load = true)
\n
"
;
$ret
.=
"
{\n"
;
$ret
.=
"
return
\$
this->get('
{
$name
}
',
\$
load);
\n
"
;
$ret
.=
"
}
\n
"
;
// setters
$ret
.=
"
\n
\t
public function set"
.
Doctrine
::
classify
(
$name
)
.
"(
\$
{
$name
}
,
\$
load = true)
\n
"
;
$ret
.=
"
\t
{\n"
;
$ret
.=
"
\t\t
return
\$
this->set('
{
$name
}
',
\$
{
$name
}
,
\$
load);
\n
"
;
$ret
.=
"
\t
}
\n
"
;
$ret
.=
"
\n
public function set"
.
Doctrine
::
classify
(
$name
)
.
"(
\$
{
$name
}
,
\$
load = true)
\n
"
;
$ret
.=
"
{\n"
;
$ret
.=
"
return
\$
this->set('
{
$name
}
',
\$
{
$name
}
,
\$
load);
\n
"
;
$ret
.=
"
}
\n
"
;
}
return
$ret
;
...
...
@@ -300,18 +300,18 @@ END;
$i
=
0
;
if
(
isset
(
$options
[
'inheritance'
][
'extends'
])
&&
!
(
isset
(
$options
[
'override_parent'
])
&&
$options
[
'override_parent'
]
==
false
))
{
$ret
[
$i
]
=
"
\t\t
parent::setTableDefinition();"
;
$ret
[
$i
]
=
"
parent::setTableDefinition();"
;
$i
++
;
}
if
(
isset
(
$options
[
'tableName'
])
&&
!
empty
(
$options
[
'tableName'
]))
{
$ret
[
$i
]
=
"
\t\t
"
.
'$this->setTableName(\''
.
$options
[
'tableName'
]
.
'\');'
;
$ret
[
$i
]
=
"
"
.
'$this->setTableName(\''
.
$options
[
'tableName'
]
.
'\');'
;
$i
++
;
}
foreach
(
$columns
as
$name
=>
$column
)
{
$ret
[
$i
]
=
"
\t\t
"
.
'$this->hasColumn(\''
.
$name
.
'\', \''
.
$column
[
'type'
]
.
'\''
;
$ret
[
$i
]
=
"
"
.
'$this->hasColumn(\''
.
$name
.
'\', \''
.
$column
[
'type'
]
.
'\''
;
if
(
$column
[
'length'
])
{
$ret
[
$i
]
.=
', '
.
$column
[
'length'
];
...
...
@@ -372,7 +372,7 @@ END;
$code
=
trim
(
$code
);
if
(
$code
)
{
return
"
\n
\t
public function setTableDefinition()"
.
"
\n\t
{
\n\t\t".$code."\n\t
}
"
;
return
"
\n
public function setTableDefinition()"
.
"
\n
{\n "
.
$code
.
"
\n
}"
;
}
}
...
...
@@ -390,12 +390,12 @@ END;
if
(
is_array
(
$options
)
&&
!
empty
(
$options
))
{
$optionsPhp
=
$this
->
arrayToPhpArrayCode
(
$options
);
$build
.=
"
\t\t
\$
this->loadTemplate('"
.
$name
.
"', "
.
$optionsPhp
.
");
\n
"
;
$build
.=
"
\$
this->loadTemplate('"
.
$name
.
"', "
.
$optionsPhp
.
");
\n
"
;
}
else
{
if
(
isset
(
$templates
[
0
]))
{
$build
.=
"
\t\t
\$
this->loadTemplate('"
.
$options
.
"');
\n
"
;
$build
.=
"
\$
this->loadTemplate('"
.
$options
.
"');
\n
"
;
}
else
{
$build
.=
"
\t\t
\$
this->loadTemplate('"
.
$name
.
"');
\n
"
;
$build
.=
"
\$
this->loadTemplate('"
.
$name
.
"');
\n
"
;
}
}
}
...
...
@@ -416,12 +416,12 @@ END;
if
(
is_array
(
$options
)
&&
!
empty
(
$options
))
{
$optionsPhp
=
$this
->
arrayToPhp
(
$options
);
$build
.=
"
\t\t
\$
this->actAs('"
.
$name
.
"', "
.
$optionsPhp
.
");
\n
"
;
$build
.=
"
\$
this->actAs('"
.
$name
.
"', "
.
$optionsPhp
.
");
\n
"
;
}
else
{
if
(
isset
(
$actAs
[
0
]))
{
$build
.=
"
\t\t
\$
this->actAs('"
.
$options
.
"');
\n
"
;
$build
.=
"
\$
this->actAs('"
.
$options
.
"');
\n
"
;
}
else
{
$build
.=
"
\t\t
\$
this->actAs('"
.
$name
.
"');
\n
"
;
$build
.=
"
\$
this->actAs('"
.
$name
.
"');
\n
"
;
}
}
}
...
...
@@ -473,7 +473,7 @@ END;
$values
=
substr
(
$values
,
0
,
strlen
(
$values
)
-
3
);
}
$build
.=
"
\t\t
\$
this->setAttribute(Doctrine::ATTR_"
.
strtoupper
(
$key
)
.
", "
.
$values
.
");
\n
"
;
$build
.=
"
\$
this->setAttribute(Doctrine::ATTR_"
.
strtoupper
(
$key
)
.
", "
.
$values
.
");
\n
"
;
}
return
$build
;
...
...
@@ -490,7 +490,7 @@ END;
$build
=
''
;
foreach
(
$indexes
as
$indexName
=>
$definitions
)
{
$build
.=
"
\n
\t\t
"
.
'$this->index(\''
.
$indexName
.
'\', array('
;
$build
.=
"
\n
"
.
'$this->index(\''
.
$indexName
.
'\', array('
;
foreach
(
$definitions
as
$name
=>
$value
)
{
...
...
@@ -559,7 +559,7 @@ END;
$i
=
0
;
if
(
isset
(
$options
[
'inheritance'
][
'extends'
])
&&
!
(
isset
(
$options
[
'override_parent'
])
&&
$options
[
'override_parent'
]
==
false
))
{
$ret
[
$i
]
=
"
\t\t
parent::setUp();"
;
$ret
[
$i
]
=
"
parent::setUp();"
;
$i
++
;
}
...
...
@@ -573,9 +573,9 @@ END;
if
(
$relation
[
'type'
]
===
Doctrine_Relation
::
ONE
||
$relation
[
'type'
]
===
Doctrine_Relation
::
ONE_COMPOSITE
)
{
$ret
[
$i
]
=
"
\t\t
"
.
'$this->hasOne(\''
.
$class
.
$alias
.
'\''
;
$ret
[
$i
]
=
"
"
.
'$this->hasOne(\''
.
$class
.
$alias
.
'\''
;
}
else
{
$ret
[
$i
]
=
"
\t\t
"
.
'$this->hasMany(\''
.
$class
.
$alias
.
'\''
;
$ret
[
$i
]
=
"
"
.
'$this->hasMany(\''
.
$class
.
$alias
.
'\''
;
}
$a
=
array
();
...
...
@@ -620,14 +620,14 @@ END;
if
(
isset
(
$options
[
'inheritance'
][
'keyField'
])
&&
isset
(
$options
[
'inheritance'
][
'keyValue'
]))
{
$i
++
;
$ret
[
$i
]
=
"
\t\t
"
.
'$this->setInheritanceMap(array(\''
.
$options
[
'inheritance'
][
'keyField'
]
.
'\' => '
.
$options
[
'inheritance'
][
'keyValue'
]
.
'));'
;
$ret
[
$i
]
=
"
"
.
'$this->setInheritanceMap(array(\''
.
$options
[
'inheritance'
][
'keyField'
]
.
'\' => '
.
$options
[
'inheritance'
][
'keyValue'
]
.
'));'
;
}
$code
=
implode
(
"
\n
"
,
$ret
);
$code
=
trim
(
$code
);
if
(
$code
)
{
return
"
\n
\t
public function setUp()
\n\t
{
\n\t\t".$code."\n\t
}
"
;
return
"
\n
public function setUp()
\n
{\n "
.
$code
.
"
\n
}"
;
}
}
...
...
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