CakePHP
  • Documentation
    • Book
    • API
    • Videos
    • Logos & Trademarks
  • Business Solutions
  • Swag
  • Road Trip
  • Team
  • Community
    • Community
    • Team
    • Issues (Github)
    • YouTube Channel
    • Get Involved
    • Bakery
    • Featured Resources
    • Newsletter
    • Certification
    • My CakePHP
    • CakeFest
    • Facebook
    • Twitter
    • Help & Support
    • Forum
    • Stack Overflow
    • IRC
    • Slack
    • Paid Support
CakePHP

C CakePHP 3.8 Red Velvet API

  • Overview
  • Tree
  • Deprecated
  • Version:
    • 3.8
      • 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

  • Cake
    • Auth
      • Storage
    • Cache
      • Engine
    • Collection
      • Iterator
    • Command
    • Console
      • Exception
    • Controller
      • Component
      • Exception
    • Core
      • Configure
        • Engine
      • Exception
      • Retry
    • Database
      • Driver
      • Exception
      • Expression
      • Schema
      • Statement
      • Type
    • Datasource
      • Exception
    • Error
      • Middleware
    • Event
      • Decorator
    • Filesystem
    • Form
    • Http
      • Client
        • Adapter
        • Auth
      • Cookie
      • Exception
      • Middleware
      • Session
    • I18n
      • Formatter
      • Middleware
      • Parser
    • Log
      • Engine
    • Mailer
      • Exception
      • Transport
    • Network
      • Exception
    • ORM
      • Association
      • Behavior
        • Translate
      • Exception
      • Locator
      • Rule
    • Routing
      • Exception
      • Filter
      • Middleware
      • Route
    • Shell
      • Helper
      • Task
    • TestSuite
      • Fixture
      • Stub
    • Utility
      • Exception
    • Validation
    • View
      • Exception
      • Form
      • Helper
      • Widget
  • None

Classes

  • ConnectionManager
  • ConnectionRegistry
  • FactoryLocator
  • Paginator
  • QueryCacher
  • ResultSetDecorator
  • RulesChecker

Interfaces

  • ConnectionInterface
  • EntityInterface
  • FixtureInterface
  • InvalidPropertyInterface
  • PaginatorInterface
  • QueryInterface
  • RepositoryInterface
  • ResultSetInterface
  • SchemaInterface
  • TableSchemaInterface

Traits

  • EntityTrait
  • ModelAwareTrait
  • QueryTrait
  • RulesAwareTrait

Interface ConnectionInterface

This interface defines the methods you can depend on in a connection.

Direct Implementers
  • Cake\Database\Connection
Namespace: Cake\Datasource
Location: Datasource/ConnectionInterface.php

Method Summary

  • config() public
    Get the configuration data used to create the connection.
  • configName() public
    Get the configuration name for this connection.
  • disableConstraints() public
    Run an operation with constraints disabled.
  • logQueries() public
    Enables or disables query logging for this connection.
  • logger() public deprecated

    Sets the logger object instance. When called with no arguments it returns the currently setup logger instance.

  • transactional() public

    Executes a callable function inside a transaction, if any exception occurs while executing the passed callable, the transaction will be rolled back If the result of the callable function is false, the transaction will also be rolled back. Otherwise the transaction is committed after executing the callback.

Method Detail

config() public ¶

config( )

Get the configuration data used to create the connection.

Returns
array

configName() public ¶

configName( )

Get the configuration name for this connection.

Returns
string

disableConstraints() public ¶

disableConstraints( callable $operation )

Run an operation with constraints disabled.

Constraints should be re-enabled after the callback succeeds/fails.

Parameters
callable $operation
The callback to execute within a transaction.
Returns
mixed
The return value of the callback.
Throws
Exception

Will re-throw any exception raised in $callback after rolling back the transaction.


logQueries() public ¶

logQueries( boolean|null $enable = null )

Enables or disables query logging for this connection.

Parameters
boolean|null $enable optional null

whether to turn logging on or disable it. Use null to read current value.

Returns
boolean

logger() public deprecated ¶

logger( object|null $instance = null )

Sets the logger object instance. When called with no arguments it returns the currently setup logger instance.

Deprecated
3.5.0 Will be replaced by getLogger()/setLogger()
Parameters
object|null $instance optional null
logger object instance
Returns
object
logger instance

transactional() public ¶

transactional( callable $transaction )

Executes a callable function inside a transaction, if any exception occurs while executing the passed callable, the transaction will be rolled back If the result of the callable function is false, the transaction will also be rolled back. Otherwise the transaction is committed after executing the callback.

The callback will receive the connection instance as its first argument.

Parameters
callable $transaction
The callback to execute within a transaction.
Returns
mixed
The return value of the callback.
Throws
Exception

Will re-throw any exception raised in $callback after rolling back the transaction.


Magic methods summary

execute() public ¶

execute( $query , $params = , array $types = )

Parameters
$query
$params optional
array $types optional
Returns
Cake\Database\StatementInterface

getLogger() public ¶

getLogger( )

Get the current logger instance

Returns
object

getSchemaCollection() public ¶

getSchemaCollection( )

Returns
Cake\Database\Schema\Collection

isQueryLoggingEnabled() public ¶

isQueryLoggingEnabled( )

Returns
boolean

newQuery() public ¶

newQuery( )

Returns
Cake\Database\Query

prepare() public ¶

prepare( $sql )

Parameters
$sql
Returns
Cake\Database\StatementInterface

quote() public ¶

quote( $value , $type = )

Parameters
$value
$type optional
Returns
string

supportsDynamicConstraints() public ¶

supportsDynamicConstraints( )

Returns
boolean
Follow @CakePHP
#IRC
OpenHub
Rackspace
  • Business Solutions
  • Showcase
  • Documentation
  • Book
  • API
  • Videos
  • Logos & Trademarks
  • Community
  • Team
  • Issues (Github)
  • YouTube Channel
  • Get Involved
  • Bakery
  • Featured Resources
  • Newsletter
  • Certification
  • My CakePHP
  • CakeFest
  • Facebook
  • Twitter
  • Help & Support
  • Forum
  • Stack Overflow
  • IRC
  • Slack
  • Paid Support

Generated using CakePHP API Docs