Skip to content

Commit

Permalink
Table class should be singular
Browse files Browse the repository at this point in the history
  • Loading branch information
joomdonation committed Mar 20, 2017
1 parent 1dc4480 commit 787f5b9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions libraries/src/Cms/Model/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -486,10 +486,19 @@ public function getTable($name = '', $prefix = '', $options = array())
$name = $this->getName();
}

$name = ucfirst($name);

if (empty($prefix))
{
if ($this->namespace)
{
$inflector = \Joomla\String\Inflector::getInstance();

if ($inflector->isPlural($name))
{
$name = $inflector->toSingular($name);
}

$prefix = $this->namespace . '\\Administrator\\Table\\';
}
else
Expand Down

0 comments on commit 787f5b9

Please sign in to comment.