コード例 #1
0
ファイル: TransformNameTrait.php プロジェクト: lytc/sloths
 /**
  * @param string $className
  * @return string
  */
 public function transformClassNameToTableName($className)
 {
     $tableName = StringUtils::getClassBaseName($className);
     $tableName = Inflector::underscore($tableName);
     $tableName = Inflector::pluralize($tableName);
     return $tableName;
 }
コード例 #2
0
ファイル: StringUtilsTest.php プロジェクト: lytc/sloths
 public function testGetClassBaseName()
 {
     $this->assertSame('Baz', StringUtils::getClassBaseName('Foo\\Bar\\Baz'));
     $this->assertSame('Foo', StringUtils::getClassBaseName('Foo'));
 }