Save items from multiple select - array values

I have table products_items_colors but colors in array PHP - both column is primary key.

In table is fields:

products_item_id - int
color -int
$color = [
    1 => 'Black',
    2 => 'Green',
    3 => 'Blue',
];

Form is:

echo $this->Form->control('products_items_colors._ids', [
    'type' => 'select',
    'multiple' => true,
    'options' => [
        1 => 'Black',
        2 => 'Green',
        3 => 'Blue',
    ],
]);

In model ProductsItems table

$this->hasMany('ProductsItemsColors', [
    'foreignKey' => 'products_item_id',
]);

In model ProductsItemsColors table

$this->setTable('products_items_colors');
$this->setDisplayField(['color', 'products_item_id']);
$this->setPrimaryKey(['color', 'products_item_id']);

$this->belongsTo('ProductsItems', [
    'foreignKey' => 'products_item_id',
    'joinType' => 'INNER',
]);

After save form - patch entity does not contain items. But if I put data into the database, the form shows me the values.

How do I save this data to a table?

make sure products_items_colors is set as asscessible in your entity class src/Model/Entity/MyEntity.php

    protected $_accessible = [
        // other fields
        'products_items_colors' => true,
    ];

Yes it is - src/Model/Entity/ProductItem.php

After patch entity result is:

'products_items_colors' => [ ]

Probably this should be in the ProductsItems table, I just don’t know how to set the parameters exactly … if I use _ids in the form

$this->belongsToMany('ProductsItemsColors', [
    'foreignKey' => 'products_item_id',
    ...
]);