codemix/oriento — pull request #11 by phpnode (2014-04-04 20:53:31+00:00)
Title: Class and property metadata

Adds helpers for getting and setting custom fields on classes and properties.

### Classes

```js
db.class.get('OUser')
.then(function (OUser) {
console.log(OUser.custom.fields);
return OUser.custom.set({
key: 'value',
foo: 'bar'
})
.return(OUser);
})
.then(function (OUser) {
console.log(OUser.custom.fields); // {key: 'value', foo: 'bar'}
});
```

### Properties

```js
db.class.get('OUser')
.then(function (OUser) {
return OUser.property.get('name');
})
.then(function (prop) {
return prop.custom.set({
key: 'value',
foo: 'bar'
})
.return(prop);
})
.then(function (prop) {
console.log(prop.custom.fields); // {key: 'value', foo: 'bar'}
});
```