CakePHP
  • Documentation
    • Book
    • API
    • Videos
    • Reporting Security Issues
    • Privacy Policy
    • Logos & Trademarks
  • Business Solutions
  • Swag
  • Road Trip
  • Team
  • Community
    • Community
    • Get Involved
    • Issues (Github)
    • Bakery
    • Featured Resources
    • Training
    • Meetups
    • My CakePHP
    • CakeFest
    • Newsletter
    • Linkedin
    • YouTube
    • Facebook
    • Twitter
    • Mastodon
    • Help & Support
    • Forum
    • Stack Overflow
    • IRC
    • Slack
    • Paid Support
CakePHP

C CakePHP 4.6 Strawberry API

  • Project:
    • CakePHP
      • CakePHP
      • Authentication
      • Authorization
      • Chronos
      • Elastic Search
      • Queue
  • Version:
    • 4.6
      • 5.2
      • 5.1
      • 5.0
      • 4.6
      • 4.5
      • 4.4
      • 4.3
      • 4.2
      • 4.1
      • 4.0
      • 3.10
      • 3.9
      • 3.8
      • 3.7
      • 3.6
      • 3.5
      • 3.4
      • 3.3
      • 3.2
      • 3.1
      • 3.0
      • 2.10
      • 2.9
      • 2.8
      • 2.7
      • 2.6
      • 2.5
      • 2.4
      • 2.3
      • 2.2
      • 2.1
      • 2.0
      • 1.3
      • 1.2

Namespaces

  • Global
  • Cake
    • Auth
    • Cache
    • Collection
    • Command
    • Console
    • Controller
    • Core
    • Database
      • Driver
      • Exception
      • Expression
      • Log
      • Query
      • Retry
      • Schema
      • Statement
      • Type
    • Datasource
    • Error
    • Event
    • Filesystem
    • Form
    • Http
    • I18n
    • Log
    • Mailer
    • Network
    • ORM
    • Routing
    • Shell
    • TestSuite
    • Utility
    • Validation
    • View

Class TypeFactory

Factory for building database type classes.

Namespace: Cake\Database

Property Summary

  • $_builtTypes protected static
    array<Cake\Database\TypeInterface>

    Contains a map of type object instances to be reused if needed.

  • $_types protected static
    array<string, string>

    List of supported database types. A human readable identifier is used as key and a complete namespaced class name as value representing the class that will do actual type conversions.

Method Summary

  • build() public static

    Returns a Type object capable of converting a type identified by name.

  • buildAll() public static

    Returns an arrays with all the mapped type objects, indexed by name.

  • clear() public static

    Clears out all created instances and mapped types classes, useful for testing

  • getMap() public static

    Get mapped class name for given type or map array.

  • map() public static

    Registers a new type identifier and maps it to a fully namespaced classname.

  • set() public static

    Set TypeInterface instance capable of converting a type identified by $name

  • setMap() public static

    Set type to classname mapping.

Method Detail

build() ¶ public static

build(string $name): Cake\Database\TypeInterface

Returns a Type object capable of converting a type identified by name.

Parameters
string $name

type identifier

Returns
Cake\Database\TypeInterface
Throws
InvalidArgumentException
If type identifier is unknown

buildAll() ¶ public static

buildAll(): array<Cake\Database\TypeInterface>

Returns an arrays with all the mapped type objects, indexed by name.

Returns
array<Cake\Database\TypeInterface>

clear() ¶ public static

clear(): void

Clears out all created instances and mapped types classes, useful for testing

Returns
void

getMap() ¶ public static

getMap(string|null $type = null): array<string>|string|null

Get mapped class name for given type or map array.

Parameters
string|null $type optional

Type name to get mapped class for or null to get map array.

Returns
array<string>|string|null

map() ¶ public static

map(string $type, string $className): void

Registers a new type identifier and maps it to a fully namespaced classname.

Parameters
string $type

Name of type to map.

string $className

The classname to register.

Returns
void

set() ¶ public static

set(string $name, Cake\Database\TypeInterface $instance): void

Set TypeInterface instance capable of converting a type identified by $name

Parameters
string $name

The type identifier you want to set.

Cake\Database\TypeInterface $instance

The type instance you want to set.

Returns
void

setMap() ¶ public static

setMap(array<string> $map): void

Set type to classname mapping.

Parameters
array<string> $map

List of types to be mapped.

Returns
void

Property Detail

$_builtTypes ¶ protected static

Contains a map of type object instances to be reused if needed.

Type
array<Cake\Database\TypeInterface>

$_types ¶ protected static

List of supported database types. A human readable identifier is used as key and a complete namespaced class name as value representing the class that will do actual type conversions.

Type
array<string, string>
OpenHub
Pingping
Linode
  • Business Solutions
  • Showcase
  • Documentation
  • Book
  • API
  • Videos
  • Reporting Security Issues
  • Privacy Policy
  • Logos & Trademarks
  • Community
  • Get Involved
  • Issues (Github)
  • Bakery
  • Featured Resources
  • Training
  • Meetups
  • My CakePHP
  • CakeFest
  • Newsletter
  • Linkedin
  • YouTube
  • Facebook
  • Twitter
  • Mastodon
  • Help & Support
  • Forum
  • Stack Overflow
  • IRC
  • Slack
  • Paid Support

Generated using CakePHP API Docs