$maxFound = $this->getConfigInstance()->getConfigEntry('max_allowed_companies_found');
// Now get a search criteria and set the user's name as criteria
- $criteriaInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class');
- $criteriaInstance->addCriteria(UserDatabaseWrapper::DB_COLUMN_USERNAME, $this->getUserName());
- $criteriaInstance->setLimit($maxFound);
+ $searchInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class');
+ $searchInstance->addCriteria(UserDatabaseWrapper::DB_COLUMN_USERNAME, $this->getUserName());
+ $searchInstance->setLimit($maxFound);
// Get a company wrapper
$wrapperInstance = ObjectFactory::createObjectByConfiguredName('company_db_wrapper_class');
// Do the count-select by criteria
- $totalRows = $wrapperInstance->doSelectCountByCriteria($criteriaInstance);
+ $totalRows = $wrapperInstance->doSelectCountByCriteria($searchInstance);
// Does the user have reached maximum?
$reached = ($totalRows >= $maxFound);