lux/phpactiveresource — Issue #12: Limitation in creating XML objects. 
Author: JonLundy
Created: 2011-11-30 00:31:55+00:00
State: open

I am trying to write an application that works with the RedMine API. I need to be able to send custom fields and the way they are handled are in the format:

<issue>
<subject>Test</subject>
<project_id>data</project_id>
<description>Text</description>
<custom_fields>
<custom_field id="1"><value>value</value></custom_field>
<custom_field id="2"><value>value</value></custom_field>
<custom_field id="3"><value>value</value></custom_field>
</custom_fields>
</issue>

If I use the format of having an array of arrays within custom_fields it doesn't pull over the ID for each custom_field.

$issue = array(
'subject' => 'Test',
'project_id' => 'data',
'description' => 'Text',
'custom_fields => array(
'custom_field => array(
array('@id' =>"1", 'value' => 'value'),
array('@id' =>"2", 'value' => 'value'),
array('@id' =>"3", 'value' => 'value')
)
);