What are the acceptable types used in Class TypeMap in Cake 3.x?

Situation

using cake 3.2.4

Used a method addDefaults()to set the type decimal. The following is interesting:

  • What are the other types that I can install?
  • Is it possible to set the accuracy and scale when setting the decimal number in the method addDefaults()

Code that suggests thinking

       $this->paginate['fields'] = [
            'id', 'title', 
            'start' => 'start_date', 
            'end' => 'end_date', 
            'revenue', 
            'costs' => 'total_costs', 'collections'
        ];
        $paginationQuery  = $event->subject()->query;

        $paginationQuery
        ->selectTypeMap()
        ->addDefaults([
            'start' => 'datetime',
            'end' => 'datetime',
            'costs' => 'decimal'
        ]);

What i tried

I tried to study the documents

http://api.cakephp.org/3.2/class-Cake.Database.TypeMap.html#_addDefaults

as well as the class itself http://api.cakephp.org/3.2/source-class-Cake.Database.TypeMap.html#17-149

To no avail.

0
source share

Source: https://habr.com/ru/post/1656061/


All Articles