DMZ 1.7.1 (DataMapper OverZealous Edition) |
[eluser]WanWizard[/eluser]
I'll park this question for the moment if you don't mind, busy with some other stuff. But I'll set up a test with this table setup, and I'll let you know the result.
[eluser]WanWizard[/eluser]
Ok, I've ran some tests. I've created the tables "ones", "twoes" (this is what datamapper does by default!), "threes" and "ones_twoes": Code: The model One: With this setup, I can do: Code: // simple one-to-many So yes, you can use the three_id in the relationship table between one and two if you define one_two as a model with the proper relationship definitions. Datamapper doesn't care how crazy you make it, al long as the relationships are defined properly, and the correct tables (and id fields) are there. You can even create a many to many between ones_twoes and fives_sixes with would create a relationship table called one_twoes_fives_sixes!
[eluser]DominixZ[/eluser]
@WanWizard I'm very appreciate. That you will continue this project. i tried your DataMapper in BitBucket and I found a bug in $object->delete I have "Account" model and "Group" model that has many to many relationship I use $group->delete(); and then error is Class a not found I don't know why it bug and i switched back to 1.7.1 and then bug is gone. ===== about "set_value()" DataMapper DMZ use form_validation to use rule that has in form_validation to validate but it doesn't set the rule so "set_value()" will not work but in my opinion i only want to pop data from post so I go to "function &_get_validation_object()" and then "return false;" in the beginning of function and then "set_value()" can pop $_POST data. because now We will validate when save not before save so I feel secure to not validate $_POST data cause I can xss_clean in DataMapper model. Have fun with DataMapper DMZ P.S. I have a small helper project. I will rewrite form_helper to use for DataMapper DMZ and I will contribute back soon. See you guys.
[eluser]WanWizard[/eluser]
Can you be a bit more specific? What is the exact error message? On which line? What does your models look like? What's the content of the objects when you call delete? As to set_value: Datamapper doesn't use Form validation, it allows you to use the validation methods in the form validation library. set_value() is something related to $_POST, which has nothing to do with Datamapper.
[eluser]DominixZ[/eluser]
My PHP version is 5.0, Download DataMapper at BitBucket (10/11/2010) and problem is from application/libraries/datamapper.php Class a not found Line Code Error : 1978 "$object = new $class();" I investigated a little and i see it $properties['class'] return on "a" instead of "account" and $properties return "account" i don't know why this happen and then I start hard code "account" to that but still didn't work it return "Database Error" because my "account" model has been changed to "a" instead so Database cannot found it. My "Account" Table Picture My "Group" Table Picture My "Accounts_Groups" Table Picture When I'm delete Group only has all data field fill but without any relationship with Account. (with Relationship also doesn't work) ====== Quote:As to set_value: Datamapper doesn’t use Form validation, it allows you to use the validation methods in the form validation library. set_value() is something related to $_POST, which has nothing to do with Datamapper. The problem is DataMapper load "Form_validation" so in "set_value()" function you will see it will check if "Form_validation" is load and then use "Form_validation" prep instead of $_POST and default so that why people can't use "set_value()" cause DataMapper load them but not set the rule when We use "set_value()" it check Form_validation is load then it return Form_validation object and pass argument to use Form_validation instead and no rule so doesn't work my fixed is close the way "set_value" function to get "object return" and i return ony "false" so then it will only use $_POST and default not use "Form_validation" May be i bit confusing but explain why "set_value()" doesn't work with "DataMapper"
[eluser]WanWizard[/eluser]
Check the server requirements: minumum PHP version for Datamapper is 5.1.2. Someone managed to get it to work with 5.0.0 (see http://ellislab.com/forums/viewreply/728767/), but no guarantees. I understand what you mean now with set_value(). Would you please report the issue at http://bitbucket.org/wanwizard/datamapper/issues, so it doesn't get lost? Add a link to this thread. I'll see if I can come up with something.
[eluser]WanWizard[/eluser]
Quick fix: Look in datamapper.php for the code that loads the form_validation library, and replace it by this: Code: if($name == 'form_validation') Does this fix the problem?
[eluser]WanWizard[/eluser]
A new version of Datamapper ORM has just been committed to Bitbucket. Just click on "get source" to download the lastest version. This version introduces a new extension to work with nested sets (used to store tree structures in a database). Not all planned functionality is present yet, but it's very usable. You can find the manual page for this extension here. You'll find the complete changelog here. Note that this version has been tested with today's version of CI 2.0. Although still no guarantees, we haven't found any problem.
[eluser]theprodigy[/eluser]
Having a slight problem with get_rules. When checking login, it works just fine. But when trying to output the password in a password input field, it's outputting the encrypted text, causing the field to act strange (closing the value attribute early, etc). Model in question: Code: class User extends DataMapper { In the controller: Code: class Profile extends MY_Controller { In the view: Code: //[other design stuff] |
Welcome Guest, Not a member yet? Register Sign In |