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
Workflows #398
Workflows #398
Conversation
…d running and then be able to debug the code to make sure it does what it is supposed to.
no entity? not even attempted to be tested? |
Drak asked me to PR it, he knew the state it was in. |
It might better if you create a topic branch - please see https://github.com/zikula/core/wiki/Contributor-Workflow (it would mean closing this PR, branching and opening a new on as per the instructions above). While a PR is a "work in progress" also please prefix the title of the PR "[WIP]" so we know. |
@craigh - the entities are already in the codebase - I added all required entities a couple of weeks back. |
// this is a cheat to delete all items in table with value $module | ||
return (bool)DBUtil::deleteObjectByID('workflows', $module, 'module'); | ||
//return (bool)DBUtil::deleteObjectByID('workflows', $module, 'module'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove this comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can be done with dql.
pseudo-code
$dql = 'DELETE from Workflow\Entity\Workflow WHERE module=:module';
->setParameter('workflow', $workflow);
you'll want to look into having a Repository class that can contain all your required dql commands.take a look at the example mods I mentioned. |
|
||
//This is a static function, so we have to user ServiceUtil to get the manager | ||
$sm = ServiceUtil::getManager(); | ||
$entityManager = $sm->get('doctrine')->getEntityManager(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can get entity manager with just a single line of code $em = \ServiceUtil::get('doctrine')->getManager();
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's ->get('doctrine')->getEntityManager();
It's different to 1.3's way as it's using DoctrineBundle.
There are a bunch of issues with this branch and I didn't do it the standard way. I am gonna close this pull request and then resubmit it the right way once I have made some changes as suggested. Thanks for the help all. I will probably be out of commission for a bit. It's the end of the semester and I have papers to grade. |
college or k-12 teacher? (me too - I teach HS Band) |
College at UW-Madison. I teach microbiology. |
ewwww. ;-) |
I added the code that I “think” will work for workflows. This is a noobie guess, especially the correct method of pointing to the table. I guessed it was Workflow\Entity\Workflow, but it could be different.