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

Nested/complex attributes #27

Open
andreyvk opened this issue Mar 20, 2013 · 2 comments
Open

Nested/complex attributes #27

andreyvk opened this issue Mar 20, 2013 · 2 comments

Comments

@andreyvk
Copy link

Hi Anton,

I've seen that you have similar issue (or so I think), but i've decided to create a new one.

I was just going to ask if there's any support for complex attributes in OrientDBRecord or at least in text queries? Is there a way to do that with OrientDB-PHP now?

For example,

$record = new OrientDBRecord();
$record->data->name = 'Andrey';
$record->data->complex_name = new stdCLass();
$record->data->complex_name->first = 'Andrey';
$record->data->complex_name->last = 'Kuprianov';
$record->data->age = 30;

$recordPos = $db->recordCreate(1, $record);

@AntonTerekhov
Copy link
Owner

Well, right now everything except scalar and library's classes throws an exception on toString() method.

Code can be changed, so prior to exception library will check if some complex value has __toString() method and call it. This will be a bit slower, but bulletproof.
StdClass, however, lacks toString method, so example above will not work even with this fix.

@andreyvk
Copy link
Author

Thanks!

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

No branches or pull requests

2 participants