lunaru/MongoRecord — pull request #10 by thiagof (2014-04-24 19:21:22+00:00)
Title: Adding fields definition/validation support

Most of the problems I've found with Mongo was with data types. Its possible to overcome it by strictly casting your data (not one of php strengths..), but this is error prone and lazy developer will bring problems.

So I have implemented this optional fields definition where is it possible to define data types to your fields.

Usage

```
class Transport extends BaseMongoRecord
{
protected static $collectionName = 'transport';
protected static $fields = array(
'name' => 'str',
'price' => 'int',
'manufacturer' => 'str',
'weels' => 'int',
);
}
```