08.27
php
saved
rafaelbandeira3
Note
rafaelbandeira3.wordpress.com,
"Using MySQL functions with CakePHP on INSERT":
"Trying to use MySQL functions as field values on Model::save() is really frustrating as they are totally ignored by DboMysql::value(), and treated as strings, as I discoreved diving into DboSource's and DboMysql's [...]"
rafaelbandeira3.wordpress.com,
"Using MySQL functions with CakePHP on INSERT":
"Trying to use MySQL functions as field values on Model::save() is really frustrating as they are totally ignored by DboMysql::value(), and treated as strings, as I discoreved diving into DboSource's and DboMysql's [...]"
- class DboSource extends DataSource {
- [...]
- function value($data, $column = null) {
- /*
- * Here is where lies the hack
- * it's line 137 of cake/libs/model/datasources/dbo_source.php
- *
- */
- return $this->name($data->value);
- }
- return $data;
- } else {
- return null;
- }
- }
- [...]
- }
Parsed in 0.038 seconds, using GeSHi 1.0.7.14