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

Workflows #398

Closed
wants to merge 1 commit into from
Closed

Workflows #398

wants to merge 1 commit into from

Conversation

paustian
Copy link
Member

@paustian paustian commented May 2, 2012

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.

…d running and then be able to debug the code to make sure it does what it is supposed to.
@craigh
Copy link
Member

craigh commented May 2, 2012

no entity? not even attempted to be tested?

@paustian
Copy link
Member Author

paustian commented May 3, 2012

Drak asked me to PR it, he knew the state it was in.

@ghost
Copy link

ghost commented May 3, 2012

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.

@ghost
Copy link

ghost commented May 3, 2012

@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');
Copy link

Choose a reason for hiding this comment

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

Please remove this comment.

Copy link
Member

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);

@craigh
Copy link
Member

craigh commented May 3, 2012

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();
Copy link
Member

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();

Copy link

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.

@paustian
Copy link
Member Author

paustian commented May 3, 2012

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.

@paustian paustian closed this May 3, 2012
@craigh
Copy link
Member

craigh commented May 3, 2012

college or k-12 teacher? (me too - I teach HS Band)

@paustian
Copy link
Member Author

paustian commented May 3, 2012

College at UW-Madison. I teach microbiology.

@craigh
Copy link
Member

craigh commented May 4, 2012

ewwww. ;-)

@craigh craigh modified the milestones: 2.0.0, Discarded Tickets Feb 16, 2015
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

3 participants