getChildren Delegate Class Method

Return to Delegate class methods

The getChildren() method can be implemented in a table’s delegate class to specify the logical “child” records of a given record which can be used when creating hierarchical applications. This method will effectively override the output of the Dataface_Record::getChildren() method for records of this table.

Signature

function getChildren( Dataface_Record $record) : Dataface_Record[]

Parameters

  1. $record - The Dataface_Record that is the subject of the query

Returns

This method should return an array of Dataface_Record objects that are considered to be children of the subject record.

Examples

function getChildren($record){
    return df_get_records('webpages', 
        array(
            'parent_id'=>'='.$record->val('webpage_id')
        )
    );
}

See Also

  • getParent - A Delegate class method to return the logical parent of a given record.

var disqus_identifier = ‘xataface.com/wiki/getChildren’; (function() { var dsq = document.createElement(‘script’); dsq.type = ‘text/javascript’; dsq.async = true; dsq.src = ‘http://xataface.disqus.com/embed.js’; (document.getElementsByTagName(‘head’)[0] || document.getElementsByTagName(‘body’)[0]).appendChild(dsq); })(); blog comments powered by Disqus

//<![CDATA[ (function() { var links = document.getElementsByTagName(‘a’); var query = ‘?’; for(var i = 0; i < links.length; i++) { if(links[i].href.indexOf(‘#disqus_thread’) >= 0) { query += ‘url’ + i + ‘=’ + encodeURIComponent(links[i].href) + ‘&’; } } document.write(‘