coen-hyde / Shanty-Mongo

Shanty Mongo is a mongodb library for the Zend Framework. Its intention is to make working with mongodb documents as natural and as simple as possible. In particular allowing embedded documents to also have custom document classes.
Other
200 stars 52 forks source link

Is it possible to use getProperty with dot notation? #100

Closed valeeum closed 11 years ago

valeeum commented 12 years ago

Just curious if there is a way to use the getProperty method in Shanty_Mongo_Document using dot notation? For example:

$userFirstName = $user->getProperty('data.name.first');

The above does not work however $user->data->name->first does work as expected. Just thought that might be a helpful feature.

EDIT: Also interested in using hasProperty() with dot notation.

Thanks, V

coen-hyde commented 11 years ago

Hi Valeeum,

I have no plans to add that feature but you're welcome to create a patch and if it can be done easily / cleanly then I'll include it.

Cheers, Coen