function getCount($criteria = null, $custom_sql = null) { if (!$custom_sql) { return parent::getCount($criteria); } else { $sql = "SELECT COUNT(*) c " . $custom_sql; return $this->_getCount($sql); } }
/** * __construct * * @param XoopsDatabase &$db * @param string $dirname * * @return void **/ public function __construct(&$db, $dirname) { $this->mTable = strtr($this->mTable, array('{dirname}' => $dirname)); parent::XoopsObjectGenericHandler($db); }
/** * delete * * @param XoopsSimpleObject &$obj * * @return **/ public function delete(&$obj, $force = false) { $handler = Legacy_Utils::getModuleHandler('permit', $this->getDirname()); $handler->deleteAll(new Criteria('cat_id', $obj->get('cat_id'))); unset($handler); return parent::delete($obj, $force); }