Code Monkey home page Code Monkey logo

mondator's Introduction

Mandango

Build Status

Mandango is a simple, powerful and ultrafast Object Document Mapper (ODM) for PHP and MongoDB.

Documentation

See the documentation in http://mandango.org/doc/

mondator's People

Contributors

brikou avatar pablodip avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

mondator's Issues

sys_get_temp_dir problem.

Hi!
When I was trying to generate new project there was an error

Fatal error: Uncaught exception 'Twig_Error_Runtime' with message 'Failed to write cache file "/tmpMondator/145569/da/88/f427770f515b6b061e40755da67c.php".' in /home/me/Php/Mandango/vendor/twig/lib/Twig/Environment.php on line 912
( ! ) Twig_Error_Runtime: Failed to write cache file "/tmpMondator/145569/da/88/f427770f515b6b061e40755da67c.php". in /home/me/Php/Mandango/vendor/twig/lib/Twig/Environment.php on line 912

So, there is

$this->twigTempDir = sys_get_temp_dir().'Mondator/'.mt_rand(111111, 999999),

in ClassExtension.php file. IMO there is missing / before Mondator. It should be

$this->twigTempDir = sys_get_temp_dir().'/Mondator/'.mt_rand(111111, 999999),

In my opinion all generated files should be stored inside project. There is some cache setting for Mandango so maybe it would be a good place to store those files.

Ubuntu 11.10 / Apache2 / Php 5.3.6

Moongoose-like validations

I think it would be awesome to have basic validations like seen in Mongoose, the NodeJS MongoDB ORM: http://mongoosejs.com/docs/validation.html

An Example:

array(
    'Model\Article' => array(
        'collection' => 'articles',
        'fields' => array(
            // Title is required
            'title' => array('type' => 'string', 'required' => true),

            // Body is required
            'body' => array('type' => 'string', 'required' => true),

            // Status must be draft, published or private
            'status' => array('type' => 'string', 'enum' => array('draft', 'published', 'private')),

            // Whatever must be an integer between 42 and 1337
            'whatever' => array('type' => 'integer', 'min' => 42, 'max' => 1337),

            // Slug must validate against custom regular expression
            'slug' => array('type' => 'string', 'match' => '/^[a-z0-9-]+$/')
        )
    )
);

... Later in the code, when saving an article ...

if ($article->save()) {
   // Yay! the document passed all validations
} else {
    // Booh! one or more validations did not pass
    var_dump($article->getValidationErrors());
}

Mandango\Mondator\Container::setDefinition() expects wrong class

(Argument 2 passed to Mandango\Mondator\Container::setDefinition() must be an instance of Mandango\Mondator\Definition, instance of Mandango\Mondator\Definition\Definition given, called in .../vendor/mandango/mondator/src/Mandango/Mondator/Container.php on line 147 and defined

I believe it could be easily fixed by adding:

use Mandango\Mondator\Definition\Definition;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.