[TYPO3-mvc] setProperty Obj Array?

Christian Schwan - Dimme GmbH christian.schwan at dimme.ch
Wed Jul 14 16:58:05 CEST 2010


He guys,

 

I try to Fluid form with arrays of Items like adding them inline dynamically
in the backend.

I got billing model with items 

 

Domain Model Billing:

 

                /**

                 * @var Tx_Crm_Domain_Model_Items

                 */

                protected $items;

 

                  /**

                 * Sets the customer this post is part of

                 * @param Tx_Crm_Domain_Model_Items

                 * @return void

                 */

                public function setItems(Tx_Crm_Domain_Model_Items $items) {

                  print_r($items);

                               $this->items = $items;

                }

 

Domain Model Items:

 

                 /**

                 * @var string

                 */

                protected $qty;

                               /**

                 * @var string

                 */

                protected $description;

                 /**

                 * @var string

                 */

                protected $price;

 

 

My Fluid Template with one Object:

 

<f:form.textbox property="items.qty" />

<f:form.textbox property="items.price" />

 

Tx_Crm_Domain_Model_Items Object

(

    [qty:protected] => asdasd

    [description:protected] => asdsad

    [price:protected] => asdasd

    [discount:protected] => asd

    [tax:protected] => 

    [total:protected] => Fr. 0.00

    [delivery_date:protected] => 

    [_cleanProperties:private] => 

    [uid:protected] => 

    [_localizedUid:protected] => 

    [_languageUid:protected] => 

    [_isClone:private] => 

)

 

Template with a array of items

 

<f:form.textbox property="items.0.qty" />

<f:form.textbox property="items.1.price" />

 

Tx_Crm_Domain_Model_Items Object

(

 

  [0] => (

    [qty:protected] => asdasd

    [description:protected] => asdsad

    [price:protected] => asdasd

    [discount:protected] => asd

    [tax:protected] => 

    [total:protected] => Fr. 0.00

    [delivery_date:protected] => 

    [_cleanProperties:private] => 

    [uid:protected] => 

    [_localizedUid:protected] => 

    [_languageUid:protected] => 

    [_isClone:private] => 

   ),

 

  [1] => (

    [qty:protected] => asdasd

    [description:protected] => asdsad

    [price:protected] => asdasd

    [discount:protected] => asd

    [tax:protected] => 

    [total:protected] => Fr. 0.00

    [delivery_date:protected] => 

    [_cleanProperties:private] => 

    [uid:protected] => 

    [_localizedUid:protected] => 

    [_languageUid:protected] => 

    [_isClone:private] => 

   )

)

 

But it come up with an error:

 

#1231178878: Given property name is not of type string.

Tx_Extbase_Reflection_ObjectAccess::setProperty(Tx_Crm_Domain_Model_Items,
1, array)

 

 

I think SetProperty cant handle arrays?

 

Does anybody has a solution yet, to set more then One Obj. to the in the
Table?

 

 

 



More information about the TYPO3-project-typo3v4mvc mailing list