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
80901aa7
Commit
80901aa7
authored
Sep 20, 2006
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed Doctrine_Form (form building is not part of an ORM framework)
parent
013c05b5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
80 deletions
+28
-80
Form.php
Doctrine/Form.php
+0
-80
Identifier.php
Doctrine/Identifier.php
+28
-0
No files found.
Doctrine/Form.php
deleted
100644 → 0
View file @
013c05b5
<?php
class
Doctrine_Form
implements
Iterator
{
protected
$record
;
protected
$elements
=
array
();
protected
$columns
;
protected
$current
;
protected
$keys
;
protected
$index
;
protected
$count
;
public
function
__construct
(
Doctrine_Record
$record
)
{
$this
->
record
=
$record
;
$this
->
columns
=
$record
->
getTable
()
->
getColumns
();
$this
->
keys
=
array_keys
(
$this
->
columns
);
$this
->
index
=
0
;
$this
->
count
=
count
(
$this
->
keys
);
}
public
function
current
()
{
$i
=
$this
->
index
;
$column
=
$this
->
keys
[
$i
];
$definitions
=
$this
->
columns
[
$column
];
$e
=
explode
(
"|"
,
$definitions
[
2
]);
$enum
=
false
;
if
(
$definitions
[
0
]
==
"enum"
)
$enum
=
$this
->
record
->
getTable
()
->
getEnumValues
(
$column
);
$length
=
$definitions
[
1
];
if
(
!
in_array
(
"autoincrement"
,
$e
)
&&
!
in_array
(
"protected"
,
$e
))
{
if
(
$enum
)
{
$elements
[
$column
]
=
"<select name='data[
$column
]'>
\n
"
;
$elements
[
$column
]
.=
" <option value='-'>-</option>
\n
"
;
foreach
(
$enum
as
$k
=>
$v
)
{
if
(
$this
->
record
->
get
(
$column
)
==
$v
)
{
$str
=
'selected'
;
}
else
$str
=
''
;
$elements
[
$column
]
.=
" <option value='
$v
'
$str
>
$v
</option>
\n
"
;
}
$elements
[
$column
]
.=
"</select>
\n
"
;
}
else
{
if
(
$length
<=
255
)
{
$elements
[
$column
]
=
"<input name='data[
$column
]' type='text' value='"
.
$this
->
record
->
get
(
$column
)
.
"' maxlength=
$length
\>
\n
"
;
}
elseif
(
$length
<=
4000
)
{
$elements
[
$column
]
=
"<textarea name='data[
$column
]' cols=40 rows=10>"
.
$this
->
record
->
get
(
$column
)
.
"</textarea>
\n
"
;
}
else
{
$elements
[
$column
]
=
"<textarea name='data[
$column
]' cols=80 rows=25>"
.
$this
->
record
->
get
(
$column
)
.
"</textarea>
\n
"
;
}
}
return
$elements
[
$column
];
}
else
{
$this
->
index
++
;
if
(
$this
->
index
<
$this
->
count
)
return
self
::
current
();
}
}
public
function
key
()
{
$i
=
$this
->
index
;
return
$this
->
keys
[
$i
];
}
public
function
next
()
{
$this
->
index
++
;
}
public
function
rewind
()
{
$this
->
index
=
0
;
}
public
function
valid
()
{
if
(
$this
->
index
>=
$this
->
count
)
return
false
;
return
true
;
}
}
Doctrine/Identifier.php
View file @
80901aa7
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* This software consists of voluntary contributions made by many individuals
* and is licensed under the LGPL. For more information, see
* <http://www.phpdoctrine.com>.
*/
/**
* Doctrine_Identifier
*
* @author Konsta Vesterinen
* @package Doctrine ORM
* @url www.phpdoctrine.com
* @license LGPL
*/
class
Doctrine_Identifier
{
/**
* constant for auto_increment identifier
...
...
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