使用链接表值扩展模型。 在cakephp3

Started to learn cakephp3. Having two tables

Task
-id
-task_type

and

Task_content
-id
-task_id
-some_key
-sove_val

In the result i'd like to get some object, which looks like:

{
id: Task.id,
type: Task.type,
title: Task_content.some_val (where some_key == 'title')
content: Task_content.some_val (where some_key == 'conent')
}

What is the best way to get this object, just by getting Task via "get"?

You will need to crete a behavior to handle this. You can inspire from the TranslateBehavior, that does a very similar thing:

https://github.com/cakephp/cakephp/blob/master/src/ORM/Behavior/TranslateBehavior.php