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

[eluser]Mirage[/eluser]
Ok, mystery solved. By simply importing an id value from the post array, doesn't make the object exist. So I need to load it first if an id was submitted. That makes the object exist and then only 'updated' is updated. Didn't know that apparently :-P

The extensions make things so 'easy' that one assumes too much.

[eluser]emorling[/eluser]
Ok, back with some DMZ related questions. Smile

If I have a model that needs two Self Relationships. Is it possible without a Join Table? For example with join_self_as?

Is there any MySQL Column type which will produce a checkbox using DMZ htmlform?

[eluser]OverZealous[/eluser]
[quote author="emorling" date="1253248620"]If I have a model that needs two Self Relationships. Is it possible without a Join Table? For example with join_self_as?[/quote]

You can make as many self-relationships as you want. If you need many-to-many, no matter the type, you need a join table. Self-relationships always need a dedicated join table for each relationship, while multiple non-self-relationships share the join table. It has to do with the way DMZ determines table names, and there isn't an easy way to change it. One-to-N relationships, of course, can always just use ITFKs.

*_join_as are simply used to override the column names. (They are best avoided whenever possible, trust me.) The table name for self-relationships is always determined from the relationship name.

Quote:Is there any MySQL Column type which will produce a checkbox using DMZ htmlform?

I don't know what you mean. If you want a checkbox, you set the type in HTMLForm or the validation array to be checkbox, nothing more, nothing less. Usually you want to use a Boolean type, or you can use a smallint (which you have to use in PostGreSQL because PHP handles PGSQL booleans incorrectly).

[eluser]emorling[/eluser]
Quote:If you want a checkbox, you set the type in HTMLForm or the validation array to be checkbox, nothing more, nothing less.

Excellent thanks! Are you aware that the style looks excellent in IE, but the fields are off in Mozilla?

[eluser]OverZealous[/eluser]
Funny, I only test it in FF, and it looks fine to me. I don't fire up my VM for IE unless I'm testing my own final products.

Also, please be aware, those templates are merely suggestions, and you should not only update those, but also provide your own CSS.

They aren't meant to be the be-all-end-all.

[eluser]Vinzent Zeppelin[/eluser]
Alrighty, I'm learning a bit about this and have set up a relationship field and associated form. One thing I'm having a problem with, however, is that the __toString() function within one of my models is written to return $this->name ('name' is a table column) as NULL, which throws an error ("Method Resource::__toString() must return a string value"). It does read the table, though, as I have 39 rows and I get 39 errors. Any ideas? If it helps, the exact same function works correctly in a different related model. The problem occurs in the model which is referenced in two separate columns of another table. (E.g. a table has exactly two relationships to one second table, as foreign key columns). Is this occurring as a result of not having defined my relationships correctly?

[eluser]OverZealous[/eluser]
All table columns are initialized to NULL when an object is created. You either need to
1) Cast the value to a String:
Code:
return (string)$this->name;

2) Or ensure that there is a value before you print. You can see if an object was loaded by using the $object->exists() method.

Are you 100% sure your table column is named name, AND the string you are outputting is $name? Look for typos.

Check the output of the last query, and run it separately. Make sure the correct columns are being returned.

[eluser]Unknown[/eluser]
Hi,
I first used CI 2 days ago, and started spent today using DMZ. Wow, I don't think CI would be half as appealing without it!

I just have one question, is it possible to use the 'htmlform' extension to generate the input forms for related fields? Not the checkboxes/selectboxes to pick relations, but to edit actual related fields from a related entry (particularly for when relationships never change once set).

I've scoured the documentation (which is excellent) and don't think it's possible, but would like to check.

Thanks
Kelvin

[eluser]bEz[/eluser]
xt3rm, you would likely need to create a "sub-form" configured to the table(s) of the related data.
Phil may respond as such, especially since you're referring to an action that is extended and not a "core" method.

[eluser]Jinkusu[/eluser]
OK bright sparks, i'm new to this DMZ thing-a-ma-jig so i need some help with deep relation ships. Example

(* is the many relation so one profile has many programmes)

Profile 1 - * Programme
Profile * - * Subject
Programme * - 1 Profile
User * - * Programme
Course * - 1 Programme

i need to access the list of subjects from the as far as the Programme table so for each subject their is one course. hope i'm not being to vague.

Thanks




Theme © iAndrew 2016 - Forum software by © MyBB