DataMapper ORM v1.8.0 |
[eluser]nomie7[/eluser]
Code: $data['data'] = $user->get_by_id(1)->to->get(); Does not return information about the user from the user table. I set the relations like you mentioned above.
[eluser]nomie7[/eluser]
In addition to above this code does bring the information needed but instead how can I get the messages by user instead of message id. Code: $data['data'] =$m->include_related('from')->include_related('to')->get_by_id(4); Sorry if I am being pain in the #$# ------------ Edit: my mistake got it THANK YOU SO MUCH!
[eluser]WanWizard[/eluser]
After you executed this, what is the result of $user->check_last_query() ? You should be able to retrieve the messages by using Code: $user = new User();
[eluser]Anestetikas[/eluser]
Hi, im having some trouble with generating the right query. I have a table with multiple last_name fields like: id, name1, name2, name3, name4, name5 And when I insert or edit this table i explode input field by space " ". And its all good. My first search used same principle: Code: case "last_name": This generates: Code: SELECT `persons`.`id`, `persons`.`birth_date`, `persons`.`birth_place`, concat_ws(' ', And its all good if there is only one word in search input like "Jorda" for (Jordan). But i need to have a search that is capable of doing the folowing: If I input "jorda brow" for (Jordan Brown). I tried to: Code: case "last_name": Code: SELECT `persons`.`id`, `persons`.`birth_date`, `persons`.`birth_place`, concat_ws(' ', And I think I need it to be like: Code: SELECT `persons`.`id`, `persons`.`birth_date`, `persons`.`birth_place`, concat_ws(' ', Please advice. ... Need to learn to read manuals $obj->group_start(); ftw!
[eluser]AMR[/eluser]
Heya Where can one post suggested fixes/changes/updates etc etc? Is there a repo anywhere? Thanks
[eluser]WanWizard[/eluser]
Correction: http://bitbucket.org/wanwizard/datamapper. But it's best to discuss it here first, to make sure your case is valid.
[eluser]Robert Liljedahl[/eluser]
Hi guys. I'm using Datamapper+HMVC. I'm trying to use Code: Datamapper::add_model_path() from MY_Loader in order to get access to not loaded modules(/models). However I am not allowed to do this: Code: PHP Fatal error: Call to protected method DataMapper::add_model_path() from context 'MY_Loader' in /---/application/core/MY_Loader.php on line 21 What's the correct way of calling the function?
[eluser]WanWizard[/eluser]
That's a bug in the current released version, which is fixed in develop. Just open application/libraries/datamapper.php, find the add_model_path() method declaration, and change 'protected function' to 'public function'.
[eluser]AMR[/eluser]
@Basketcasesoftware, @WanWizard Thanks guys Would be good of Datamapper could easily be renamed; to say dm. In my case, I currently have 1.6 Datamapper in live production; but just wanted to run 1.8 side by side to test out some bits n bobs (mainly nested sets etc) I found it hard because there are a lot of static references to 'DataMapper', for example the configuration files Code: DataMapper::$config I eventually managed to go through and rename all the parts so that 1.8 was called DataMapperDMZ; but it was a pain. Is there a bad reason for naming those static references based on the class name? Like how the class does at the start; to determine if $is_dmz? Or setting a property at the beginning of the class? Thanks |
Welcome Guest, Not a member yet? Register Sign In |