evaneos / berthe Goto Github PK
View Code? Open in Web Editor NEWLicense: GNU Lesser General Public License v3.0
License: GNU Lesser General Public License v3.0
selectByFetcher returns ids of element that have their filtered column to the filtered value.
Why does the implementation of TYPE_IN is forces by the Fetcher instead of being left to the FetcherQueryBuilder ? I'd like to implement the TYPE_IN in mongo but I can't :(
https://github.com/Evaneos/berthe/blob/master/src/Berthe/Fetcher.php#L198
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.
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
The idea would be to add 3 DAL classes for mongo support
MongoReader
implementing Reader
MongoWriter
implementing Writer
FetcherMongoQueryBuilder
implementing FetcherQueryBuilder
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).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.
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 ?
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());
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.