private function getTargetField($meta, $parentMeta, $value)
    {
        if (count($parentMeta->parentClasses) > 0) {
            foreach ($parentMeta->parentClasses as $classe) {
                $associationsByTargetClass = $meta->getAssociationsByTargetClass($classe);
                if (count($associationsByTargetClass) > 0) {
                    $parentTable = lcfirst(substr($classe, strrpos($classe, strpos($classe, '\\') !== false ? '\\' : '/') + 1));
                    $field = $this->searchAssociationField($associationsByTargetClass, $parentTable, $value);
                    if ($field) {
                        return $field;
                    }
                }
            }
        }
        $associationsByTargetClass = $meta->getAssociationsByTargetClass($parentMeta->getName());
        $field = $this->searchAssociationField($associationsByTargetClass, lcfirst($parentMeta->getTableName()), $value);
        if ($field) {
            return $field;
        }

        return $meta->getIdentifierColumnNames()[0];
    }