Skip to content

Commit

Permalink
Make the 'Table' slighly more variably
Browse files Browse the repository at this point in the history
  • Loading branch information
wilsonge committed Apr 22, 2014
1 parent 43b5549 commit 43e6a8d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions libraries/joomla/table/table.php
Expand Up @@ -306,11 +306,12 @@ public static function getInstance($type, $prefix = 'JTable', $config = array())

// Remove the 'Table' part from the prefix - this should be the component name
// If we don't have a table suffix to the prefix then we just have to give up.
$pos = strrpos($prefix, 'Table');
$suffix = 'Table';
$pos = strrpos($prefix, $suffix);

if($pos !== false)
{
$component = substr_replace($prefix, '', $pos, strlen('Table'));
$component = substr_replace($prefix, '', $pos, strlen($suffix));

$tableName = '#__' . $component . '_' . $typePlural;
$keyName = $component . '_' . $typeSingular . '_id';
Expand Down

0 comments on commit 43e6a8d

Please sign in to comment.