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
155f5193
Commit
155f5193
authored
Aug 31, 2006
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New fetchmode constants (implementation later)
parent
f11fe0ca
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
2 deletions
+64
-2
Doctrine.php
Doctrine.php
+55
-1
RecordTestCase.php
tests/RecordTestCase.php
+9
-1
No files found.
Doctrine.php
View file @
155f5193
...
...
@@ -227,12 +227,66 @@ final class Doctrine {
const
FETCH_VHOLDER
=
1
;
/**
* FETCH RECORD
*
* Specifies that the fetch method shall return Doctrine_Record
* objects as the elements of the result set.
*
* This is the default fetchmode.
*/
const
FETCH_RECORD
=
2
;
/**
* FETCH ARRAY
*/
const
FETCH_ARRAY
=
3
;
/**
* FETCH COLUMN
* Specifies that the fetch method shall return only a single
* requested column from the next row in the result set.
*
*/
const
FETCH_COLUMN
=
4
;
/**
* FETCH ASSOC
*
* Specifies that the fetch method shall return each row as an
* array indexed by column name as returned in the corresponding
* result set. If the result set contains multiple columns with
* the same name, PDO::FETCH_ASSOC returns only a single value per column name.
*
*/
const
FETCH_ASSOC
=
5
;
/**
* FETCH NAMED
*
* Specifies that the fetch method shall return each row as an array indexed
* by column name as returned in the corresponding result set. If the result set
* contains multiple columns with the same name, PDO::FETCH_NAMED returns an
* array of values per column name.
*
*/
const
FETCH_NAMED
=
6
;
/**
* FETCH NUM
*
* Specifies that the fetch method shall return each row as an array indexed by
* column number as returned in the corresponding result set, starting at column 0.
*/
const
FETCH_NUM
=
7
;
/**
* FETCH BOTH
*
* Specifies that the fetch method shall return each row as an array indexed by both
* column name and number as returned in the corresponding result set, starting at column 0.
*/
const
FETCH_BOTH
=
8
;
/**
* FETCH OBJ
*
* Specifies that the fetch method shall return each row as an object with property names
* that correspond to the column names returned in the result set.
*/
const
FETCH_OBJ
=
9
;
/**
...
...
tests/RecordTestCase.php
View file @
155f5193
...
...
@@ -44,8 +44,13 @@ class Doctrine_RecordTestCase extends Doctrine_UnitTestCase {
$this
->
assertEqual
(
$e
->
Entity
[
0
]
->
getState
(),
Doctrine_Record
::
STATE_TDIRTY
);
$this
->
assertEqual
(
$e
->
Entity
[
1
]
->
getState
(),
Doctrine_Record
::
STATE_TDIRTY
);
$count
=
count
(
$this
->
dbh
);
$e
->
save
();
$this
->
assertEqual
((
$count
+
13
),
$this
->
dbh
->
count
());
$this
->
assertEqual
(
$e
->
getState
(),
Doctrine_Record
::
STATE_CLEAN
);
$this
->
assertTrue
(
$e
->
Entity
[
0
]
instanceof
Entity
);
$this
->
assertTrue
(
$e
->
Entity
[
1
]
instanceof
Entity
);
...
...
@@ -61,9 +66,12 @@ class Doctrine_RecordTestCase extends Doctrine_UnitTestCase {
$this
->
assertEqual
(
$e
->
Entity
[
0
]
->
getState
(),
Doctrine_Record
::
STATE_CLEAN
);
$this
->
assertEqual
(
$e
->
Entity
[
1
]
->
getState
(),
Doctrine_Record
::
STATE_CLEAN
);
$this
->
assertTrue
(
is_numeric
(
$e
->
id
));
$e
=
$e
->
getTable
()
->
find
(
$e
->
id
);
$this
->
assertTrue
(
$e
instanceof
Entity
);
$this
->
assertTrue
(
$e
->
Entity
[
0
]
instanceof
Entity
);
$this
->
assertTrue
(
$e
->
Entity
[
1
]
instanceof
Entity
);
...
...
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