Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix ViewTask generating links for self associations.
When getting the list of associations, self associations should be excluded. Refs #4440
- Loading branch information
Showing
3 changed files
with
62 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
tests/test_app/TestApp/Model/Table/CategoryThreadsTable.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
/** | ||
* CakePHP(tm) Tests <http://book.cakephp.org/2.0/en/development/testing.html> | ||
* Copyright 2005-2013, Cake Software Foundation, Inc. (http://cakefoundation.org) | ||
* | ||
* Licensed under The MIT License | ||
* Redistributions of files must retain the above copyright notice | ||
* | ||
* @since 3.0.0 | ||
* @license http://www.opensource.org/licenses/mit-license.php MIT License | ||
*/ | ||
namespace TestApp\Model\Table; | ||
|
||
use Cake\ORM\Table; | ||
|
||
/** | ||
* CategoryThreadsTable | ||
*/ | ||
class CategoryThreadsTable extends Table { | ||
|
||
public function initialize(array $config) { | ||
$this->table('category_threads'); | ||
$this->belongsTo('ParentCategoryThreads', [ | ||
'className' => __CLASS__, | ||
'foreignKey' => 'parent_id' | ||
]); | ||
$this->hasMany('ChildCategoryThreads', [ | ||
'className' => __CLASS__, | ||
'foreignKey' => 'parent_id' | ||
]); | ||
} | ||
|
||
} |