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

propel storage bridge attempt #144

Closed
wants to merge 0 commits into from
Closed

propel storage bridge attempt #144

wants to merge 0 commits into from

Conversation

jkabat
Copy link
Contributor

@jkabat jkabat commented May 31, 2014

No description provided.

@liamsorsby
Copy link

I wouldn't mind finishing this off at the start of next week. Is it possible to make a PR?

@liamsorsby
Copy link

Also, what stage is the current code at? Does it just need reviewing, tests and docs doing or is it partially finished?

@makasim
Copy link
Member

makasim commented Jan 16, 2015

Also, what stage is the current code at? Does it just need reviewing, tests and docs doing or is it partially finished?

As far as I know it worked for @jkabat. I've never had a chance to run it.

Is it possible to make a PR?

Yeap I think you can fork a @jkabat's branch and add some more commits there. After there are two ways to go:

  • Open a pull requests on @jkabat repo so he can review and merge it. it will finally end here in this PR
  • or you can open a separate PR. your own where you have a full control over everything.


use Payum\Core\Bridge\Propel\Model\om\BaseNotificationDetails;

class NotificationDetails extends BaseNotificationDetails implements \ArrayAccess, \IteratorAggregate
Copy link
Member

Choose a reason for hiding this comment

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

I don think we should have custom models like NotificationDetails, PaymentDetails. Just a basic one like ArrayObject. User can extend it in their code and give it meaningful name

@liamsorsby
Copy link

I will make a PR request on @jkabat hopefully we can work on that and get it integrated much quicker. Is @jkabat actively working on the PR?

@makasim
Copy link
Member

makasim commented Jan 16, 2015

I've done a quick review, the solution looks a bit wordy. 7000 thousand lines of code....

@liamsorsby
Copy link

I've made a fork of the pull request and I will have a look Monday and see if I can make any improvements ect.

On 16 Jan 2015, at 21:54, Maksim Kotlyar notifications@github.com wrote:

I've done a quick review, the solution looks a bit wordy. 7000 thousand lines of code....


Reply to this email directly or view it on GitHub.

@jkabat
Copy link
Contributor Author

jkabat commented Jan 17, 2015

I've done this PR quite a long time ago with limited knowledge of collaborating on such a thing.

The most of the code is generated by propel:build:model command. There are 2 possibilities:

  • include schema file and let every user to generate it by hand
  • or really make those files part of the core like other bundles do (LexikTranslationBundle comes to my mind)

I think the best thing to do would be new PR based on the recent code. And I could also help to work on it or with writing a tests. My current storage model is based on v13.

@makasim
Copy link
Member

makasim commented Jan 17, 2015

I'd prefer to have only a storage. And schema for models If models could be
easily generated.

@jkabat
Copy link
Contributor Author

jkabat commented Jan 17, 2015

I will make new fork and new PR during weekend unless @liamsorsby will be faster.

@liamsorsby
Copy link

@jkabat I've not got access over this weekend however I am needing this feature for a new project in working on so if you would like me to help with this then I would be more than happy to help.

@jkabat
Copy link
Contributor Author

jkabat commented Jan 18, 2015

@liamsorsby @makasim I spent quite time today and here's what i've got:
(I didn't fork the repo just because of one file changed)

[*] based on following doc I've created custom storage

[*] based on following doc I've created an application with payment controller and propel entities

Config file is created just for easy testing purposes, maybe @makasim could point me how should I pass class path to custom storage - I know I shouldn't have individual custom storage for every model.

By calling a "prepare" route are both models correctly persisted to database, but request throw following error at me:
"Request Capture{model: Order} is not supported."

It's too late to debug, but I'd like to know if this is correct way of implementation.
Once we decide what parts should be handled by Payum and what by the client, I can do the rest.

@liamsorsby
Copy link

@jkabat just creating some tests against what you've already implemented. When I got to the TestModelQuery.php file however the schema that has been implemented seems to be different to that used in Doctrine, is there a reason for this?

The tests I've done so far are just the same tests performed with the doctrine test with slight edits to correspond with the difference in the models. For example, propel doesn't use the ObjectManagerMock.

@jkabat
Copy link
Contributor Author

jkabat commented Jan 19, 2015

@liamsorsby no there is no reason, it was just too late when I got to the point I described yesterday. I wanted to make the models persist data first to see if it's the good way of implementation. Because propel is building models only for schemas in Bundle folders, I removed schema.xml from Payum library and left the responsibility on the user.

Can you please update propel schema the way it passes the tests?

@liamsorsby
Copy link

@jkabat I've not actually edited anything other then creating the tests on the current schema you've used. I can update these and commit to this however I'm not sure they are completely correct. I can send them over for you to look at though.

Also, as far as I can see I've emmited 2 tests which were:

createObjectManagerMock() as propel doesn't use the object manager.
shouldFindModelById() as this also looks like in the doctrine model this is from the object manager. (unless this can be done through the propel mapping)

I'll commit these now and send you a PR so you can have a look and let me know.

@liamsorsby
Copy link

@jkabat, can you confirm if the fork your using is Payum-propel or Payum as I seem to have created the tests on the fork of your repo Payum not Payum-propel

@liamsorsby
Copy link

Also,

Is it completely necessary for the scheme to extend the model token for example? As I beleive the model that is used there would just be a very basic model to implement in the schema file.

As this is the first time I've actually worked with payum I'm a little embarrassed to ask how to test this without actually using symfony or is it a simple index file at the base of the src to test or are you importing your fork via composer into symfony and working from that?

On 19 Jan 2015, at 12:08, JK notifications@github.com wrote:

@liamsorsby no there is no reason, it was just too late when I got to the point I described yesterday. I wanted to make the models persist data first to see if it's the good way of implementation. Because propel is building models only for schemas in Bundle folders, I removed schema.xml from Payum library and left the responsibility on the user.

Can you please update propel schema the way it passes the tests?


Reply to this email directly or view it on GitHub.

@jkabat
Copy link
Contributor Author

jkabat commented Jan 19, 2015

@liamsorsby I have rebased my fork and updated bridge for payum v0.13. Now we can continue to work on my fork.

@jkabat
Copy link
Contributor Author

jkabat commented Jan 19, 2015

Also please check my gists - code in my fork was very outdated.

@jkabat jkabat closed this Jan 19, 2015
@jkabat
Copy link
Contributor Author

jkabat commented Jan 19, 2015

New PR with branch is here:
#306

@jkabat jkabat mentioned this pull request Jan 20, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants