Ouzo\Utilities\Strings::tableize PHP Method

tableize() public static method

Example: $class = "BigFoot"; $table = Strings::tableize($class); Result: BigFeet
public static tableize ( string $class ) : string
$class string
return string
    public static function tableize($class)
    {
        $underscored = Strings::camelCaseToUnderscore($class);
        $parts = explode('_', $underscored);
        $suffix = Inflector::pluralize(array_pop($parts));
        $parts[] = $suffix;
        return implode('_', $parts);
    }

Usage Example

 private function _setupTableNameReplacement()
 {
     $tableName = $this->tableInfo->tableName;
     $defaultTableName = Strings::tableize($this->className);
     $placeholderTableName = $tableName != $defaultTableName ? $tableName : '';
     $this->classStub->addTableSetupItem('table', $placeholderTableName);
 }
All Usage Examples Of Ouzo\Utilities\Strings::tableize