How to add item into a paragraphs I'm trying to create Paragraphs programatically, to store an Indesign File with the images linked to it, so I have my paragraph type with some fields


field_indesign_file : (limited to one value)
field_indesign_image : (illimited number of images) 


Currently the creation is OK :

$paragraph = Paragraph::create([
  'type' =&gt; 'indesign',
  'field_indesign_file' =&gt; [
    'target_id' =&gt; $indesign-&gt;id(),
  ],
  'field_indesign_image' =&gt; [
    'target_id' =&gt; ${'image'.'3'}-&gt;id(),
  ],
]);


but I don't know in advance how many pictures I'll have attached to the indesign file, so Id' like to be able to add other values to the field_indesign_image.

I tried using

$paragraph-&gt;field_indesign_image[LANGUAGE_NONE][1]['value'] = [ 
        'target_id' =&gt; ${'image'.'1'}-&gt;id() 
    ];

and 

$paragraph-&gt;field_indesign_image-&gt;appendItem(
      [
        'target_id', ${'image'.'3'}-&gt;id()
      ]
    );

but none of this method worked, I didn't find a lot of documentation and sometimes answers to other topic are a bit too complicated for me to understand since I'm a beginner at drupal 8.
Finally I used a dynamic array

$tabImage[]["target_id"]

and inserted it 

'field_indesign_rendition' =&gt; $tabImage,