mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
avoid duplication in returned results for habtm
This commit is contained in:
parent
88604ac757
commit
fb0053753e
2 changed files with 2 additions and 1 deletions
|
@ -1755,7 +1755,7 @@ class Model extends Object implements CakeEventListener {
|
|||
$this->getEventManager()->dispatch($event);
|
||||
}
|
||||
if (!empty($this->data)) {
|
||||
$success = Hash::merge($success, $this->data);
|
||||
$success = array_merge($success, $this->data);
|
||||
}
|
||||
$this->data = false;
|
||||
$this->_clearCache();
|
||||
|
|
|
@ -1170,6 +1170,7 @@ class ModelWriteTest extends BaseModelTest {
|
|||
$this->assertFalse(empty($result));
|
||||
$result = $TestModel->save();
|
||||
$this->assertFalse(empty($result));
|
||||
$this->assertEquals($data['Tag'], $result['Tag']);
|
||||
|
||||
$TestModel->unbindModel(array('belongsTo' => array('User'), 'hasMany' => array('Comment')));
|
||||
$result = $TestModel->find('first', array('fields' => array('id', 'user_id', 'title', 'body'), 'conditions' => array('Article.id' => 2)));
|
||||
|
|
Loading…
Add table
Reference in a new issue