2017 © Pedro Peláez
 

symfony-bundle devexpressbundle

Bridge between the DevExtreme Js widgets and Doctrine

image

elma/devexpressbundle

Bridge between the DevExtreme Js widgets and Doctrine

  • Wednesday, March 8, 2017
  • by mgiraud
  • Repository
  • 11 Watchers
  • 2 Stars
  • 1,134 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 11 Versions
  • 19 % Grown

The README.md

Build Status Coding Style, (*1)

Overview

  • This bundle is an not an official bundle of the DevExpress team.
  • This bundle does not include any files related to the DevExpress libraries
  • This bundle provides a simple (and incomplete) bridge between the DevExpressJs widgets and doctrine
  • This bundle is a WIP and PR are more than welcome

Currently only a dxDataGrid bridge is provided, (*2)

Installation

Add the bundle to your composer.json file:, (*3)

composer require elma/devexpressbundle "~1.0@dev"

Register the bundle in your composer, (*4)

//File : app/AppKernel.php
$bundles = [
    // ...
    new Bilendi\DevExpressBundle\BilendiDevExpressBundle,
    // ...
]

dxDataGrid

Here is a detailed example of an implementation., (*5)

    /**
     * @return \Symfony\Component\HttpFoundation\Response
     * @Route(...)
     */
    public function indexAction(Request $request)
    {
        // Initiate the parser
        $parser = new SearchQueryParser(); 
        // Parse the DevExpress object
        $query = $parser->parse(json_decode($request->get('loadOptions')));

        // Link between the column header and the doctrine field
        $map = [
            "Username" => "u.username",
            "FirstName" => "u.firstName"
        ];
        // Create the config with the mapping
        $config = new DoctrineQueryConfig($map);

        // Return the data and the total number of item
        return $this->json([
            'content' => $this->getContent($config, $query),
            'total' => $this->getTotal($config, $query)
        ]);
    }

Return the data, (*6)

    private function getContent(DoctrineQueryConfig $config, SearchQuery $query)
    {
        // Create the query builder
        $queryBuilder = $this->getDoctrine()->getManager()->createQueryBuilder();
        // Select Data from the DB
        $queryBuilder->select('u')->from('AcmeUserBundle:Order', 'u');

        // Create the query handle
        $handler = new DoctrineQueryHandler($config, $queryBuilder, $query);
        // Binds the filters, pagination and sorting
        $queryBuilder = $handler->addAllModifiers();

        return $queryBuilder->getQuery()->getResult();
    }

Return the number of items, (*7)

    private function getTotal(DoctrineQueryConfig $config, SearchQuery $query)
    {
        $queryBuilder = $this->getDoctrine()->getManager('catalogue')->createQueryBuilder();
        $queryBuilder->select('COUNT(u)')->from('AcmeUserBundle:Order', 'u');

        $handler = new DoctrineQueryHandler($config, $queryBuilder, $query);
        // Add only the filters. You must not add the pagination. You should not add sorting (useless for counting)
        $handler->addFilters();

       return $queryBuilder->getQuery()->getSingleScalarResult();
    }

The Versions

08/03 2017

dev-master

9999999-dev

Bridge between the DevExtreme Js widgets and Doctrine

  Sources   Download

MIT

The Requires

 

The Development Requires

by Marc Giraud-telme

08/03 2017

dev-analysis-zOPwGB

dev-analysis-zOPwGB

Bridge between the DevExtreme Js widgets and Doctrine

  Sources   Download

MIT

The Requires

 

The Development Requires

by Marc Giraud-telme

08/03 2017

1.1.6

1.1.6.0

Bridge between the DevExtreme Js widgets and Doctrine

  Sources   Download

MIT

The Requires

 

The Development Requires

by Marc Giraud-telme

02/03 2017

1.1.5

1.1.5.0

Bridge between the DevExtreme Js widgets and Doctrine

  Sources   Download

MIT

The Requires

 

The Development Requires

by Marc Giraud-telme

02/03 2017

1.1.4

1.1.4.0

Bridge between the DevExtreme Js widgets and Doctrine

  Sources   Download

MIT

The Requires

 

The Development Requires

by Marc Giraud-telme

01/03 2017

1.1.3

1.1.3.0

Bridge between the DevExtreme Js widgets and Doctrine

  Sources   Download

MIT

The Requires

 

The Development Requires

by Marc Giraud-telme

01/03 2017

1.1.2

1.1.2.0

Bridge between the DevExtreme Js widgets and Doctrine

  Sources   Download

MIT

The Requires

 

The Development Requires

by Marc Giraud-telme

01/03 2017

1.1.1

1.1.1.0

Bridge between the DevExtreme Js widgets and Doctrine

  Sources   Download

MIT

The Requires

 

The Development Requires

by Marc Giraud-telme

01/03 2017

1.1.0

1.1.0.0

Bridge between the DevExtreme Js widgets and Doctrine

  Sources   Download

MIT

The Requires

 

The Development Requires

by Marc Giraud-telme

01/02 2017

1.0.0

1.0.0.0

Bridge between the DevExtreme Js widgets and Doctrine

  Sources   Download

MIT

The Requires

 

The Development Requires

by Marc Giraud-telme

10/01 2017

dev-analysis-8bZEJw

dev-analysis-8bZEJw

Bridge between the DevExtreme Js widgets and Doctrine

  Sources   Download

MIT

The Requires

 

The Development Requires

by Marc Giraud-telme