['title']]; protected $_checkForeignKeyDependencies = true; protected $_foreignKeyLocksMessages = [ 'LicenseNaicss' => 'This Vendor Classification is linked with Licenses and can\'t be removed.' ]; public function getTableMeta() { return $this->_getTable()->getMetaData(); } protected function _getFromColumns() { $columns = parent::_getFromColumns(); $columns['vendorCount'] = $this->_getVendorCountExp(); return $columns; } protected function _getVendorCountExp() { $select = $this->_db->select(); $select->from($this->_getPair('Vendor', 'v'), 'COUNT(`v`.`id`)'); $select->join( $this->_getPair('License', 'l'), '`l`.`vendorId` = `v`.`id`', [] ); $select->join( $this->_getPair('LicenseNaics', 'ln'), '`ln`.`licenseId` = `l`.`id`', [] ); $select->where('`ln`.`naicsCode` = `n`.`id`'); return new Zend_Db_Expr('(' . $select . ')'); } public function getData4Pdf() { return $this->getData(); } }