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

Cast data before saving it into database and mongoId as Relationships #834

Closed
wants to merge 24 commits into from

Conversation

RTLer
Copy link

@RTLer RTLer commented May 10, 2016

in this PR i modify the eloquent cast part to cast data before saving it into DB.
in project its difficult to cast data properly before saving it
i add $saveCasts into model that can be filled just $cast
mainly it use $saveCasts to cast Relationships into mongoId.
the mongoId as Relationships part can be activated by setting "use_mongo_id":

        'mongodb' => [
            'name'         => 'mongodb',
            'driver'       => 'mongodb',
            'host'         => '127.0.0.1',
            'database'     => 'unittest',
            'use_mongo_id' => true,
        ]

also this PR contains new test's for use_mongo_id part and some fixes to make it work with mongoIds

@amiri27
Copy link

amiri27 commented May 11, 2016

+1 it.. Nice job guy..

@OSDDQD
Copy link

OSDDQD commented Jun 1, 2016

Can u add this in master please?

@Eke
Copy link

Eke commented Jun 12, 2016

+1

@Eke
Copy link

Eke commented Jun 12, 2016

Tested this one, at this moment works great for me. @RTLer Thanks !

@amiri27
Copy link

amiri27 commented Jun 14, 2016

@jenssegers ignoring community pull requests is not an acceptable behavior..

@jenssegers
Copy link
Contributor

@amiri27 It's on my todo list. There's quite some code to review.

@amiri27
Copy link

amiri27 commented Jun 14, 2016

Well done @jenssegers ... Thanks a lot for your great library..

@demotivationme
Copy link

demotivationme commented Jul 9, 2016

@jenssegers Some news? When this one be released? Cause I don't really want to change ObjectID relations to string. I need a fast workaround about this point.

@amiri27
Copy link

amiri27 commented Jul 14, 2016

@jenssegers still no update after 1 month..

@hotrush
Copy link

hotrush commented Jul 18, 2016

@jenssegers why not merged?

@deividaspetraitis
Copy link
Contributor

@jenssegers any updates according this?

@sharmasabhay
Copy link

@jenssegers do you have this update in your latest release

@pi0
Copy link
Contributor

pi0 commented Sep 1, 2016

There are breaking changes on master so unitTests are failing. would you please follow This steps to rebase this PR with master branch and running UnitTests against latest changes ?

Thanks :)

@RTLer
Copy link
Author

RTLer commented Sep 2, 2016

thx @pi0, i'm updated the branch with the latest changes on master and now all tests pass again,
it's been long time since i made this PR, @jenssegers is there any hope that this PR get merged?

@@ -0,0 +1,46 @@
diff --git a/src/Jenssegers/Mongodb/Eloquent/Model.php b/src/Jenssegers/Mongodb/Eloquent/Model.php
Copy link
Contributor

Choose a reason for hiding this comment

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

Should not this diff patch file be excluded from commit ?

@pi0
Copy link
Contributor

pi0 commented Sep 2, 2016

+1 for merge!
@RTLer it seems some diff file is accidentally committed but thanks for this nice patch :)
@jenssegers is there any chance make a review/merge tonight? We already merged this PR to our fork and it was really working fine .. :)

@amiri27
Copy link

amiri27 commented Sep 3, 2016

@jenssegers can you merge these changes?

@pi0
Copy link
Contributor

pi0 commented Sep 3, 2016

Some changes may required before merge !?

@amiri27
Copy link

amiri27 commented Sep 5, 2016

@jenssegers guy could you please respect to community by reply to them? still waiting to see any changes regarding this PR...

@RTLer
Copy link
Author

RTLer commented Dec 10, 2016

it's been long time since i opened this PR, i think it's not going to merge, so i'm closing this PR.

if anyone wants this functionality it can be found on "moloquent/moloquent" (it's based on jenssegers/laravel-mongodb but active!)

@RTLer RTLer closed this Dec 10, 2016
@saeedvz
Copy link

saeedvz commented Apr 20, 2018

@jenssegers any news?

@EricKwan2014
Copy link

@jenssegers any news? I saw you updated the MIT license recently? but any others?

@umimehar
Copy link

@jenssegers Any update, I want to use ObjectIds as relations identifier as I am sharing database between multiple servers with multiple programming languages. having a problem that when we insert a document in mongo using this lib, it stores object id of other collection as a string. and other drivers in other languages uses ObjectIds to populate the document from relation.
Any news about this update?

@Smolevich
Copy link
Contributor

@umimehar, see #1892

@rennokki
Copy link
Contributor

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.