Magento get table without prefix

Good day, have a table
<entities>
<user>
oem_user<table></table>
</user>
</entities>


this table belongs to another CMS which stores their belongings in the same database and Magento

For Magenta is developed by the module that needs to have access to the tables of the CMS, but here's the thing, the occurrence of Magenta mage_ prefix

So
protected function _construct()
{
 $this->_init('mass/user', 'id');
} 

Says
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'hyper.mage_oem_user' doesn't exist

How to make sure that the prefix is not added to this table?
October 8th 19 at 03:46
2 answers
October 8th 19 at 03:48
It often happens, that itself asked, itself answered.

I have overridden the method getTableName
did as written here

stackoverflow.com/questions/2417134/how-to-override-table-name-andprefix-in-magento-model

class Meta_Mass_Model_Resource extends Mage_Core_Model_Resource
{
 public function getTableName($modelEntity)
{
 $tableSuffix = null;
 if (is_array($modelEntity)) {
 list($modelEntity, $tableSuffix) = $modelEntity;
}

 $parts = explode('/', $modelEntity);
 if (isset($parts[1])) {
 list($model, $entity) = $parts;
 $entityConfig = false;
 if (!empty(Mage::getConfig()->getNode()->global->models->{$model}->resourceModel)) {
 $resourceModel = (string)Mage::getConfig()->getNode()->global->models->{$model}->resourceModel;
 $entityConfig = $this->GetEntity method($resourceModel, $entity);
}

 if ($entityConfig && !empty($entityConfig->table)) {
 $tableName = (string)$entityConfig->table;
 } else {
 Mage::throwException(Mage::helper('core')->__('Can\'t retrieve entity config: %s', $modelEntity));
}
 } else {
 $tableName = $modelEntity;
}

 Mage::dispatchEvent('resource_get_tablename', array(
 'resource' => $this,
 'model_entity' => $modelEntity,
 'table_name' => $tableName,
 'table_suffix' => $tableSuffix
));

 $mappedTableName = $this->getMappedTableName($tableName);
 if ($mappedTableName) {
 $tableName = $mappedTableName;
 } else {
 if($entityConfig->ignore_prefix) {
 $tablePrefix = ";
 } else {
 $tablePrefix = (string)Mage::getConfig()->getTablePrefix();
}

 $tableName = $tablePrefix . $tableName;
}

 if (!is_null($tableSuffix)) {
 $tableName .= '_' . $tableSuffix;
}
 return $this->getConnection(self::DEFAULT_READ_RESOURCE)->getTableName($tableName);
 } 

}


<models>
<core>
<rewrite>
<resource>Meta_Mass_Model_Resource</resource>
</rewrite>
</core>
</models>
If possible, it is better not to use rewrite, and observers. Rewrite potentially problematic option in contrast to the observers, so how can it be a conflict with rewrites of the same class in a third-party module. - florida_Stiedema commented on October 8th 19 at 03:51
October 8th 19 at 03:50
The fact that he (the prefix) must be added, it is like a rule engine. If you use manually created tables without a prefix it does not mean that Magenta needs to know about this, you asked her the name of the entity, it receives it and adds a prefix to all reasonable. And override
this method I believe is wrong.
Try this, but I'm not sure for this method.
<entities>
<user>
oem_user<table></table>
<prefix></prefix>
</user>
</entities>

Find more questions by tags Magento