-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for multilevel embed via 'associated' option
Also supports parsing options through to embeds (for example 'accessibleFields')
- Loading branch information
Showing
5 changed files
with
261 additions
and
20 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
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,9 @@ | ||
<?php | ||
|
||
namespace TestApp\Model\Document; | ||
|
||
use Cake\ElasticSearch\Document; | ||
|
||
class User extends Document | ||
{ | ||
} |
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,25 @@ | ||
<?php | ||
|
||
namespace TestApp\Model\Index; | ||
|
||
use Cake\ElasticSearch\Index; | ||
|
||
class AccountsIndex extends Index | ||
{ | ||
public function initialize(array $config) | ||
{ | ||
parent::initialize($config); | ||
|
||
$this->embedMany('User', ['property' => 'users']); | ||
} | ||
|
||
public function getName() | ||
{ | ||
return 'accounts'; | ||
} | ||
|
||
public function getType() | ||
{ | ||
return 'accounts'; | ||
} | ||
} |
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,26 @@ | ||
<?php | ||
|
||
namespace TestApp\Model\Index; | ||
|
||
use Cake\ElasticSearch\Index; | ||
|
||
class UsersIndex extends Index | ||
{ | ||
|
||
public function initialize(array $config) | ||
{ | ||
parent::initialize($config); | ||
|
||
$this->embedOne('UserType'); | ||
} | ||
|
||
public function getName() | ||
{ | ||
return 'users'; | ||
} | ||
|
||
public function getType() | ||
{ | ||
return 'users'; | ||
} | ||
} |