Welcome Guest, Not a member yet? Register   Sign In
[Deprecated] DMZ 1.6.2 (DataMapper OverZealous Edition)

[eluser]Alface[/eluser]
I know that, but wouldn't it be better and faster if the extension handled the creation of a form of relational models, don't you think?

[eluser]OverZealous[/eluser]
@Alface

The HTMLForm extension was originally designed more as an example extension. I actually have stopped development on it, because I do not have time to support two complex projects.

I was hoping to find someone to take over support of the extension, however the only interested party I had has not responded.

I won't be removing it, but I will not be adding any further features to the extension.

[eluser]Alface[/eluser]
I'm working on it, do you think you would like to implement the modification on the original extension?
Do you know somewhere I can find more extensions for DMZ?

[eluser]OverZealous[/eluser]
I appreciate the help, but I'm just not going to update the HTMLForm extension any more. I'll probably make a note in the manual that it is no longer supported as of the next release. The HTMLForm extension has generated as much—if not more—problems and questions that the actual DMZ library. :-(

I had a comment about DMZ extensions earlier on this thread, trying to get others involved.

The goal was to get others to add their extension to the DMZ Extensions category on the CodeIgniter wiki.

You can search this thread or use the search in the DMZ manual (it searches all of the DMZ threads as well) to see at least a few others.

Mainly, however, there really aren't many out there with docs and links.

[eluser]Alface[/eluser]
*I think that's because the DMZ with HTMLForm extension became too much more powerfull..
I understand what you mean about how I should search for extensions, but I don't really know what I should search for to find a post related to what we just talked about..

I think you should link the DMZ extensions wiki on manual or on fist post of this topic..

[eluser]Benedikt[/eluser]
Hi,

Does anybody have problems with the automated timestamps?

When I create a new entry "updated" and "created" are filled with the same timestamp. But when I change one field of the entry the "updated" field is not changed.

What could be wrong?

Code:
$user = new User();
$user->where('username', $this->input->post('username'));
$user->update('password', $this->input->post('password'));

I tried to use this coding inside the User-modell but it didnt work either.

Any help?

In the configuration I set globally
$config['created_field'] = '_created';
$config['updated_field'] = '_updated';

Both fields exist (they are written on first save).

Thanks for hints.

[eluser]OverZealous[/eluser]
@Benedikt
The updated timestamp is not modified if no fields have been changed since the last get. In other words, a row cannot be 'touch'ed like a file through DMZ.

Don't forget to always check the generated queries when debugging. If the above is true, you will not see an update query for the save.

[eluser]Benedikt[/eluser]
Thanks for your reply.

So right before the update I need to perform a get?

If yes, why is a get necessary to update the field updated? You could just always include the update field, at least as an option when calling update(). No?

[eluser]OverZealous[/eluser]
@Benedikt

No, you misunderstand me. DMZ will never modify the update field unless something else has changed on the object. In otherwords:
Code:
$u = new User();
$u->name = 'Bob';
$u->save(); // created & updated fields changed

$u->name = 'John';
$u->save(); // updated field changed

$u->save(); // Nothing happens

$u2 = new User();
$u2->where('name', 'John')->get();
$u2->name = 'John';
$u2->save(); // Nothing happens

$u2->name = 'Fred';
$u2->save(); // update field changed

$u3 = new User();
$u3->id = $u2->id;
$u3->name = 'Fred';
$u3->save(); // Update field *should* be changed, because DMZ sees u3 as an existing user whose name has changed from NULL to 'Fred'

You should always get sometime before a Save, or else DMZ has no way of knowing which fields are changed or not. (But not right before, or you lose your changes.) This could lead to unnecessary writes in the DB, and a primary key GET should be several orders of magnitude faster than writing data to the database.

In summary, the automatic update field is ONLY changed when there is a change in the object's fields. If you want something that changes on every save, even if nothing changed, I recommend creating a custom timestamp field and using the 'always_validate' rule and a custom validation rule to ensure that the field is updated every time.

[eluser]Oblique[/eluser]
count() problem

sorry for so much complaining lately but i promise, if you'll explain this i'll post my extension, and some other code that someone might find usefull that is based on dmz in a couple of weeks )

Code:
//There's case of using count() like the one in guide, but it generates strange query
$client->freightage->where('status', self::$$status )->count();

Quote:Unknown column 'freightages.status' in 'where clause'

SELECT COUNT(*) AS `numrows` FROM (`freightages_user_profiles`) WHERE ( `freightages`.`status` = 3 ) AND `user_profile_id` = 12




Theme © iAndrew 2016 - Forum software by © MyBB