-
Notifications
You must be signed in to change notification settings - Fork 12
/
CustomCrmBundle.php
35 lines (30 loc) · 1011 Bytes
/
CustomCrmBundle.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
namespace MauticPlugin\CustomCrmBundle;
use Mautic\PluginBundle\Bundle\PluginBundleBase;
use Mautic\PluginBundle\Entity\Plugin;
use Mautic\CoreBundle\Factory\MauticFactory;
class CustomCrmBundle extends PluginBundleBase
{
public function getParent()
{
return 'MauticLeadBundle';
}
/**
* @param Plugin $plugin
* @param MauticFactory $factory
* @param array $metadata
* @param null $installedSchema
*/
static public function onPluginInstall(Plugin $plugin, MauticFactory $factory, $metadata = null, $installedSchema = null)
{
if (is_array($metadata)) {
foreach ($metadata as $key => $entity) {
/** @var \Doctrine\ORM\Mapping\ClassMetadata $entity */
if ($factory->getDatabase()->getSchemaManager()->tablesExist($entity->getTableName())) {
unset($metadata[$key]);
}
}
self::installPluginSchema($metadata, $factory);
}
}
}