Hi,

Thank you :-)

The 1/ problem was because of wront schema writting.
The 2/ problem I gave you my code
The 3/ problem, I have to see my code which I don't have here, I'll answer
this later.

Yes this plugin is pretty good at what it does ^^


Thank you !

Cheers,


Before Printing, Think about Your Environmental Responsibility!
Avant d'Imprimer, Pensez à Votre Responsabilitée Environnementale!


On Thu, Apr 15, 2010 at 1:44 PM, Daniel Lohse
<annismcken...@googlemail.com>wrote:

> Hey Stéphane,
>
> sorry for getting back to you so late, I might have missed your post
> accidentally. Here's the plugin developer of
> the ahDoctrineEasyEmbeddedRelationsPlugin.
>
> Now, onto your problems:
>
> 1. The URL problem: are you sure that the form does not have validation
> errors after submission (even if they're not shown)? Take a look at the web
> debug toolbar and see if the 'view' pane is orange. Otherwise I can't quite
> pinpoint where that problem should be coming from as the plugin does not
> interfere in URL generation.
>
> 2. Yes, I know, assuming 'id' as the one and only primary/foreign key is a
> bit naïve. :P I'll have to fix this.
>
> 3. Although you write (quote) "the way it is coded to link the related
> object to the context object is not clear to me" this code is working okay
> to identify the other relation as Doctrine builds the opposite regardless of
> what you throw at it (yes, you can choose/modify the name and so on but if
> Doctrine is not able to construct the opposite side you'd get errors on
> model generation) so I don't understand what you did there. ;-) Or did this
> piece of code throw any warnings/errors there?
>
> Hope you find this plugin useful nonetheless, cheers,
>
>
> Daniel
>
> On 08.04.2010, at 18:25, Stéphane wrote:
>
> Hi,
>
> I'm on a new project, I've installed the new version of the plugin.
>
> //part of schema
> edsProduitLiterieSommier:
>   inheritance:
>     extends: edsProduitLiterie
>     type: column_aggregation
>     keyField: object_class
>     keyValue: edsProduitLiterieSommier
>
> edsDimensionsLiterie:
>   inheritance:
>     extends: edsDimensionsLL
>     type: column_aggregation
>     keyField: object_class
>     keyValue: edsDimensionsLiterie
>   columns:
>     literie_id:
>       type: integer(4)
>   relations:
>     literie:
>       class: edsProduitLiterie
>       local: id
>       foreign: id
>       type: one
>       foreignType: many
>       foreignAlias: dimensions
>       owningSide: false
>
> //in the edsProduitLiterieForm class
>          /**
>  * @see edsProduitForm
>  */
>  public function configure()
> {
> parent::configure();
>  if( !$this->isNew() )
> {
> $this->embedRelations(
>  array('dimensions'=>array(
> 'opposite'=>'literie', // << see latest part of this email
>  'newFormLabel'=>'Add new Dimension',
> 'considerNewFormEmptyFields'=>'prix',
>  )));
> }
> }
>
> Then I can create an edsProduitLiterieSommier but when sf returns me the
> edit form, its form's action is not good :
> <form action="*/backend_dev.php/produits/literies/sommiers/*"
> method="post"><input type="hidden" value="put" name="sf_method">    <input
> type="hidden" id="eds_produit_literie_sommier_id" value="1"
> name="eds_produit_literie_sommier[id]"><input type="hidden"
> id="eds_produit_literie_sommier__csrf_token"
> value="0a21cbf700ce672a39a4c6ccf2f6872b"
> name="eds_produit_literie_sommier[_csrf_token]">
>     ....
>
> And when I comment the embedRelations in the edsProduitLiterieForm, it
> comes all good again :
> <form method="post"
> action="/backend_dev.php/produits/literies/sommiers/1"><input type="hidden"
> name="sf_method" value="put" />
>
> This line is written by the template _form.php @line 5:
> <?php echo form_tag_for($form, '@eds_produit_literie_sommier') ?>
>
> I really don't understand what's going wrong with this.
>
> Anyone can help me ??
>
> Thanks !!!
>
>
>
> Anyway, I have managed to change a few things :
>
> -the way it is coded to link the related object to the context object is
> not clear to me as it uses the get_class instead of the real relation name.
> I've changed the code to look like this:
> if (Doctrine_Relation::MANY === $relation->getType())
>           {
>             $newFormObjectClass = $relation->getClass();
>             $newFormObject = new $newFormObjectClass();
>             $newFormObject[$relations[$relationName]['opposite']] =
> $this->getObject();
>           } else
>           {
>             $newFormObject = $this->getObject()->$relationName;
>           }
>
> Then in the embedRelations array I add a "opposite" to tell which opposite
> relation to use to link objects. I didn't been able to "guess" the
> foreignAlias from either sides.
>
> -In the doBind method, I have managed to add this code:
>
> @line 140
> "
> $identifier =
> $this->getObject()->getTable()->getRelation($relationName)->getTable()->getIdentifier();
> if(isset($relationValues['delete_object']) && $relationValues[$identifier])
> "
> Before, it was 'id' which is not very versatile. I think it does the job in
> almost all cases (except when identifier is an array), I didn't managed the
> errors
>
>
>
>
> Before Printing, Think about Your Environmental Responsibility!
> Avant d'Imprimer, Pensez à Votre Responsabilitée Environnementale!
>
> --
> If you want to report a vulnerability issue on symfony, please send it to
> security at symfony-project.com
>
> You received this message because you are subscribed to the Google
> Groups "symfony users" group.
> To post to this group, send email to symfony-users@googlegroups.com
> To unsubscribe from this group, send email to
> symfony-users+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=en
>
>
>  --
> If you want to report a vulnerability issue on symfony, please send it to
> security at symfony-project.com
>
> You received this message because you are subscribed to the Google
> Groups "symfony users" group.
> To post to this group, send email to symfony-users@googlegroups.com
> To unsubscribe from this group, send email to
> symfony-users+unsubscr...@googlegroups.com<symfony-users%2bunsubscr...@googlegroups.com>
> For more options, visit this group at
> http://groups.google.com/group/symfony-users?hl=en
>

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

To unsubscribe, reply using "remove me" as the subject.

Reply via email to