instride-ch/pimcore-data-definitions

PrimaryKeyLoader doesn't properly process NULL

Opened this issue · 3 comments

Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Branch? master

You have use cases where you need a composite primary key to actually contain NULL. This is currently not possible with the PrimaryKeyLoader.

The code might be something like

                    $value = $data[$map->getFromColumn()];
                    if ($value === null) {
                        $condition[] = '`'.$map->getToColumn().'` IS NULL';
                    } else {
                        $condition[] = '`'.$map->getToColumn().'` = ?';
                        $conditionValues[] = $value;
                    }

Yes, will do them all in one large effort, these are reminders for myself. :)

perfect, thanks a lot