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

Already on GitHub? Sign in to your account

dynamic collection issue #23

Merged
merged 1 commit into from Jan 8, 2012

Conversation

Projects
None yet
2 participants
Contributor

kkamkou commented Jan 7, 2012

Hello Jonathan, there is problem with the dynamic name of collections. For example I have one collection with different postfix, like: books-today, books-yesterday. Please, review this pr.

a-musing-moose pushed a commit that referenced this pull request Jan 8, 2012

@a-musing-moose a-musing-moose merged commit a5b33fe into a-musing-moose:master Jan 8, 2012

Owner

a-musing-moose commented Jan 8, 2012

Hey Kanstantsin,

Thanks for the pull request. I have merged in your change.

As for the loadById - The Id of a MongoDB document does not have to be a
MongoId. I can be anything unique. For example if you were creating a
user collection you could decide to use their email address as the id field.

For this reason I do not type hint the loadById() function with a
MongoId - Otherwise it would fail if you tried to use anything else.

Hope that makes sense?

Regards,
Jon

Hello Jonathan, there is problem with the dynamic name of collections. For example I have one collections with different postfix, like: books-today, books-yesterday. Please, review this pr.

p.s. another problem in the loadById function. I need to specify mongoId instance and I think that this function should accept "public function loadById(MongoId $id)" instead of mixed one. What do you think?

You can merge this Pull Request by running:

git pull https://github.com/kkamkou/morph collection-name-issue

Or you can view, comment on it, or merge it online at:

#23

-- Commit Summary --

  • dynamic collection issue

-- File Changes --

M src/morph/Iterator.php (6)

-- Patch Links --

https://github.com/a-musing-moose/morph/pull/23.patch
https://github.com/a-musing-moose/morph/pull/23.diff


Reply to this email directly or view it on GitHub:
#23

Jonathan Moss
Director

Tangent / One Australia Pty
Suite 109
175 Sturt Street
Melbourne, VIC 3006
ABN: 76 137 883 615
T: +61 (0) 3 9645 8796
M: +61 (0) 4 1525 1208
E: jonathan.moss@tangentone.com.au

Contributor

kkamkou commented Jan 12, 2012

Hi Jonathan, thank you for describing it.
I have migrated from version 5.x to 5.3 and default document id changed. So, now I should always check md5 with something like: ^[a-z0-9]{32}$ and use MongoId instead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment