Hello,

I am building a embeded form, Ingredient < NutritionaInformation

I found very weird to do this :
$this->getObject()->NutritionalInformation->Ingredient =
$this->getObject(); to make the form working properly.

full code :
class IngredientForm extends BaseIngredientForm
{

  public function setup()
  {
    parent::setup();

    $this->embedForm('NutritionalInformation', new
NutritionalInformationForm($this->getObject()->getNutritionalInformation()));
  }

  public function configure()
  {
    $this->widgetSchema['category_id']->setOption('add_empty', false);
  }

  public function updateObject()
  {
    $object = parent::updateObject();

    $this->getObject()->NutritionalInformation->Ingredient = $this->getObject();

    return $object;
  }
}


-- 
Thomas Rabaix
Internet Consultant

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-devs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to