• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
DataMapper ORM v1.8.0


A solution has been implemented in latest version on BitBucket.

This allows you to specify the path in the models advanced relationship definition, or manually (for example in the controller constructor) using the static method Datamapper::add_model_path().


If you need multiple relationships between models, you need to load at the Advanced Relationship section of the manual, which contains an example of how you configure this.

Really nice efforts. Have tested, and i think it will help anyone outside there ( including me Smile
But, need to fix something in your example application (Squash Bug Tracker),which included at that package.
This looks like about PHP compability, you need to change all the <? to <?php and <?= //some echoing ?> to <?php echo //some echoing ;?>.
In case somebody else facing this problems, a working example with fresh CI, i already uploaded ones to http://bit.ly/h8Etc8

The example app hasn't been checked for quite a while, I'll have a look...

edit: I've checked, and it looks like it's only an issue for the views, that still use short tags. This will be corrected with the next push to bitbucket...

Thank you. I figured it out.

I could use some help with this query in DataMapper. Problem is I just want to query on a field in a join table and not the related model. It would be cool if there was a version of include_join_fields($model).

Models are user, group, and the join subscriptions_users

It should be something like:
$users = new User();
$users->where('is_active', true)
        ->where_not_in_related('group', 'name', array('admin', 'guest', 'manager', 'moderator'))
        ->where_join_field('subscription', "end_date BETWEEN ", "'$start_date' AND '$end_date'")
But that's not working as expected because it never makes a join to subscriptions_users.

This is the SQL of what I want to do:
SELECT users.*, subscriptions_users.end_date as end_date
FROM users
LEFT JOIN subscriptions_users on subscriptions_users.user_id = users.id
LEFT JOIN groups on users.group_id = groups.id
WHERE users.is_active = 1
AND groups.name NOT IN ('admin', 'guest', 'manager', 'moderator')
AND subscriptions_users.end_date BETWEEN '2010-01-28' AND '2012-11-29'

It seems promising . Very nice documentation ;-).

Hi guys. I'm new with using CI and DataMapper and I have problem. There's no problem on my localhost, but then I uploaded on my web. The problem is, when I want to login or i send request to load model, there's error message e.g.
Class 'User' not found in /application/controllers/admin/login.php on line 20

Can you help me please? I don't understand, that on localhost it is OK and on the web not.

I have CI 2.0 (today downloaded) and Datamapper 1.8.0. Also I'm using Ocular Template Library v2.12.

This is backend, so controllers are in admin folder.



Your localhost is a Windows machine? And your webhost is using Linux?

Datamapper model filenames should be lowercase, so 'user.php' instead of 'User.php'.

On Windows making this error works because the filesystem is case insensitive, but on Linux 'User' and 'user' are two different files...

Heh, thanks I forgot this little (but important) detail.

PS: I tried everything, but this. LOL. One more time thank you :-)

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.