• PHP reference
  • Models
  • Traits

HasPrivateDatabase

trait Models\Traits\HasPrivateDatabase

Adds methods to a Model instance that enable those types of entities to have their own private MySQL database.

Methods

array getDatabaseCredentials()

Get an array containing keys database, hostname, username, password, which can be used to create a connection to the private database from a module.

Return Value

  • array

DB getDatabase()

Get a database instance that is connected to the model-specific private database.

Return Value

See also

  • https://docs.includable.com/components/community-databases/