1 | <?php |
||
19 | class Inflector |
||
20 | { |
||
21 | /** |
||
22 | * Convert word in to the format for a Doctrine table name. Converts 'ModelName' to 'model_name' |
||
23 | * |
||
24 | * @param string $word Word to tableize |
||
25 | * |
||
26 | * @return string $word Tableized word |
||
27 | */ |
||
28 | public static function tableize($word) |
||
37 | |||
38 | /** |
||
39 | * Convert a word in to the format for a Doctrine class name. Converts 'table_name' to 'TableName' |
||
40 | * |
||
41 | * @param string $word Word to classify |
||
42 | * |
||
43 | * @return string $word Classified word |
||
44 | */ |
||
45 | public static function classify($word) |
||
54 | |||
55 | /** |
||
56 | * Camelize a word. This uses the classify() method and turns the first character to lowercase |
||
57 | * |
||
58 | * @param string $word |
||
59 | * |
||
60 | * @return string $word |
||
61 | */ |
||
62 | public static function camelize($word) |
||
71 | |||
72 | /** |
||
73 | * Return $word in plural form. |
||
74 | * |
||
75 | * @param string $word Word in singular |
||
76 | * |
||
77 | * @return string Word in plural |
||
78 | */ |
||
79 | public static function pluralize($word) |
||
88 | |||
89 | /** |
||
90 | * Return $word in singular form. |
||
91 | * |
||
92 | * @param string $word Word in plural |
||
93 | * |
||
94 | * @return string Word in singular |
||
95 | */ |
||
96 | public static function singularize($word) |
||
105 | } |