Jump to content

Initialize the Tab constructor with a Query


IBACK

Recommended Posts

Hello,

 

The Tab constructor in BACK-OFFICE is often initialize with one table.

 

Example : 

public function __construct()
{
$this->table = 'belvg_CA_customerattributes_customer';
$this->identifier = 'id_belvg_customerattributes';
$this->_defaultOrderBy = 'id_belvg_customerattributes';

parent::__construct();
}

Is it possible to associate the Tab constructor with a query ?

 

Example of a query :

$sql = "SELECT count(*) as nb FROM `" . _DB_PREFIX_ . "belvg_CA_customerattributes_customer`
WHERE id_belvg_customerattributes = 1";

$this->results = (int)Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql);

I would like to show results from this query in List in my Tab.

 

Any ideas ?

 

Thanks you in advance,

 

Fabrice

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...