Quote Originally Posted by allspiritseve View Post
Another question: I'm trying to get the minimum config use case worked out. That is:
PHP Code:
$mapper = new A_Orm_DataMapper('Post''posts'); 
This will allow you to interact with a Post object in which its properties map 1:1 to fields in the posts table. No more config needed than that, unless you want more

Can I assume a field named 'id' is the primary key for this table? Or would you guys prefer I did a DESCRIBE query every time the mapper was loaded?
If you uses the INFORMATION_SCHEMA tables, should be able to re-use the mapper infrastructure?

Quote Originally Posted by allspiritseve View Post
I'm trying to assume as little as possible about these objects, but it's tough because I'm forced to check everywhere and see if mappings exist, otherwise handle the 1:1 scenario. I may end up extracting all of that code into a class that extends the main class, so the core stays light and the developer can choose whether to allow no-config mapping by which class they instantiate or extend.
I'd put it in separate class entirely.

PHP Code:
$mapperFactory = new MapperFactory(array(
'User' => function()  { return new UserMapper(); },
'Post' => function() use ($mapperBuilder) { return $mapperBuilder->buildMapper('post''Post'),