mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-09 21:12:41 +00:00
Fixing cascading delete, when using foreignKey false and setting condition on hasOne.
This commit is contained in:
parent
87a8af420f
commit
b5c4b85601
6 changed files with 265 additions and 5 deletions
|
@ -1001,6 +1001,69 @@ class Bid extends CakeTestModel {
|
|||
public $belongsTo = array('Message');
|
||||
}
|
||||
|
||||
/**
|
||||
* BiddingMessage class
|
||||
*
|
||||
* @package Cake.Test.Case.Model
|
||||
*/
|
||||
class BiddingMessage extends CakeTestModel {
|
||||
|
||||
/**
|
||||
* name property
|
||||
*
|
||||
* @var string 'BiddingMessage'
|
||||
*/
|
||||
public $name = 'BiddingMessage';
|
||||
|
||||
/**
|
||||
* primaryKey property
|
||||
*
|
||||
* @var string 'bidding'
|
||||
*/
|
||||
public $primaryKey = 'bidding';
|
||||
|
||||
|
||||
/**
|
||||
* belongsTo property
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $belongsTo = array(
|
||||
'Bidding' => array(
|
||||
'foreignKey' => false,
|
||||
'conditions' => array('BiddingMessage.bidding = Bidding.bid')
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Bidding class
|
||||
*
|
||||
* @package Cake.Test.Case.Model
|
||||
*/
|
||||
class Bidding extends CakeTestModel {
|
||||
|
||||
/**
|
||||
* name property
|
||||
*
|
||||
* @var string 'Bidding'
|
||||
*/
|
||||
public $name = 'Bidding';
|
||||
|
||||
/**
|
||||
* hasOne property
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $hasOne = array(
|
||||
'BiddingMessage' => array(
|
||||
'foreignKey' => false,
|
||||
'conditions' => array('BiddingMessage.bidding = Bidding.bid'),
|
||||
'dependent' => true
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* NodeAfterFind class
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue