EllisLab text mark
Advanced Search
1 of 14
1
   
[Deprecated] DMZ 1.5.4 (DataMapper OverZealous Edition)
Posted: 21 October 2009 03:38 AM   [ Ignore ]
Avatar
Joined: 2008-10-08
1039 posts

This is an outdated version.  Please see the newer version here.

DataMapper OverZealous Edition 1.5.4

Download the Latest Version Here

  View the change log and the upgrade process
  Having issues? Please look through the Troubleshooting Guide & FAQs
  View the Complete Manual
  Search the Manual NEW!

DataMapper (DM) is an Object-Relational Mapper that builds on ActiveRecord.  Data is loaded from database tables into objects, and relationships can be managed through simple, easy-to-read functions.

DataMapper OverZealous Edition (DMZ) adds several important features to DM, enhancing it’s usage, usually without requiring any code changes.

To install DMZ over DataMapper, the (fairly simple) upgrade process is described here.

DMZ offers these features and more over the original DataMapper:
  • In-table foreign keys
  • Multiple relationships to the same model
  • Better self references
  • Add fields from a related model into one query
  • Update, view, and query extra columns on join tables
  • A shareable extension mechanism, including:
      • Easy creation of HTML forms,
      • Processing posted input,
      • Converting to-and-from JSON, CSV, and arrays, and
      • Query caching

Version 1.5.4:
Minor bugfix for related validation, fixed dead links in docs.

Also, I am going to start a new thread for each DMZ release from now on, to prevent the very large threads from the past.

The older version was discussed here.

Thanks goes to stensi, for providing such an amazing code base to work on.

 Signature 

Phil DeJarnett
  OverZealous Creations, LLC

 
Posted: 21 October 2009 04:32 AM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Avatar
Joined: 2008-10-08
1039 posts

FYI: I updated the manual to be searchable, using a custom Google search.

The Google search also includes results from this forum thread, as well as the older forum thread.

Feel free to check it out in the upper-right hand corner of any page in the documentation.

 Signature 

Phil DeJarnett
  OverZealous Creations, LLC

 
Posted: 21 October 2009 05:35 AM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Avatar
Joined: 2008-09-11
758 posts

really nice work i like the DM but one question is that same like model we are getting values using

$this->input->post('name'); 

is there any way we just pass $_POST and it will update or insert the data in table just like joomla and already we are defining all table columns in validation array. for select data from table we can get value and then pass to the DM.

 Signature 

CI,JQuery,Google Maps | widget with CI loader | Thumbnail, Image Resize, Image Crop Helper | CI shortcode

 
Posted: 21 October 2009 05:38 AM   [ Ignore ]   [ # 3 ]   [ Rating: 0 ]
Avatar
Joined: 2008-10-08
1039 posts
umefarooq - 21 October 2009 09:35 AM

is there any way we just pass $_POST and it will update or insert the data in table just like joomla and already we are defining all table columns in validation array. for select data from table we can get value and then pass to the DM.

The second result when searching for $_POST in the documentation leads you to Associative Array Conversion Methods, an extension that:

Converts an object to and from associative arrays. The to_array method can be used directly with $_POST for rapid saving of HTML forms. When combined with the HTML Form Generation Methods, this extension can make creating simple content mangement tools very easy.

 Signature 

Phil DeJarnett
  OverZealous Creations, LLC

 
Posted: 21 October 2009 05:58 AM   [ Ignore ]   [ # 4 ]   [ Rating: 0 ]
Avatar
Joined: 2008-09-11
758 posts

wow that really cool let me try it properly. i was just checking the documentation thanks for quick reply

 Signature 

CI,JQuery,Google Maps | widget with CI loader | Thumbnail, Image Resize, Image Crop Helper | CI shortcode

 
Posted: 21 October 2009 07:34 AM   [ Ignore ]   [ # 5 ]   [ Rating: 0 ]
Joined: 2009-02-13
47 posts

It’s nice you still working on that golden piece of code! That’d be very nice if you could provide a patch of the modified files form 1.5.3…

Thank you for making CI even better! Since I use your ORM, I miss ROR a bit less…

 
Posted: 21 October 2009 07:38 AM   [ Ignore ]   [ # 6 ]   [ Rating: 0 ]
Avatar
Joined: 2008-10-08
1039 posts

@benoa
Do you mean this? Upgrade Instructions

DMZ has a “lite” download option for those who are just upgrading.  It only includes the core library files, and none of the extras.

There is no patching, just replace the files.  You shouldn’t have to edit the DMZ library directly.  All changes are also documented in the change log.

 Signature 

Phil DeJarnett
  OverZealous Creations, LLC

 
Posted: 21 October 2009 08:31 AM   [ Ignore ]   [ # 7 ]   [ Rating: 0 ]
Joined: 2009-02-13
47 posts

Sorry, my bad…!
____________________________________________________________________

There is some stuff I don’t get about relashionships… Could you help me please? In my application there are three tables `users`, `requests`, `users_requests`, but I don’t know how to get them glued into DMZ :S

Basically one user can send/receive multiple requests. Requests can only (and must) have one sender && one receiver.

So I’m building two Models: User and Request.

The `users_requests` would be the join table that bring them altogether.

I’ve been through the docs, and apparently it is possible to join the two objects through a join table without me having to build the Users_Requests class, but I have no idea how to put it into real code… That’d be very nice if you could post an example of how it should look…

 
Posted: 21 October 2009 09:01 AM   [ Ignore ]   [ # 8 ]   [ Rating: 0 ]
Avatar
Joined: 2007-08-29
94 posts

From my understanding you would:
a) Set

var $has_many("request"

in User-Model.
b) Set

var $has_one("user"

in Request-Model.

Now you can do the following to get the User’s requests:

$u = new User();
$u->request->get();
foreach (
$u->request->all as $request{
   
...
 Signature 

Visit the german-speaking CI-community at http://codeigniter.ch
FreeBSD- and Server-Tutorials at http://serverzeit.de
The event-calendar for Mini-Drivers at http://miniyourlife.com

 
Posted: 21 October 2009 09:10 AM   [ Ignore ]   [ # 9 ]   [ Rating: 0 ]
Joined: 2009-02-13
47 posts

Hey Benedikt, thanks for taking the time to read and answer my post smile

This is my database schema :

users: id | username | email | (etc..)
requests: id | sender | receiver
user_requests: user_id | request_id

Will the code you provided work with that?

 
Posted: 21 October 2009 09:15 AM   [ Ignore ]   [ # 10 ]   [ Rating: 0 ]
Avatar
Joined: 2007-08-29
94 posts

No.

The join-table needs to be users_requests (missing s after user, maybe typo).

But besides it should work.
I also have my problems in understanding DM, but the support is not very good. Maybe you want to look at Doctrine.

 Signature 

Visit the german-speaking CI-community at http://codeigniter.ch
FreeBSD- and Server-Tutorials at http://serverzeit.de
The event-calendar for Mini-Drivers at http://miniyourlife.com

 
Posted: 21 October 2009 09:25 AM   [ Ignore ]   [ # 11 ]   [ Rating: 0 ]
Joined: 2009-02-13
47 posts

Yep, typo wink

I had a look @ Doctrine, and there are surely reasons to choose it over DMZ… But I don’t know, I feel like DMZ’s more CI-compliant (built by CI users, so its CI-minded, and respects the CI conventions—for instance, the use of underscores is something I require from an external library). But maybe my arguments just make me look stupid over the forums.

I’ll be trying your code then! I’m excited because it is actually much more simpler than I thought! Thanks man smile

 
Posted: 21 October 2009 09:55 AM   [ Ignore ]   [ # 12 ]   [ Rating: 0 ]
Avatar
Joined: 2007-08-29
94 posts

It’s quite easy, but if you have concrete questions not like “How can I create a model” there is nobody to answer your questions. And in a commercial environment this is too difficult to work with.

If you need an answer which is not covered or at least not clearly explained/mentioned in the docs how you want to find out?

But if you ask how it works the reply is “Read the docs”. Yeah, and this is not the way to support users in a community, hm?

Anyway, good luck with DM smile

 Signature 

Visit the german-speaking CI-community at http://codeigniter.ch
FreeBSD- and Server-Tutorials at http://serverzeit.de
The event-calendar for Mini-Drivers at http://miniyourlife.com

 
Posted: 21 October 2009 10:42 AM   [ Ignore ]   [ # 13 ]   [ Rating: 0 ]
Joined: 2009-02-13
47 posts

I think DMZ is a pretty advanced and powerful tool. Indeed, if the support isn’t enough, that’s a big concern… On my side, I’ll stick with it, and try to get used to it. Doctrine is a great candidate, which surely has more support & docs, though I think I’ll learn DMZ faster than Doctrine because I’m used of the CI way of doing things, you know? But hey, YOU’ve been of great support, right? wink

 
Posted: 21 October 2009 10:49 AM   [ Ignore ]   [ # 14 ]   [ Rating: 0 ]
Avatar
Joined: 2009-06-10
778 posts
Benedikt - 21 October 2009 01:55 PM

It’s quite easy, but if you have concrete questions not like “How can I create a model” there is nobody to answer your questions. And in a commercial environment this is too difficult to work with.

If you need an answer which is not covered or at least not clearly explained/mentioned in the docs how you want to find out?

But if you ask how it works the reply is “Read the docs”. Yeah, and this is not the way to support users in a community, hm?

Anyway, good luck with DM smile

I’m sure OverZealous would be happy to work out a consulting relationship to provide paid support for those who prefer not to read manuals. If he isn’t, I would :D

 Signature 

CreativeHalls Web Design and Printing
A few of my projects:
OurGulfCoast Property Management and Vacation Rental (ASP/.NET)
BukuBux - Money Saving Coupons and Gift Certificates (CodeIgniter, LAMP/MySQL)
Rentals800.com - Find a place to rent (CodeIgniter, LAMP/MySQL)
bdh (dot) hall (at) gmail (dotcom)

 
Posted: 21 October 2009 10:51 AM   [ Ignore ]   [ # 15 ]   [ Rating: 0 ]
Avatar
Joined: 2007-08-29
94 posts

If the manual would cover the question, then sure a paid consulting is reasonable.

And btw, I dont mind paying for support. I even donate for OSS :-O

 Signature 

Visit the german-speaking CI-community at http://codeigniter.ch
FreeBSD- and Server-Tutorials at http://serverzeit.de
The event-calendar for Mini-Drivers at http://miniyourlife.com

 
1 of 14
1