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
11206fe5
Commit
11206fe5
authored
Oct 08, 2006
by
zYne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small fixes, now it should be possible to add custom errors
parent
67da38b0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
4 deletions
+13
-4
Record.php
lib/Doctrine/Record.php
+3
-1
ErrorStack.php
lib/Doctrine/Validator/ErrorStack.php
+10
-3
No files found.
lib/Doctrine/Record.php
View file @
11206fe5
...
...
@@ -834,7 +834,9 @@ abstract class Doctrine_Record extends Doctrine_Access implements Countable, Ite
$saveLater
=
$conn
->
saveRelated
(
$this
);
if
(
!
$this
->
isValid
())
{
$this
->
isValid
();
if
(
$this
->
errorStack
->
count
()
>
0
)
{
$conn
->
getTransaction
()
->
addInvalid
(
$this
);
}
else
{
$conn
->
save
(
$this
);
...
...
lib/Doctrine/Validator/ErrorStack.php
View file @
11206fe5
...
...
@@ -26,7 +26,7 @@ Doctrine::autoload('Doctrine_Access');
* @license LGPL
* @package Doctrine
*/
class
Doctrine_Validator_ErrorStack
extends
Doctrine_Access
{
class
Doctrine_Validator_ErrorStack
extends
Doctrine_Access
implements
Countable
,
IteratorAggregate
{
private
$errors
=
array
();
...
...
@@ -42,8 +42,15 @@ class Doctrine_Validator_ErrorStack extends Doctrine_Access {
return
null
;
}
public
function
set
(
$name
,
$value
)
{
$this
->
errors
[
$name
]
=
$value
;
$this
->
errors
[
$name
]
=
$value
;
}
public
function
getIterator
()
{
return
new
ArrayIterator
(
$this
->
errors
);
}
public
function
count
()
{
return
count
(
$this
->
errors
);
}
}
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