Programmatically add entries to an Entry field (craft\fields\Entries) I work with Craft 3.

I have an Entries field in a global set, I am able to get the global set, and then "read" this field programmatically (in a plugin) to fetch the entries that where added to it by looping on the EntryQuery data.

I want to be able to add another entry to this field via a php function in my plugin (so not in a Twig template), and then save the it, in the global set. The documentation is not very concrete on this part.
Thanks

here is my code : 

            $reglages = \craft\elements\GlobalSet::find()
            -&gt;handle('reglages')
            -&gt;one();

            $entries = [$entry-&gt;id];

            foreach($reglages-&gt;curatedHomepageArticles as $tmpEntry)  {
                $entries[] = $tmpEntry-&gt;id;
            }
            $entries = array_unique($entries);
            $entries = array_slice($entries, 0, 10);

            $reglages-&gt;curatedHomepageArticles = $entries;

            $return = Craft::$app-&gt;getGlobals()-&gt;saveSet($reglages);
            var_dump($return);


The point is to add the $entry to the entry field called curatedHomepageArticles with no duplicates. I am able to read the entries that are already in the entry field, and then build the array of ids called $entries but nothing happens when I try to update the field with a new list of entries id $entries. $return is true and there are no exceptions thrown. Can you help me understand what is going on here ?
If you are running on Craft 3, as of 3.4.0 (and really since the release of craft 3), setting custom field values directly like

$entry-&gt;customField = [id1, id2, id3];


is broken. You should instead use the setFieldValue or setFieldValues methods.

in your case, a relationship field can be set like so:

$reglages-&gt;setFieldValue(curatedHomepageArticles, [&lt;ARRAY OF ENTRY IDs]);