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.
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