TDBF Posted August 19, 2021 Share Posted August 19, 2021 protected static function constructLoadQuery( $id, $idField, $extraWhereClause ) { return parent::constructLoadQuery( $id, $idField, $extraWhereClause )->join( 'nexus_donate_addon_goals', 'nexus_donate_addon_goals.d_did=nexus_donate_goals.d_id' ); } \IPS\nexus\Donation\Goal::roots() Can someone tell me if roots method works with or uses constructLoadQuery? When I use \IPS\nexus\Donation\Goal::roots(), the joined fields are not included. Is there something else required to get this to work? Link to comment Share on other sites More sharing options...
Solution Daniel F Posted August 27, 2021 Solution Share Posted August 27, 2021 Take a look at Node::roots() 😉 Unfortunatly there are few cases where nodes are handled different and this is one... Node::roots() won't call the constructLoadQuery method, but you'll be able to add your own data to the AR object inside the constructFromData() method.  Link to comment Share on other sites More sharing options...
Recommended Posts