3.0 Tree Behavior - understanding find('treeList')

2014-07-11 Thread Michael Houghton
I am using the 3.0 Tree Behavior. I have the following from the docs: $pages = $this-Pages-find('treeList'); http://book.cakephp.org/3.0/en/core-libraries/behaviors/tree.html This just doesn't feel right. It isn't returning a list at all. Should I be doing something else, like: $pages =

Re: 3.0 Tree Behavior - understanding find('treeList')

2014-07-11 Thread José Lorenzo
Not sure what you mean with It isn't returning a list at all. Can you explain? On Friday, July 11, 2014 9:47:27 AM UTC+2, Michael Houghton wrote: I am using the 3.0 Tree Behavior. I have the following from the docs: $pages = $this-Pages-find('treeList');

Re: 3.0 Tree Behavior - understanding find('treeList')

2014-07-11 Thread Michael Houghton
Hey Jose Sure thing. This seems like a similar issue that I had with: $this-Models-findByField($name)-first(); If you recall, I missed the - first() and was trying: $this-Models-findByField($name); Which just gives a whole lot of data on the schema. With the tree behavior, I am calling:

Re: 3.0 Tree Behavior - understanding find('treeList')

2014-07-11 Thread José Lorenzo
All find() methods returns a query object. All query objects have a first() and toArray() method. If you want to see the results of your find you can do: $pages = $this-Pages-find('treeList')-toArray(); On Friday, July 11, 2014 10:28:58 AM UTC+2, Michael Houghton wrote: Hey Jose Sure

Re: 3.0 Tree Behavior - understanding find('treeList')

2014-07-11 Thread Michael Houghton
Thanks Jose - that seems to be it! It might be worth updating the Tree docs to show this. Unfortunately, that is still giving me the error: *Error: * Function name must be a string *File* /home/michael/public_html/bettornet/vendor/cakephp/cakephp/src/Collection/Iterator/TreePrinter.php

Re: 3.0 Tree Behavior - understanding find('treeList')

2014-07-11 Thread José Lorenzo
Can you gist your full code, I have no idea what that error is. On Friday, July 11, 2014 11:49:40 AM UTC+2, Michael Houghton wrote: Thanks Jose - that seems to be it! It might be worth updating the Tree docs to show this. Unfortunately, that is still giving me the error: *Error: *

Re: 3.0 Tree Behavior - understanding find('treeList')

2014-07-11 Thread Michael Houghton
Hey Jose Here it is: https://gist.github.com/cakecoded/59511a440dfb9c5c7628 On Friday, July 11, 2014 12:44:56 PM UTC+1, José Lorenzo wrote: Can you gist your full code, I have no idea what that error is. On Friday, July 11, 2014 11:49:40 AM UTC+2, Michael Houghton wrote: Thanks Jose - that

Re: 3.0 Tree Behavior - understanding find('treeList')

2014-07-11 Thread José Lorenzo
I cannot reproduce this issue. What PHP version do you have? Can you paste the the contents of the line where it is throwing the fatal error? On Friday, July 11, 2014 2:28:11 PM UTC+2, Michael Houghton wrote: Hey Jose Here it is: https://gist.github.com/cakecoded/59511a440dfb9c5c7628 On