cphalcon icon indicating copy to clipboard operation
cphalcon copied to clipboard

how to define property data type

Open shangxin2533 opened this issue 8 years ago • 2 comments

1.I want to define date_type in model,but it does't effect,below is my model:

class Canvases extends Model { /** * @var integer / public $id; /* * @var string */ public $name; } 2.$ret = $canvasModel->findFirstById(1), var_dump($ret->id); the id type is string

shangxin2533 avatar Dec 16 '17 02:12 shangxin2533

You need to use mysqlnd driver and have

                PDO::ATTR_EMULATE_PREPARES   => false,
                PDO::ATTR_STRINGIFY_FETCHES  => false,
                PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8',

in db service.

Jurigag avatar Dec 18 '17 10:12 Jurigag

We only accept bug reports, new feature requests and pull requests in GitHub. For questions regarding the usage of the framework, support requests, and questions like this please visit the official forums.

sergeyklay avatar Dec 22 '17 13:12 sergeyklay