This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit ezplatform.com

eZ Community » Forums » Developer » Filter by depth 2
expandshrink

Filter by depth 2

Filter by depth 2

Tuesday 01 July 2014 8:31:02 am - 2 replies

Hi ,

I want to filter items from an object where name like *s* or some thing.

I want  to get the sub items as well.I incresed the depth to 2 to fetch sub items.

Below is the code,But it is not displaying the sub items where name like some letter.

If some one knows please answer . 

$concpparams = array(    'Depth' => 2,   

                                       'Offset' => 0, 

                                     'ClassFilterType' => 'frontpage_folder',   

                                      'AttributeFilter' => array('and', array('frontpage_folder/name', 'like', $val)));

Wednesday 02 July 2014 1:52:48 am

As the AttributeFilter is transformed to bare SQL, is the content of $val equal to *s*?
If so, try using %s% instead since this would be the right char representing a wildcard on mysql.

Anyway this will only return every content of type=frontpage_folder to a max depth of 2 (one below the root-node of your system i guess) containing "s" within the name.
It will not return content with a parent containing an "s" in the name.

But i guess that is what you intended to do anyway. happy.gif Emoticon

Modified on Wednesday 02 July 2014 1:56:29 am by Steve Konrad

Friday 04 July 2014 10:55:50 pm

Should it be 'ClassFilterType' => 'include' and 'ClassFilterArray' => array('frontpage_folder')?

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from