Skip to main content
edited tags
Link
Free Radical
  • 15.2k
  • 9
  • 48
  • 86
added 22 characters in body; edited title
Source Link
Krishna Mohan
  • 6.3k
  • 9
  • 31
  • 55

Scald : howHow to add several medias to a node using entity metadata wrapper?

I'm looking for a solution to my problem that is pretty simple in fact. I'm on an importing task in which I have to create programaticallyprogrammatically a node and then populate all its fields.

As we're using the scaldScald module, we can add several medias to a node. But I can't figure out how to associate several medias to a node ?

I tried the following :

foreach ($file_atoms as $i => $atom) { $node_wrapper->field_atom[$i] = $atom->sid; } 

or :

foreach ($file_atoms as $i => $atom) { $node_wrapper->field_atom[$i]->set($atom->sid); } 

But I get the following error :

Error: Cannot use object of type EntityDrupalWrapper as array 

Error: Cannot use object of type EntityDrupalWrapper as array

I followed the doc on this page but it does not seems to work..

Can somebody help me ?

I'm encountering the same problem with taxonomies : I'm not able to set multiple values to the node wrapper.

Thanks !

Sebastien

Scald : how to add several medias to a node using entity metadata wrapper?

I'm looking for a solution to my problem that is pretty simple in fact. I'm on an importing task in which I have to create programatically a node and then populate all its fields.

As we're using the scald module, we can add several medias to a node. But I can't figure out how to associate several medias to a node ?

I tried the following :

foreach ($file_atoms as $i => $atom) { $node_wrapper->field_atom[$i] = $atom->sid; } 

or :

foreach ($file_atoms as $i => $atom) { $node_wrapper->field_atom[$i]->set($atom->sid); } 

But I get the following error :

Error: Cannot use object of type EntityDrupalWrapper as array 

I followed the doc on this page but it does not seems to work..

Can somebody help me ?

I'm encountering the same problem with taxonomies : I'm not able to set multiple values to the node wrapper.

Thanks !

Sebastien

Scald : How to add several medias to a node using entity metadata wrapper?

I'm looking for a solution to my problem that is pretty simple in fact. I'm on an importing task in which I have to create programmatically a node and then populate all its fields.

As we're using the Scald module, we can add several medias to a node. But I can't figure out how to associate several medias to a node ?

I tried the following :

foreach ($file_atoms as $i => $atom) { $node_wrapper->field_atom[$i] = $atom->sid; } 

or :

foreach ($file_atoms as $i => $atom) { $node_wrapper->field_atom[$i]->set($atom->sid); } 

But I get the following error :

Error: Cannot use object of type EntityDrupalWrapper as array

I followed the doc on this page but it does not seems to work..

Can somebody help me ?

I'm encountering the same problem with taxonomies : I'm not able to set multiple values to the node wrapper.

Source Link
Seb
  • 113
  • 3

Scald : how to add several medias to a node using entity metadata wrapper?

I'm looking for a solution to my problem that is pretty simple in fact. I'm on an importing task in which I have to create programatically a node and then populate all its fields.

As we're using the scald module, we can add several medias to a node. But I can't figure out how to associate several medias to a node ?

I tried the following :

foreach ($file_atoms as $i => $atom) { $node_wrapper->field_atom[$i] = $atom->sid; } 

or :

foreach ($file_atoms as $i => $atom) { $node_wrapper->field_atom[$i]->set($atom->sid); } 

But I get the following error :

Error: Cannot use object of type EntityDrupalWrapper as array 

I followed the doc on this page but it does not seems to work..

Can somebody help me ?

I'm encountering the same problem with taxonomies : I'm not able to set multiple values to the node wrapper.

Thanks !

Sebastien