All pastes #2056985 Raw Edit

Untitled

public text v1 · immutable
#2056985 ·published 2011-05-11 19:47 UTC
rendered paste body
class ProductGalleryCollectionForm extends sfForm
{
  public function configure()
  {
    if (!$product = $this->getOption('product'))
    {
      throw new InvalidArgumentException('You must provide a product object.');
    }

    for ($i = 0; $i < $this->getOption('size', 2); $i++)
    {
      $ProductGallery = new ProductGallery();
      $ProductGallery->Owner = $product;

      $form = new ProductGalleryForm($ProductGallery);

      $this->embedForm($i, $form);
    }

    $this->mergePostValidator(new ProductGalleryValidatorSchema());

  } // config
}