Skip to content

Commit

Permalink
Merge pull request #11725 from greg0ire/use-properties
Browse files Browse the repository at this point in the history
Use properties over array keys
  • Loading branch information
greg0ire authored Nov 23, 2024
2 parents 71e038c + 65e9f60 commit 9e10380
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ class CompanySQLFilter extends SQLFilter
public function addFilterConstraint(ClassMetadata $targetEntity, $targetTableAlias): string
{
if ($targetEntity->getName() === User::class) {
return sprintf('%s.%s = %s', $targetTableAlias, $targetEntity->fieldMappings['company']['fieldName'], $this->getParameter('company'));
return sprintf('%s.%s = %s', $targetTableAlias, $targetEntity->fieldMappings['company']->fieldName, $this->getParameter('company'));
}

if ($targetEntity->getName() === Order::class) {
return sprintf('%s.%s = %s', $targetTableAlias, $targetEntity->fieldMappings['company']['fieldName'], $this->getParameter('company'));
return sprintf('%s.%s = %s', $targetTableAlias, $targetEntity->fieldMappings['company']->fieldName, $this->getParameter('company'));
}

return '';
Expand Down
2 changes: 1 addition & 1 deletion tests/Tests/ORM/Mapping/ClassMetadataTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,7 @@ public function testAssociationOverrideCanOverrideCascade(): void
$cm->setAssociationOverride('parentDirectory', ['cascade' => ['all']]);

$mapping = $cm->getAssociationMapping('parentDirectory');
self::assertSame(['remove', 'persist', 'refresh', 'detach'], $mapping['cascade']);
self::assertSame(['remove', 'persist', 'refresh', 'detach'], $mapping->cascade);
}

#[TestGroup('DDC-1955')]
Expand Down

0 comments on commit 9e10380

Please sign in to comment.