CodeIgniter Forums
DataMapper ORM v1.8.0 - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: DataMapper ORM v1.8.0 (/showthread.php?tid=37531)



DataMapper ORM v1.8.0 - El Forum - 02-23-2011

[eluser]WanWizard[/eluser]
No.

But you're not supposed to call the production_cache() method manually, this happens automatically when you instantiate the object. The method doesn't do anything if a production cache is already loaded, which is always the case after instantiation.

So:
- update the table structure
- delete the cache file
- instantiate the model


DataMapper ORM v1.8.0 - El Forum - 02-24-2011

[eluser]Colm Ward[/eluser]
OK, roger that. Not sure if I will be allowed access to delete the cache files when I need to, but that's another story. Thanks for the fast reply!


DataMapper ORM v1.8.0 - El Forum - 02-24-2011

[eluser]WanWizard[/eluser]
If you want the feature to manually generate new cache files, please create a ticket on http://bitbucket.org/wanwizard/datamapper/issues and link back to your post, and I'll have a look...


DataMapper ORM v1.8.0 - El Forum - 02-24-2011

[eluser]WanWizard[/eluser]
A new development version is available on bitbucket (https://bitbucket.org/wanwizard/datamapper/get/tip.zip), which implements most of the outstanding issues (both feature requests and bug fixes).


DataMapper ORM v1.8.0 - El Forum - 02-24-2011

[eluser]Damir Sivic[/eluser]
I still have the same problem, can you give me some example, maybe I am doing something wrong.

PS: while deleting the node would not be bad to leave the children, or move them up


DataMapper ORM v1.8.0 - El Forum - 02-24-2011

[eluser]WanWizard[/eluser]
I used the example you have given (same left- and right id's) to test the modifications, and here it works.
After I moved NODE5 as last child of ROOT, this is the result:
Code:
id     left_id     right_id     text
1      1           10           ROOT
2      2           3            NODE 2
3      4           7            NODE 3
4      5           6            NODE 4
5      8           9            NODE 5

With is equal to

- ROOT
- - NODE 2
- - NODE 3
- - - NODE 4
- - NODE 5


DataMapper ORM v1.8.0 - El Forum - 02-24-2011

[eluser]Damir Sivic[/eluser]
yes, But the problem is when I want NODE 5 to be last child of the NODE 4
Code:
id    left_id    right_id    name
1       1         10          ROOT    
2       2          3          NODE 2    
3       4          9          NODE 3    
4       5          6          NODE 4    
5       7          8          NODE 5

- ROOT
- - NODE 2
- - NODE 3
- - - NODE 4
- - - - NODE 5

//my code
$konto = new Konta();
$konto->get_by_id(4);
$parent = $konto->get_clone();
$konto->get_by_id(5);
$konto->make_last_child_of($parent);



DataMapper ORM v1.8.0 - El Forum - 02-24-2011

[eluser]WanWizard[/eluser]
hmmm... looks like some deeper digging is needed...

edit: pushed a new fix to bitbucket, I found a reindexing issue when moving nodes around.


DataMapper ORM v1.8.0 - El Forum - 02-25-2011

[eluser]PoetaWD[/eluser]
Hey Guys,

I need to build a script to perform a SEARCH.

How is the best and proper way of doing this ?

Is there a way to make this dinamicaly ? Without having to tell the script what are the table columns to search ??


DataMapper ORM v1.8.0 - El Forum - 02-25-2011

[eluser]WanWizard[/eluser]
A search on what? All columns in a table?

Add a method to your model that loops over $this->fields, and add the field to the query in the loop (like for example an OR_LIKE).