Part of [META] Services injecting @database in core. See the parent issue for details.

CommentFileSizeAuthor
#3 users_data.patch3.25 KBskipyT

Comments

skipyT’s picture

Title: Add a mongo.user.data » Add a mongo.user.data service
skipyT’s picture

Assigned: Unassigned » skipyT
skipyT’s picture

Status: Active » Needs review
StatusFileSize
new3.25 KB

I added a service to store the user data, it is just a raw rewrite of the database implementation.

We should consider to move this directly in the user document perhaps.

slashrsm’s picture

Status: Needs review » Needs work

- we need to create indexes for this queries to perform well
- I agree we should include this into user document
- needs tests!

marcingy’s picture

['uid' => $uid, 'module' => $module, 'name' => $name],

Yes I know php 5.4 allows short form arrays but coding standards still say use array() structure https://drupal.org/coding-standards#array

skipyT’s picture

Thanks for the review. We asked chx and he told us we can use short arrays, look here also: https://drupal.org/node/2135291

slashrsm’s picture

If he said it then I guess we know what are the rules :)

skipyT’s picture

Status: Needs work » Needs review

I put back to needs review then.

slashrsm’s picture

Status: Needs review » Needs work

Tests...

marcingy’s picture

The issue you refer too is actually needs work and hence not yet a coding standard ;)

skipyT’s picture

Yes, I know, but I don't see the reason why we should not use the short arrays. The code is more readable, php 5.4 is already a core requirements and I'm pretty sure that the coding standards for Drupal 8 will be updated.

And chx confirmed also I can use short array syntax. We already have in the mongodb module code committed with the short array syntax. Check the routing services.

skipyT’s picture

Status: Needs work » Closed (fixed)

@chx: we already have this service in the mongodb module and we can close this issue. do you agree? or we modify it to ask for some tests?