11
zyspec
Re: Object getByLink usage - setting table_link variable
  • 2010/5/18 13:23

  • zyspec

  • Module Developer

  • Posts: 1095

  • Since: 2004/9/21


Okay... Here's a sample of some code that does the table join as expected.
$object_id 3// whatever value for id you want to count

$class_handler =& xoops_getmodulehandler('<classname>'$xoopsModule->getVar('dirname'));
$class_handler->table_link $xoopsDB->prefix('<linked_table_name>');
$class_handler->field_link '<linked_table_column_name>';
$class_handler->field_object '<this_class_object_column_name>';
$criteria = new Criteria('o.<column_name_from_object>'$object_id'=');
$result  $class_handler->getCountByLink($criteria);


Hope this helps... Thanks BÁNÐÍT-X for pointing me in the right direction.

Login

Who's Online

163 user(s) are online (110 user(s) are browsing Support Forums)


Members: 0


Guests: 163


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits