Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AdminListBundle, GeneratorBundle] add sortable option to entities #972

Merged
merged 1 commit into from
Feb 4, 2016

Conversation

sandergo90
Copy link
Contributor

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Fixed tickets #875

@sandergo90 sandergo90 changed the title [WIP] add sortable trait to entities [AdminListBundle, GeneratorBundle] add sortable trait to entities Feb 3, 2016
* @return string
*/
public function getSortableField() {

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would return null to make this more explicit

$setter = "set".ucfirst($sortableField);
$getter = "get".ucfirst($sortableField);

$nextItem = $repo->createQueryBuilder('i')->where('i.'.$sortableField.' < :weight')->setParameter('weight', $item->getWeight())->orderBy('i.'.$sortableField, 'DESC')->setMaxResults(1)->getQuery()->getOneOrNullResult();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getWeight can be other function name

[AdminListBundle]: move down action

[AdminListBundle]: add sortable trait

[AdminListBundle]: check for sortabletraits

[GeneratorBundle]: add move up and down actions as example to bike entity

[AdminListBundle]: remove sortable trait weight default value

[WIP]: remove trait and update generator

[GeneratorBundle, AdminBundle], add option sortable when generating adminlist

[AdminListBundle]: remove first implementations

[AdminListBundle]: set function names more dynamically
@sandergo90 sandergo90 changed the title [AdminListBundle, GeneratorBundle] add sortable trait to entities [AdminListBundle, GeneratorBundle] add sortable option to entities Feb 4, 2016
jockri pushed a commit that referenced this pull request Feb 4, 2016
[AdminListBundle, GeneratorBundle] add sortable option to entities
@jockri jockri merged commit 1b29101 into Kunstmaan:master Feb 4, 2016
@jockri jockri added this to the 3.5.0 milestone Feb 4, 2016
@sandergo90 sandergo90 deleted the issue#875 branch July 7, 2016 06:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants