[Solar-talk] table scheme - require
Paul M Jones
pmjones at solarphp.com
Sat Jul 22 06:53:32 PDT 2006
On Jul 22, 2006, at 7:06 AM, Jeff Surgeson wrote:
> Hi Paul
>
> The way I understand your code is that the 'require' option will on
> auto
> create set the null/not null setting in database when creating the
> table.
>
> And then when validating if set to true will not allow a blank
> entry, correct?
>
> If so this does not seen to be the case (still ver21)
>
> If I use:
>
> $this->_col['title'] = array(
> 'type' => 'varchar',
> 'size' => 255,
> 'require' => true,
> );
>
> It allows blank entry even though it is specified as required.
... in the form, you mean, or at the database?
> So have have to specificaly validate for blank.
>
> $this->_col['title'] = array(
> 'type' => 'varchar',
> 'size' => 255,
> 'require' => true,
> 'valid' => 'notBlank',
> );
>
> Is this the way its meant to be?
That is the correct operation right now as far as forms are
concerned, but as we're discovering with other validation stuff, it's
dumb.
I'm looking at refactoring Solar_Sql_Table and Solar_Form_Load_Table
again so that all those "automatic" validation are generated at the
table, not at the form; also, so that that the field-type validations
are auto-added as part of the 'valid' array and not as a separate
validation routine inside table.
So for now you're stuck adding that yourself, but I'm working on
making it so you don't have to. Sorry for the trouble.
--
Paul M. Jones <http://paul-m-jones.com>
Solar: Simple Object Library and Application Repository
for PHP5. <http://solarphp.com>
Savant: The simple, elegant, and powerful solution for
templates in PHP. <http://phpsavant.com>
More information about the solar-talk
mailing list