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
da6f4a38
Commit
da6f4a38
authored
Oct 14, 2006
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #166
parent
2e8f73db
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
191 additions
and
187 deletions
+191
-187
Collection.php
lib/Doctrine/Collection.php
+1
-1
Hydrate.php
lib/Doctrine/Hydrate.php
+2
-2
Record.php
lib/Doctrine/Record.php
+181
-178
Advanced components - Validators - More Validation.php
...es/Advanced components - Validators - More Validation.php
+1
-1
classes.php
tests/classes.php
+3
-3
run.php
tests/run.php
+3
-2
No files found.
lib/Doctrine/Collection.php
View file @
da6f4a38
...
...
@@ -481,7 +481,7 @@ class Doctrine_Collection extends Doctrine_Access implements Countable, Iterator
* @param Doctrine_Record $record
* @return void
*/
public
function
set
(
$key
,
Doctrine_Record
$record
)
{
public
function
set
(
$key
,
Doctrine_Record
$record
)
{
if
(
isset
(
$this
->
reference_field
))
$record
->
set
(
$this
->
reference_field
,
$this
->
reference
,
false
);
...
...
lib/Doctrine/Hydrate.php
View file @
da6f4a38
...
...
@@ -321,11 +321,11 @@ abstract class Doctrine_Hydrate extends Doctrine_Access {
$stmt
=
$this
->
connection
->
execute
(
$query
,
$params
);
if
(
$this
->
aggregate
)
if
(
$this
->
aggregate
)
return
$stmt
->
fetchAll
(
PDO
::
FETCH_ASSOC
);
if
(
count
(
$this
->
tables
)
==
0
)
throw
new
Doctrine_
Exception
(
"No table
s selected"
);
throw
new
Doctrine_
Query_Exception
(
"No component
s selected"
);
$keys
=
array_keys
(
$this
->
tables
);
$root
=
$keys
[
0
];
...
...
lib/Doctrine/Record.php
View file @
da6f4a38
This diff is collapsed.
Click to expand it.
manual/codes/Advanced components - Validators - More Validation.php
View file @
da6f4a38
...
...
@@ -15,7 +15,7 @@ class User extends Doctrine_Record {
if
(
$this
->
name
==
'God'
)
{
// Blasphemy! Stop that! ;-)
// syntax: add(<fieldName>, <error code/identifier>)
$this
->
errorStack
->
add
(
'name'
,
'forbiddenName'
);
$this
->
getErrorStack
()
->
add
(
'name'
,
'forbiddenName'
);
}
}
}
...
...
tests/classes.php
View file @
da6f4a38
...
...
@@ -101,17 +101,17 @@ class User extends Entity {
public
function
validate
()
{
// Allow only one name!
if
(
$this
->
name
!==
'The Saint'
)
{
$this
->
errorStack
->
add
(
'name'
,
'notTheSaint'
);
$this
->
getErrorStack
()
->
add
(
'name'
,
'notTheSaint'
);
}
}
public
function
validateOnInsert
()
{
if
(
$this
->
password
!==
'Top Secret'
)
{
$this
->
errorStack
->
add
(
'password'
,
'pwNotTopSecret'
);
$this
->
getErrorStack
()
->
add
(
'password'
,
'pwNotTopSecret'
);
}
}
public
function
validateOnUpdate
()
{
if
(
$this
->
loginname
!==
'Nobody'
)
{
$this
->
errorStack
->
add
(
'loginname'
,
'notNobody'
);
$this
->
getErrorStack
()
->
add
(
'loginname'
,
'notNobody'
);
}
}
}
...
...
tests/run.php
View file @
da6f4a38
...
...
@@ -52,17 +52,18 @@ error_reporting(E_ALL);
print
"<pre>"
;
$test
=
new
GroupTest
(
"Doctrine Framework Unit Tests"
);
$test
->
addTestCase
(
new
Doctrine_RecordTestCase
());
$test
->
addTestCase
(
new
Doctrine_ValidatorTestCase
());
$test
->
addTestCase
(
new
Doctrine_Query_MultiJoin_TestCase
());
$test
->
addTestCase
(
new
Doctrine_Relation_TestCase
());
$test
->
addTestCase
(
new
Doctrine_EventListenerTestCase
());
$test
->
addTestCase
(
new
Doctrine_RecordTestCase
());
$test
->
addTestCase
(
new
Doctrine_Connection_Transaction_TestCase
());
$test
->
addTestCase
(
new
Doctrine_ConnectionTestCase
());
...
...
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