[TYPO3-core] RFC #15457: Add support for prepared queries [summary and pending questions]

Ernesto Baschny [cron IT] ernst at cron-it.de
Thu Aug 19 15:42:13 CEST 2010


Jigal van Hemert schrieb am 19.08.2010 15:07:
> (...)
>>  > Remove method bindValues()
>> I do not see the downside of having it if we default to PARAM_STR
>> instead of the would-not-exist-anymore PARAM_AUTOTYPE. This way, it
>> would behave as when providing parameters in method execute(). But I
> 
> I also like Ernesto's idea of letting bindValues() and execute() use the
> behaviour of PARAM_AUTOTYPE internally. Of course this needs to be
> documented. My only "if" here is that PARAM_INT is only used for
> integers and not for anything that passes the is_numeric() test.

Exaclty my thought, which is why I removed all is_numeric tests from v4.
The current "magic" is:

if (is_bool($value)) {
  $type = self::PARAM_BOOL;
} elseif (t3lib_div::testInt($value)) {
  $type = self::PARAM_INT;
} elseif (is_null($value) || strtoupper($value) === 'NULL') {
  $type = self::PARAM_NULL;
} else {
  $type = self::PARAM_STR;
}

So pretty easy to understand and document. Only concearn might be
"testInt()", which allows also strings that looks like integer ('1' =>
1). I would not oppose to change that to is_int() to have it more strict.


Cheers,
Ernesto


More information about the TYPO3-team-core mailing list