GithubHelp home page GithubHelp logo

berthe's People

Contributors

amstko avatar christophehurpeau avatar fhuitelec avatar helgart avatar kipit avatar maffpool avatar oliviermadre avatar qpautrat avatar remi-san avatar rlvdx avatar robink avatar romainjeff avatar selrahcd avatar yoan-evaneos avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

berthe's Issues

Le FetcherMongoQueryBuilder gère l'opérateur OR comme un AND

Problème

Et ça nous empêche de chercher les Facets par filtres de type tag, parce qu'ils ont deux formes de sérialisation valables.

On doit chercher une valeur de slug de tag soit en tant que string directement (facet.filter.travel-type), soit en tant que valeur de la propriété slug d'un objet (facet.filter.travel-type.slug).

Le query builder gérant un OR comme un AND, on ne peut obtenir de résultats, puisque le filtre de type tag est sérialisé d'une seule façon à la fois.

Exemple

La requête suivante ne renvoie pas de résultat, alors qu'on devrait en avoir :
https://pro.evaneos.com/api/v2/facets?page=1&travelTypes=selfdrive&format=json

Add Mongo Support

Idea

The idea would be to add 3 DAL classes for mongo support

  • A MongoReader implementing Reader
  • A MongoWriter implementing Writer
  • A FetcherMongoQueryBuilder implementing FetcherQueryBuilder

Problem

  1. The Reader interface is a little bit too specific for mongo. I'm thinking about two methods.
    • getVOFQCN : we might want to retrieve mongo data in the array form. No VO needed.
    • setTranslator: It doesn't make any sens to have translatable field in mongo document (in the form of external ids).
  2. The operations always happen on a collection. The idea would be to inject directly the collection to the reader & writer. However, since the DI is not yet lazy, this would mean instantiate the collection on each bootstrap.

Solution

  1. Move those two methods into the ABstractReader
  2. Wait for the new version of the DI

Add a `getByIdsIn` to AbstractService

Problem :

Sometimes, we want to get ressource by ids. And sometimes, when those ids come from the outside (MongoDB, LocalStorage, whatever), we cannot garanty consistency. This means that sometimes, the ressource associated to one of the ids does not exists anymore.

For now, the default behaviour of getById is to throw an exception.

But what if I still want to have the other ids ? For composition for instance...

Now, I'm obliged to add a method getByIdsIn in the service of my ressource. It sucks.

Solution

What I propose, is to add a getByIdsIn in the AbstractService, which doesn't throw an Exception when one of the id is missing.

What do you think ?

Bad type casting in AbstractService

In AbstractService.php

    /**
     * (non-PHPdoc)
     * @see \Berthe\Service::save()
     */
    public function save($object, $data = null) {
        $object = $this->builder->updateFromArray($object, $data);

        if (!$this->manager->save($object)) {
            throw new \FunctionalErrorException('Creation failed!', 500);
        }

        return $object;
    }

In Interface Builder.php

    public function updateFromArray($object, array $data = array());

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.