Associations and types in cake 3

Hi all,

I need a function that return me Associations and types from my model. Like as …

$associations = $this->myModel->getAssociations();
//ouput

[
 'belongsTo' => ['model1','model2'],
 'hasMany' => ['model1','model2,'model3']
]

i have only name of my associations with a code:
$associations = $this->myModel->associations()->keys();
but i have not types.

You should be able to use $this->associations()->type(‘BelongsTo’); //HasMany, etc.

ok ali, it’s works fine. thanks.

ok ali, works fine. thanks.