8000 Deprecate omitting second argument to joinColumnName() by greg0ire · Pull Request #9747 · doctrine/orm · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Deprecate omitting second argument to joinColumnName() #9747

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 9, 2022
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
45 changes: 43 additions & 2 deletions UPGRADE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,47 @@
# Upgrade to 2.13

# Deprecated methods related to named queries
## Deprecated omitting second argument to `NamingStrategy::joinColumnName`

When implementing `NamingStrategy`, it is deprecated to implement
`joinColumnName()` with only one argument.

### Before

```php
<?php
class MyStrategy implements NamingStrategy
{
/**
* @param string $propertyName A property name.
*/
public function joinColumnName($propertyName): string
{
// …
}
}
```

### After

For backward-compatibility reasons, the parameter has to be optional, but can
be documented as guaranteed to be a `class-string`.

```php
<?php
class MyStrategy implements NamingStrategy
{
/**
* @param string $propertyName A property name.
* @param class-string $className
*/
public function joinColumnName($propertyName, $className = null): string
{
// …
}
}
```

## Deprecated methods related to named queries

The following methods have been deprecated:

Expand All @@ -9,7 +50,7 @@ The following methods have been deprecated:
- `Doctrine\ORM\Query\ResultSetMappingBuilder::addNamedNativQueryResultSetMapping()`
- `Doctrine\ORM\Query\ResultSetMappingBuilder::addNamedNativQueryEntityResultMapping()`

# Deprecated classes related to Doctrine 1 and reverse engineering
## Deprecated classes related to Doctrine 1 and reverse engineering

The following classes have been deprecated:

Expand Down
3 changes: 3 additions & 0 deletions lib/Doctrine/ORM/Mapping/DefaultNamingStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ public function referenceColumnName()

/**
* {@inheritdoc}
*
* @param string $propertyName
* @param class-string $className
*/
public function joinColumnName($propertyName, $className = null)
{
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/Mapping/NamingStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function referenceColumnName();
*
* @return string A join column name.
*/
public function joinColumnName($propertyName);
public function joinColumnName($propertyName/*, $className = null */);

/**
* Returns a join table name.
Expand Down
3 changes: 3 additions & 0 deletions lib/Doctrine/ORM/Mapping/UnderscoreNamingStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ public function referenceColumnName()

/**
* {@inheritdoc}
*
* @param string $propertyName
* @param class-string $className
*/
public function joinColumnName($propertyName, $className = null)
{
Expand Down
0