Skip to content

Conversation

macedd
Copy link

@macedd macedd commented Apr 24, 2014

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',
        );
}

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

Successfully merging this pull request may close these issues.

1 participant