Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul M. Jones committed Jul 18, 2018
1 parent 3f7927f commit b7830ef
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,28 @@ return typehints.
## Custom Transformations

If you are unsatisfied with how the skeleton generator transforms table names to
persistence model type names, provide a callable of your own in the config file
under the key 'transform':
persistence model type names, you can instantiate the `Transform` class in the
config file under the `transform` key, and pass an array of table-to-type names
to override the default transformations:

```php
// /path/to/skeleton-config.php
return [
'pdo' => [
'mysql:dbname=testdb;host=localhost',
'username',
'password',
],
'namespace' => 'App\\DataSource',
'directory' => './src/App/DataSource',
'transform' => new \Atlas\Cli\Transform([
'table_name' => 'TypeName',
// use a value of null to skip the table entirely
]);
];
```

Alternatively, provide a callable (or callable instance) of your own:

```php
// /path/to/skeleton-config.php
Expand All @@ -89,5 +109,3 @@ return [
},
];
```

(Cf. the _Transform_ class for example behaviors.)

0 comments on commit b7830ef

Please sign in to comment.