Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,21 +151,14 @@ Any good database is based on conventions. Our defaults are:

Nodes on the fluent chain are these table names.

Conventions differ in style, we support many styles of casing (camel case, studly
caps, lowercase) and underscoring:

* Default style (The above)
* Sakila style (MySQL sample database)
* Northwind style (SQL Server sample database)
* CakePHP style (to make it easier to migrate from apps written in CakePHP)

Usage:
Conventions differ in style. We support Standard (snake_case) and Plural
(pluralized snake_case, familiar from Rails, Laravel, etc):

```php
$mapper->setStyle(new Styles\Sakila);
$mapper->setStyle(new Styles\Plural);
```

Styles are implemented as plugins. Refer to the `Respect\Relational\Styles\Stylable`
Styles are implemented as plugins. Refer to the `Respect\Data\Styles\Stylable`
interface.

```php
Expand Down
4 changes: 1 addition & 3 deletions tests/MapperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -586,10 +586,8 @@ public function testStyle(): void
$this->mapper->style,
);
$styles = [
new Styles\CakePHP(),
new Styles\NorthWind(),
new Styles\Sakila(),
new Styles\Standard(),
new Styles\Plural(),
];
foreach ($styles as $style) {
$factory = new EntityFactory(style: $style, entityNamespace: 'Respect\\Relational\\');
Expand Down
Loading