vincentchalamon / nav-bundle
Symfony bundle for Microsoft Dynamics NAV
Fund package maintenance!
vincentchalamon
Installs: 816
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 2
Forks: 1
Open Issues: 1
Type:symfony-bundle
Requires
- php: >=7.2
- ext-curl: *
- ext-dom: *
- ext-soap: *
- doctrine/annotations: ^1.7
- doctrine/collections: ^1.2
- doctrine/persistence: ^1.3 || ^2.0
- jamesiarmes/php-ntlm: ^1.0
- symfony/config: ^4.4 || ^5.1 || ^6.0
- symfony/event-dispatcher-contracts: ^1.0 || ^2.0 || ^3.0
- symfony/http-kernel: ^4.4.13 || ^5.1.5 || ^6.0
- symfony/property-access: ^4.4 || ^5.1 || ^6.0
- symfony/property-info: ^4.4 || ^5.1 || ^6.0
- symfony/proxy-manager-bridge: ^4.4 || ^5.1 || ^6.0
- symfony/serializer: ^4.4 || ^5.1 || ^6.0
- symfony/stopwatch: ^4.4 || ^5.1 || ^6.0
- symfony/yaml: ^4.4 || ^5.1 || ^6.0
Requires (Dev)
- ext-simplexml: *
- api-platform/core: ^2.5
- fig/link-util: ^1.1
- pagerfanta/pagerfanta: ^2.0 || ^3.0
- phpspec/prophecy: ^1.12
- symfony/asset: ^4.4 || ^5.1 || ^6.0
- symfony/browser-kit: ^4.4 || ^5.1 || ^6.0
- symfony/console: ^4.4 || ^5.1 || ^6.0
- symfony/dotenv: ^4.4 || ^5.1 || ^6.0
- symfony/http-client: ^4.4 || ^5.1 || ^6.0
- symfony/phpunit-bridge: ^5.1 || ^6.0
- symfony/twig-bundle: ^4.4 || ^5.1 || ^6.0
- symfony/web-profiler-bundle: ^4.4 || ^5.1 || ^6.0
- willdurand/negotiation: ^3.0
Suggests
- api-platform/core: Add support for API Platform
- pagerfanta/pagerfanta: Add support for Pagerfanta
- sensio/framework-extra-bundle: Add support for ParamConverter
- symfony/web-profiler-bundle: Add support for the Web profiler
README
This bundle is not supported anymore!
This Symfony Bundle is used to map objects with a Microsoft Dynamics NAV service.
Requirements
- PHP ^7.3
- PHP extensions: curl, dom, soap
Installation
composer req vincentchalamon/nav-bundle
Configuration
nav: url: '%env(NAV_URL)%' # i.e.: https://user:pass@www.example.com/NAV_WS/ paths: App: path: '%kernel.project_dir%/src/Entity' namespace: 'App/Entity'
Advanced configuration
nav: enable_profiler: '%kernel.debug%' foo: wsdl: '%env(NAV_WSDL)%' connection: class: App\Connection\CustomConnectionClass username: '%env(NAV_USERNAME)%' password: '%env(NAV_PASSWORD)%' paths: Foo: path: '%kernel.project_dir%/src/Entity/Foo' namespace: 'App/Entity/Foo' entity_manager_class: App\EntityManager\CustomEntityManager driver: nav.class_metadata.driver.annotation name_converter: nav.serializer.name_converter.camel_case_to_nav soap_options: soap_version: 1 connection_timeout: 120 exception: '%kernel.debug%' trace: '%kernel.debug%' bar: wsdl: '%env(ANOTHER_WSDL)%' connection: class: App\Connection\CustomConnectionClass username: '%env(ANOTHER_USERNAME)%' password: '%env(ANOTHER_PASSWORD)%' paths: Bar: path: '%kernel.project_dir%/src/Entity/Bar' namespace: 'App/Entity/Bar' entity_manager_class: App\EntityManager\CustomEntityManager driver: app.class_metadata.custom name_converter: nav.serializer.name_converter.camel_case_to_nav soap_options: soap_version: 1 connection_timeout: 120 exception: '%kernel.debug%' trace: '%kernel.debug%'
Usage
namespace App\Entity; use NavBundle\Annotation as Nav; /** * @Nav\Entity(namespace="Contact") */ final class Contact { /** * @Nav\Column * @Nav\Key */ public $key; /** * @Nav\Column * @Nav\No */ public $no; /** * @Nav\Column(name="Custom_Email", nullable=true) */ public $email; /** * @Nav\Column(type="date", nullable=true) */ public $date; /** * @Nav\ManyToOne(targetClass=Foo::class) */ public $foo; }
Read
/** @var \NavBundle\RegistryInterface $registry */ $registry = $container->get('nav.registry'); $manager = $registry->getManagerForClass(Contact::class); $repository = $manager->getRepository(Contact::class); // Find entity by primary key $repository->find($no); // Find collection by a set of criteria $repository->findBy(['foo' => 'bar']); // Find entity by a set of criteria $repository->findOneBy(['foo' => 'bar']); // Find all $repository->findAll();
Write/delete
/** @var \NavBundle\RegistryInterface $registry */ $registry = $container->get('nav.registry'); $manager = $registry->getManagerForClass(Contact::class); // Create/Update $manager->persist($object); // Delete $manager->remove($object); // Flush $manager->flush(); // It's also possible to flush an object or an array of objects $manager->flush($object);
Profiler
Code of conduct
This bundle is ruled by a code a conduct.
Contributing
Please have a look to the contributing guide.
Backward Compatibility promise
This bundle follows the same Backward Compatibility promise as the Symfony framework: https://symfony.com/doc/current/contributing/code/bc.html