diff --git a/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php b/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php
index a40221263..277e916a8 100644
--- a/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php
+++ b/src/Bundle/ChillMainBundle/DependencyInjection/ChillMainExtension.php
@@ -35,6 +35,7 @@ use Chill\MainBundle\Doctrine\DQL\OverlapsI;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
use Chill\MainBundle\Doctrine\DQL\Replace;
+use Symfony\Component\HttpFoundation\Request;
/**
* Class ChillMainExtension
@@ -133,7 +134,7 @@ class ChillMainExtension extends Extension implements PrependExtensionInterface,
$loader->load('services/search.yaml');
$loader->load('services/serializer.yaml');
- $this->configureCruds($container, $config['cruds'], $config['apis'], $loader);
+ $this->configureCruds($container, $config['cruds'], $config['apis'], $loader);
}
/**
@@ -212,6 +213,9 @@ class ChillMainExtension extends Extension implements PrependExtensionInterface,
$container->prependExtensionConfig('monolog', array(
'channels' => array('chill')
));
+
+ //add crud api
+ $this->prependCruds($container);
}
/**
@@ -235,4 +239,97 @@ class ChillMainExtension extends Extension implements PrependExtensionInterface,
// Note: the controller are loaded inside compiler pass
}
+
+
+ /**
+ * @param ContainerBuilder $container
+ */
+ protected function prependCruds(ContainerBuilder $container)
+ {
+ $container->prependExtensionConfig('chill_main', [
+ 'apis' => [
+ [
+ 'class' => \Chill\MainBundle\Entity\Address::class,
+ 'name' => 'address',
+ 'base_path' => '/api/1.0/main/address',
+ 'base_role' => 'ROLE_USER',
+ 'actions' => [
+ '_index' => [
+ 'methods' => [
+ Request::METHOD_GET => true,
+ Request::METHOD_HEAD => true
+ ],
+ ],
+ '_entity' => [
+ 'methods' => [
+ Request::METHOD_GET => true,
+ Request::METHOD_POST => true,
+ Request::METHOD_HEAD => true
+ ]
+ ],
+ ]
+ ],
+ [
+ 'class' => \Chill\MainBundle\Entity\AddressReference::class,
+ 'name' => 'address_reference',
+ 'base_path' => '/api/1.0/main/address-reference',
+ 'base_role' => 'ROLE_USER',
+ 'actions' => [
+ '_index' => [
+ 'methods' => [
+ Request::METHOD_GET => true,
+ Request::METHOD_HEAD => true
+ ],
+ ],
+ '_entity' => [
+ 'methods' => [
+ Request::METHOD_GET => true,
+ Request::METHOD_HEAD => true
+ ]
+ ],
+ ]
+ ],
+ [
+ 'class' => \Chill\MainBundle\Entity\PostalCode::class,
+ 'name' => 'postal_code',
+ 'base_path' => '/api/1.0/main/postal-code',
+ 'base_role' => 'ROLE_USER',
+ 'actions' => [
+ '_index' => [
+ 'methods' => [
+ Request::METHOD_GET => true,
+ Request::METHOD_HEAD => true
+ ],
+ ],
+ '_entity' => [
+ 'methods' => [
+ Request::METHOD_GET => true,
+ Request::METHOD_HEAD => true
+ ]
+ ],
+ ]
+ ],
+ [
+ 'class' => \Chill\MainBundle\Entity\Country::class,
+ 'name' => 'country',
+ 'base_path' => '/api/1.0/main/country',
+ 'base_role' => 'ROLE_USER',
+ 'actions' => [
+ '_index' => [
+ 'methods' => [
+ Request::METHOD_GET => true,
+ Request::METHOD_HEAD => true
+ ],
+ ],
+ '_entity' => [
+ 'methods' => [
+ Request::METHOD_GET => true,
+ Request::METHOD_HEAD => true
+ ]
+ ],
+ ]
+ ]
+ ]
+ ]);
+ }
}
diff --git a/src/Bundle/ChillMainBundle/Entity/AddressReference.php b/src/Bundle/ChillMainBundle/Entity/AddressReference.php
index 944cab81b..b1fca205d 100644
--- a/src/Bundle/ChillMainBundle/Entity/AddressReference.php
+++ b/src/Bundle/ChillMainBundle/Entity/AddressReference.php
@@ -2,12 +2,11 @@
namespace Chill\MainBundle\Entity;
-use Chill\MainBundle\Entity\AddressReferenceRepository;
use Doctrine\ORM\Mapping as ORM;
use Chill\MainBundle\Doctrine\Model\Point;
/**
- * @ORM\Entity(repositoryClass=AddressReferenceRepository::class)
+ * @ORM\Entity()
* @ORM\Table(name="chill_main_address_reference")
* @ORM\HasLifecycleCallbacks()
*/
diff --git a/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/App.vue b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/App.vue
new file mode 100644
index 000000000..461b0038e
--- /dev/null
+++ b/src/Bundle/ChillMainBundle/Resources/public/vuejs/Address/App.vue
@@ -0,0 +1,41 @@
+
+
+ {{ $t('add_an_address') }}
+
+
+
+
+ {{ $t('select_an_address') }}
+
+
+
+ {{ $t('fill_an_address') }}
+
+
+
+
+
+
+
+