[Doctrine] #1652: New constant 'Doctrine::VALIDATE_USER'

6 views
Skip to first unread message

Doctrine

unread,
Nov 7, 2008, 5:45:08 AM11/7/08
to doctri...@googlegroups.com
#1652: New constant 'Doctrine::VALIDATE_USER'
-----------------------------------+----------------------------------------
Reporter: floriank | Owner: jwage
Type: enhancement | Status: new
Priority: minor | Milestone: 1.1.0
Component: Attributes | Version: 1.1-DEV
Keywords: validation | Has_test: 1
Mystatus: Pending Core Response | Has_patch: 1
-----------------------------------+----------------------------------------
I'm missing a constant to control validation process in Doctrine to only
check self-written Record->validate() methods without validating datatypes
/ lengths / constraints (see testcase).

A possible solution would be to add a constant Doctrine::VALIDATE_USER
(see patch). This patch breaks none of the testcases in Doctrine 1.1's
testsuite.

--
Ticket URL: <http://trac.doctrine-project.org/ticket/1652>
Doctrine <http://www.phpdoctrine.org>
PHP Doctrine Object Relational Mapper

Doctrine

unread,
Nov 7, 2008, 4:38:32 PM11/7/08
to doctri...@googlegroups.com
#1652: New constant 'Doctrine::VALIDATE_USER'
--------------------------+-------------------------------------------------
Reporter: floriank | Owner: jwage
Type: enhancement | Status: new
Priority: minor | Milestone: 1.1.0
Component: Attributes | Version: 1.1-DEV
Resolution: | Keywords: validation
Has_test: 1 | Mystatus: Pending Core Response
Has_patch: 1 |
--------------------------+-------------------------------------------------
Comment (by romanb):

You can already disable length/type validations. I dont remember the
constant names right now. SOmething like
ATTR_VALIDATE_LENGTH/ATTR_VALIDATE_TYPE. Is that not sufficient?

--
Ticket URL: <http://trac.doctrine-project.org/ticket/1652#comment:1>

Doctrine

unread,
Nov 7, 2008, 5:06:20 PM11/7/08
to doctri...@googlegroups.com
#1652: New constant 'Doctrine::VALIDATE_USER'
--------------------------+-------------------------------------------------
Reporter: floriank | Owner: jwage
Type: enhancement | Status: new
Priority: minor | Milestone: 1.1.0
Component: Attributes | Version: 1.1-DEV
Resolution: | Keywords: validation
Has_test: 1 | Mystatus: Pending Core Response
Has_patch: 1 |
--------------------------+-------------------------------------------------
Comment (by floriank):

Replying to [comment:1 romanb]:
> I dont remember the constant names right now.
It is
{{{
Doctrine_Manager::getInstance()->setAttribute(Doctrine::ATTR_VALIDATE,
Doctrine::VALIDATE_ALL &
~Doctrine::VALIDATE_LENGTHS &
~Doctrine::VALIDATE_CONSTRAINTS &
~Doctrine::VALIDATE_TYPES);

}}}

I want to disable all validation except the validate()-method of the
Records, which is not possible because the code above is the same as

{{{
Doctrine_Manager::getInstance()->setAttribute(Doctrine::ATTR_VALIDATE,
Doctrine::VALIDATE_NONE);
}}}

what results in a static return of true in Record->isValid().

--
Ticket URL: <http://trac.doctrine-project.org/ticket/1652#comment:2>

Doctrine

unread,
Dec 1, 2008, 2:37:21 PM12/1/08
to doctri...@googlegroups.com
#1652: New constant 'Doctrine::VALIDATE_USER'
-----------------------------------+----------------------------------------
Reporter: floriank | Owner: jwage
Type: enhancement | Status: new
Priority: minor | Milestone: 1.1.0
Component: Attributes | Version: 1.1-DEV
Keywords: validation | Has_test: 1
Mystatus: Pending Core Response | Has_patch: 1
-----------------------------------+----------------------------------------

Comment(by jwage):

I don't understand your patch. It adds the constant but does not use it
anywhere?

--
Ticket URL: <http://trac.doctrine-project.org/ticket/1652#comment:3>

Doctrine

unread,
Dec 1, 2008, 2:38:13 PM12/1/08
to doctri...@googlegroups.com
#1652: New constant 'Doctrine::VALIDATE_USER'
-----------------------------------+----------------------------------------
Reporter: floriank | Owner: jwage
Type: enhancement | Status: new
Priority: minor | Milestone: 1.2.0
Component: Attributes | Version: 1.1-DEV
Keywords: validation | Has_test: 1
Mystatus: Pending Core Response | Has_patch: 1
-----------------------------------+----------------------------------------
Changes (by jwage):

* milestone: 1.1.0 => 1.2.0


--
Ticket URL: <http://trac.doctrine-project.org/ticket/1652#comment:4>

Doctrine

unread,
Dec 2, 2008, 2:35:23 AM12/2/08
to doctri...@googlegroups.com
#1652: New constant 'Doctrine::VALIDATE_USER'
-----------------------------------+----------------------------------------
Reporter: floriank | Owner: jwage
Type: enhancement | Status: new
Priority: minor | Milestone: 1.2.0
Component: Attributes | Version: 1.1-DEV
Keywords: validation | Has_test: 1
Mystatus: Pending Core Response | Has_patch: 1
-----------------------------------+----------------------------------------

Comment(by floriank):

Replying to [comment:3 jwage]:

> I don't understand your patch. It adds the constant but does not use it
anywhere?

Take a look at my testcase: It's used in there ([http://trac.doctrine-
project.org/attachment/ticket/1652/1652TestCase.php#L53]). The constant is
not used anywhere else in Doctrine since it is an ''additional'' option
for validation to only run user-defined validate()-methods without beeing
forced to use type/length/constraint-validations.

--
Ticket URL: <http://trac.phpdoctrine.org/ticket/1652#comment:5>

Reply all
Reply to author
Forward
0 new messages