# How to save custom plugin form data into database?

**URL:** https://forum.mautic.org/t/how-to-save-custom-plugin-form-data-into-database/9237
**Category:** Product Support
**Created:** [August 14, 2017, 8:12am UTC](https://forum.mautic.org/t/how-to-save-custom-plugin-form-data-into-database/9237 "2017-08-14T08:12:48Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![vishal](https://avatars.discourse-cdn.com/v4/letter/v/49beb7/32.png) [@vishal](https://forum.mautic.org/u/vishal)
#### Post date: [August 14, 2017, 8:12am UTC](https://forum.mautic.org/t/how-to-save-custom-plugin-form-data-into-database/9237/1 "2017-08-14T08:12:48Z")

</div>

Hi  
  
i have created new custom plugin and that plugin successfully created its displaying form with "First name & Last name " Now i wanted to save that form data(First & last name) into database.  
  
Here is my plugin [https://github.com/vishal-px/Mautic-Simple-Plugin](https://github.com/vishal-px/Mautic-Simple-Plugin)  
  
  
  
Now in this plugin i have created ENTITY FOLDER with files World.php & Worldrepository.php.  
  
After adding this two file i getting this below errors.

* * *
\> **mautic log file error**  
  
[2017-08-14 05:54:32] mautic.WARNING: PHP Warning - require(/var/www/html/10\_08\_17\_mautic/app/cache/prod/doctrine/orm/Proxies/\_\_CG\_\_MauticPluginBundleEntityPlugin.php): failed to open stream: No such file or directory - in file /var/www/html/10\_08\_17\_mautic/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php - at line 209 [] []  
  
[2017-08-14 05:54:32] mautic.ERROR: PHP Notice: require(): Failed opening required '/var/www/html/10\_08\_17\_mautic/app/cache/prod/doctrine/orm/Proxies/\_\_CG\_\_MauticPluginBundleEntityPlugin.php' (include\_path='.:/usr/share/php') - in file /var/www/html/10\_08\_17\_mautic/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php - at line 209 [] []  
  
[2017-08-14 05:54:32] mautic.ERROR: SymfonyComponentDebugExceptionFatalErrorException: Notice: require(): Failed opening required '/var/www/html/10\_08\_17\_mautic/app/cache/prod/doctrine/orm/Proxies/\_\_CG\_\_MauticPluginBundleEntityPlugin.php' (include\_path='.:/usr/share/php') - in file /var/www/html/10\_08\_17\_mautic/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php - at line 209 [] []  
  

* * *
\> **And in Server log error file**  
  
[Mon Aug 14 11:24:41.603879 2017] [:error] [pid 8127] [client 127.0.0.1:39906] PHP Warning: Declaration of MauticPlugin\HelloWorldBundle\HelloWorldBundle::onPluginInstall(MauticPlugin\HelloWorldBundle\Plugin $plugin, MauticPlugin\HelloWorldBundle\MauticFactory $factory, $metadata = NULL) should be compatible with Mautic\PluginBundle\Bundle\PluginBundleBase::onPluginInstall(Mautic\PluginBundle\Entity\Plugin $plugin, Mautic\CoreBundle\Factory\MauticFactory $factory, $metadata = NULL, $installedSchema = NULL) in /var/www/html/10\_08\_17\_mautic/plugins/HelloWorldBundle/HelloWorldBundle.php on line 0, referer: http://localhost/10\_08\_17\_mautic/s/update/schema  
  
[Mon Aug 14 11:24:41.604147 2017] [:error] [pid 8127] [client 127.0.0.1:39906] PHP Warning - Declaration of MauticPlugin\HelloWorldBundle\HelloWorldBundle::onPluginUpdate(MauticPlugin\HelloWorldBundle\Plugin $plugin, MauticPlugin\HelloWorldBundle\MauticFactory $factory, $metadata = NULL, MauticPlugin\HelloWorldBundle\Schema $installedSchema = NULL) should be compatible with Mautic\PluginBundle\Bundle\PluginBundleBase::onPluginUpdate(Mautic\PluginBundle\Entity\Plugin $plugin, Mautic\CoreBundle\Factory\MauticFactory $factory, $metadata = NULL, Doctrine\DBAL\Schema\Schema $installedSchema = NULL) - in file /var/www/html/10\_08\_17\_mautic/plugins/HelloWorldBundle/HelloWorldBundle.php - at line 0, referer: http://localhost/10\_08\_17\_mautic/s/update/schema  
  
[Mon Aug 14 11:24:41.604269 2017] [:error] [pid 8127] [client 127.0.0.1:39906] PHP Warning: Declaration of MauticPlugin\HelloWorldBundle\HelloWorldBundle::onPluginUpdate(MauticPlugin\HelloWorldBundle\Plugin $plugin, MauticPlugin\HelloWorldBundle\MauticFactory $factory, $metadata = NULL, MauticPlugin\HelloWorldBundle\Schema $installedSchema = NULL) should be compatible with Mautic\PluginBundle\Bundle\PluginBundleBase::onPluginUpdate(Mautic\PluginBundle\Entity\Plugin $plugin, Mautic\CoreBundle\Factory\MauticFactory $factory, $metadata = NULL, Doctrine\DBAL\Schema\Schema $installedSchema = NULL) in /var/www/html/10\_08\_17\_mautic/plugins/HelloWorldBundle/HelloWorldBundle.php on line 0, referer: http://localhost/10\_08\_17\_mautic/s/update/schema

---

<div class="post-metadata">

### Author: ![vishal](https://avatars.discourse-cdn.com/v4/letter/v/49beb7/32.png) [@vishal](https://forum.mautic.org/u/vishal)
#### Post date: [August 14, 2017, 8:12am UTC](https://forum.mautic.org/t/how-to-save-custom-plugin-form-data-into-database/9237/2 "2017-08-14T08:12:48Z")

</div>

Hi  
i have created new custom plugin and that plugin successfully created its displaying form with "First name & Last name " Now i wanted to save that form data(First & last name) into database.  
Here is my plugin [https://github.com/vishal-px/Mautic-Simple-Plugin](https://github.com/vishal-px/Mautic-Simple-Plugin)

Now in this plugin i have created ENTITY FOLDER with files World.php & Worldrepository.php.  
After adding this two file i getting this below errors.

---------------\> mautic log file error

[2017-08-14 05:54:32] mautic.WARNING: PHP Warning - require(/var/www/html/10\_08\_17\_mautic/app/cache/prod/doctrine/orm/Proxies/\_\_CG\_\_MauticPluginBundleEntityPlugin.php): failed to open stream: No such file or directory - in file /var/www/html/10\_08\_17\_mautic/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php - at line 209 [] []

[2017-08-14 05:54:32] mautic.ERROR: PHP Notice: require(): Failed opening required ‘/var/www/html/10\_08\_17\_mautic/app/cache/prod/doctrine/orm/Proxies/\_\_CG\_\_MauticPluginBundleEntityPlugin.php’ (include\_path=’.:/usr/share/php’) - in file /var/www/html/10\_08\_17\_mautic/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php - at line 209 [] []

[2017-08-14 05:54:32] mautic.ERROR: SymfonyComponentDebugExceptionFatalErrorException: Notice: require(): Failed opening required ‘/var/www/html/10\_08\_17\_mautic/app/cache/prod/doctrine/orm/Proxies/\_\_CG\_\_MauticPluginBundleEntityPlugin.php’ (include\_path=’.:/usr/share/php’) - in file /var/www/html/10\_08\_17\_mautic/vendor/doctrine/common/lib/Doctrine/Common/Proxy/AbstractProxyFactory.php - at line 209 [] []

------------\> And in Server log error file

[Mon Aug 14 11:24:41.603879 2017] [:error] [pid 8127] [client 127.0.0.1:39906] PHP Warning: Declaration of MauticPlugin\HelloWorldBundle\HelloWorldBundle::onPluginInstall(MauticPlugin\HelloWorldBundle\Plugin $plugin, MauticPlugin\HelloWorldBundle\MauticFactory $factory, $metadata = NULL) should be compatible with Mautic\PluginBundle\Bundle\PluginBundleBase::onPluginInstall(Mautic\PluginBundle\Entity\Plugin $plugin, Mautic\CoreBundle\Factory\MauticFactory $factory, $metadata = NULL, $installedSchema = NULL) in /var/www/html/10\_08\_17\_mautic/plugins/HelloWorldBundle/HelloWorldBundle.php on line 0, referer: [http://localhost/10\_08\_17\_mautic/s/update/schema](http://localhost/10_08_17_mautic/s/update/schema)

[Mon Aug 14 11:24:41.604147 2017] [:error] [pid 8127] [client 127.0.0.1:39906] PHP Warning - Declaration of MauticPlugin\HelloWorldBundle\HelloWorldBundle::onPluginUpdate(MauticPlugin\HelloWorldBundle\Plugin $plugin, MauticPlugin\HelloWorldBundle\MauticFactory $factory, $metadata = NULL, MauticPlugin\HelloWorldBundle\Schema $installedSchema = NULL) should be compatible with Mautic\PluginBundle\Bundle\PluginBundleBase::onPluginUpdate(Mautic\PluginBundle\Entity\Plugin $plugin, Mautic\CoreBundle\Factory\MauticFactory $factory, $metadata = NULL, Doctrine\DBAL\Schema\Schema $installedSchema = NULL) - in file /var/www/html/10\_08\_17\_mautic/plugins/HelloWorldBundle/HelloWorldBundle.php - at line 0, referer: [http://localhost/10\_08\_17\_mautic/s/update/schema](http://localhost/10_08_17_mautic/s/update/schema)

[Mon Aug 14 11:24:41.604269 2017] [:error] [pid 8127] [client 127.0.0.1:39906] PHP Warning: Declaration of MauticPlugin\HelloWorldBundle\HelloWorldBundle::onPluginUpdate(MauticPlugin\HelloWorldBundle\Plugin $plugin, MauticPlugin\HelloWorldBundle\MauticFactory $factory, $metadata = NULL, MauticPlugin\HelloWorldBundle\Schema $installedSchema = NULL) should be compatible with Mautic\PluginBundle\Bundle\PluginBundleBase::onPluginUpdate(Mautic\PluginBundle\Entity\Plugin $plugin, Mautic\CoreBundle\Factory\MauticFactory $factory, $metadata = NULL, Doctrine\DBAL\Schema\Schema $installedSchema = NULL) in /var/www/html/10\_08\_17\_mautic/plugins/HelloWorldBundle/HelloWorldBundle.php on line 0, referer: [http://localhost/10\_08\_17\_mautic/s/update/schema](http://localhost/10_08_17_mautic/s/update/schema)
