$class = "BigFoot"; $table = Strings::tableize($class);
BigFeet
public static function tableize($class) { $underscored = Strings::camelCaseToUnderscore($class); $parts = explode('_', $underscored); $suffix = Inflector::pluralize(array_pop($parts)); $parts[] = $suffix; return implode('_', $parts); }
private function _setupTableNameReplacement() { $tableName = $this->tableInfo->tableName; $defaultTableName = Strings::tableize($this->className); $placeholderTableName = $tableName != $defaultTableName ? $tableName : ''; $this->classStub->addTableSetupItem('table', $placeholderTableName); }