The Artima Developer Community
Sponsored Link

PHP Buzz Forum
Simplified filtering by Parent

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic    
Flat View: This topic has 0 replies on 1 page
Forum One

Posts: 118
Nickname: forumone
Registered: Sep, 2004

Forum One is consulting firm specializing in helping non-profits improve their online presence.
Simplified filtering by Parent Posted: Sep 13, 2004 4:15 PM
Reply to this message Reply

This post originated from an RSS feed registered with PHP Buzz by Forum One.
Original Post: Simplified filtering by Parent
Feed Title: Syntax Framework
Feed URL: http://blog.syntaxcms.org/rss.php?version=0.91
Feed Description: Finally, a place to answer Syntax questions
Latest PHP Buzz Posts
Latest PHP Buzz Posts by Forum One
Latest Posts From Syntax Framework

Advertisement

Filtering by a parent object, such as a seciton, was previously a needlessly complicated process that involved setting up a parent filter and adding it to your main filter via add_parent, as show below:

    $sectionFilter =& pxdb_search::filter(DATATYPE_SECTION);    
    $sectionFilter->add_value('id', $Request->getVar('in_section'));
 
    $content_filter->add_parent($sectionFilter);

The latest CVS snapshot simplified add_parent by allowing it accept either a pxdb_search filter, a pxdb_record or descendant object, a numeric record id, or a record's idnum value. This makes it easier to filter by parent objects since any of the following are now valid calls. The add_parent() method will handle all the filtering internally.

    $content_filter->add_parent( $Section ); // seciton is a pxdb_record descendant
    or
    $content_filter->add_parent( $Section->get_id() ); 
    or
    $content_filter->add_parent( $pxdb_record->get_field( 'idnum' ) );

Read: Simplified filtering by Parent

Topic: php|architect to Publish Books Previous Topic    

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use