W3cubDocs

/CakePHP 4.1

Interface ConstraintsInterface

Defines the interface for a fixture that needs to manage constraints.

If an implementation of Cake\Datasource\FixtureInterface also implements this interface, the FixtureManager will use these methods to manage a fixtures constraints.

Namespace: Cake\Database

Method Summary

  • createConstraints() public

    Build and execute SQL queries necessary to create the constraints for the fixture

  • dropConstraints() public

    Build and execute SQL queries necessary to drop the constraints for the fixture

Method Detail

createConstraints() public

createConstraints(\Cake\Datasource\ConnectionInterface $db)

Build and execute SQL queries necessary to create the constraints for the fixture

Parameters

\Cake\Datasource\ConnectionInterface $db

An instance of the database into which the constraints will be created.

Returns

bool

on success or if there are no constraints to create, or false on failure

dropConstraints() public

dropConstraints(\Cake\Datasource\ConnectionInterface $db)

Build and execute SQL queries necessary to drop the constraints for the fixture

Parameters

\Cake\Datasource\ConnectionInterface $db

An instance of the database into which the constraints will be dropped.

Returns

bool

on success or if there are no constraints to drop, or false on failure

© 2005–present The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/4.1/interface-Cake.Database.ConstraintsInterface.html