cakephp 3.0 - Avoid ORM to return Cake\I18n\Time instance -


i have following data on db

  date           date         time +--------------+------------+----------------+ | initial_date | final_date | expected_hours | +--------------+------------+----------------+ | 2015-04-20   | 2015-05-24 | 13:00:00       | | 2015-04-13   | 2015-05-17 | 13:00:00       | +--------------+------------+----------------+ 

but when call

$this->set('weeks', $this->paginate($this->weeks)); 

it returns me cake\i18n\time instance on 3 columns, says here

how can avoid instance?

edit:

the reason want because when have 44:00:00on expected_hours fails with

datetime::modify(): failed parse time string (44:00:00) @ position 0 (4): un expected character 

this accepts 24:00:00 or less...

any ideas welcome

in weekstable class add this:

use cake\database\schema\table schema;  ... protected function _initializeschema(schema $schema) {     $schema->columntype('initial_date', 'string');     $schema->columntype('final_date', 'string');     $schema->columntype('expected_hours', 'string');      return $schema; } 

that force schema system treat columns strings.


Comments

Popular posts from this blog

c++ - No viable overloaded operator for references a map -

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - Cannot secure connection using TLS -