0

i have a question which aims more on an general understanding, then a technical problem.

i have a table named people which associates to another table named properties. This "Properties" table has a hasOne association with a table named "Propertyowners".

Pseudocode:

People->hasMany(Properties)
        Properties-hasOne(Propertyowner)

In my "People" model i would like to specify that only properties are associated with a propertyowner.owner(field) equals 'Person'. Thinking back and forth this would be the easiest way to define properties e.g. for a table name "cars" or "ships" to share the same propertytable in a somehow dynamic way but is this the way to go in cakephp 4? On the other hand i am experimenting since about half a day to modify my "People" table to perform like this and i am stuck due to missing a working example regardless of the very detailed documentation.

Is there somebody able to give me a hint where to look at or how my association should look like?

Or maybe somebody tells me if i am complete on the wrong way.

best regards

0 Answers0