Comments (8)
I have noticed a few things. Please discuss them, I love to hear some inputs.
A) The Expression
interface should be renamed to "Filter" to make sense. Also the method names referring to that interface should (of course) be renamed.
B) The both Modifier
interfaces should be renamed to something more descriptive. Like QueryModifier
and ResultModifier
. I'm getting confused
C) I want to rewrite BaseSpecification
somehow.. But I think I need to try it out more first.. I'll get back..
D) Nice @cakper for running return $query->execute();
instead of return $query->getResult($query->getHydrationMode())
.
from doctrine-specification.
This is another spec:
class AdvertsWeShouldClose extends BaseSpecification
{
public function __construct($dqlAlias = null)
{
parent::__construct($dqlAlias);
$this->spec = Spec::andX(
Spec::eq('ended', 0),
Spec::orX(
Spec::lt('endDate', new \DateTime()),
Spec::andX(
Spec::isNull('endDate'),
Spec::lt('startDate', new \DateTime('-4weeks'))
)
)
);
}
/**
* @return Expression
*/
public function getWrappedExpression()
{
return $this->spec;
}
/**
* @return Modifier
*/
public function getWrappedModifier()
{
return $this->spec;
}
}
This one should be valid. But LogicX does require a Specification. A `Expression´ should also work here.. I'm making a PR.
from doctrine-specification.
A) The Expression interface should be renamed to "Filter" to make sense. Also the method names referring to that interface should (of course) be renamed.
agree :)
B) The both Modifier interfaces should be renamed to something more descriptive. Like QueryModifier and ResultModifier. I'm getting confused
If you (author) are confused than definitely we should rename it because it will make even more confusion to users.
from doctrine-specification.
Okey. Thank you @cakper for your input. I'll write a PR for A & B
from doctrine-specification.
I'm just doing PR for the first one ;)
from doctrine-specification.
I'll do the second one then =)
from doctrine-specification.
It feels like every time we make an effort on this repo we find more stuff to do... But with the PRs above and a PR for (A) I feel pretty happy with the result.
from doctrine-specification.
All the raised issued has gotten a PR and they are all merged. Thank you!
from doctrine-specification.
Related Issues (20)
- Need remove not used vars in RoundDateTimeSpec
- Add createQueryBuilder() abstract method in EntitySpecificationRepositoryTrait HOT 1
- Remove AbstractJoin::getJoinType() method HOT 1
- [Syntax Error] line 0, col -1: Error: Expected Literal, got end of string. HOT 1
- Mysql substring function bug HOT 1
- Disable Style CI HOT 3
- Release 2.0.0 HOT 1
- Check single entity satisfiability HOT 8
- DATE_ADD() and DATE_SUB() platform functions does not work HOT 1
- TRIM() platform functions does not support options HOT 1
- Best practices and architectural decissions HOT 5
- Use defaultRepositoryClassName instead of the RepositoryFactory HOT 4
- Using subqueries HOT 5
- Always use a unique aliases to prevent cases in which we have auto-joining and reserved keywords as context HOT 4
- Psalm annotations HOT 5
- A bit confused about the proper use of `$context` HOT 2
- Customize JOIN HOT 1
- Auto-joins with dot notation HOT 7
- Symfony 6 HOT 1
- How to set Query::HINT? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from doctrine-specification.