/** * * @return string */ public function getModelName() { $tablename = $this->getRawTableName(); // check if table name is plural --> convert to singular if(\MwbExporter\Helper\Pluralizer::wordIsPlural($tablename)){ $tablename = \MwbExporter\Helper\Singularizer::singularize($tablename); } // camleCase under scores for model names return ucfirst(preg_replace('@\_(\w)@e', 'ucfirst("$1")', $tablename)); }
public static function wordIsSingular($word) { return !( \MwbExporter\Helper\Pluralizer::wordIsPlural($word) ); }