Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save wowo/266024 to your computer and use it in GitHub Desktop.
Save wowo/266024 to your computer and use it in GitHub Desktop.
<?php
/*
* class generated by symfony framework (v.1.2) with Doctrine 1.0
* after switching to doctrine 1.1 objects saved in admin generated modules won't include many-to-many relations
* the solution is to overload doSave method and swap two lines below
*
* let me know if you have better idea :-) twitter.com/sznapka
*/
class BasePackageForm extends BaseFormDoctrine
{
protected function doSave($con = null)
{
parent::doSave($con);
$this->saveshipmentsList($con); //bug here, this won't save shipments list (M:N) relation
}
}
/**
* fixed class
*/
class PackageForm extends BasePackageForm
{
protected function doSave($con = null)
{
$this->saveshipmentsList($con); //workaround :-)
parent::doSave($con);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment