Skip to content

Manage findOneBy and findBy #19

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

Closed
soullivaneuh opened this issue Jan 22, 2018 · 2 comments
Closed

Manage findOneBy and findBy #19

soullivaneuh opened this issue Jan 22, 2018 · 2 comments

Comments

@soullivaneuh
Copy link

This:

$dnsDomain = $dnsEntityManager->getRepository('PowerDNSBundle:PowerDNSDomain')->findOneBy([
    'ownerId' => $user->getId()
]);
if (!$dnsDomain) {
    throw new \RuntimeException("Unable to find DNS domain of user {$user->getUsername()}");
}
$client->request('DELETE', $this->getUrl('api_delete_dns', [
    'domain' => $dnsDomain->getId(),
]));

Should work because I check if $dnsDomain is not null. But I have:

Call to an undefined method object::getId().

Certainly because only the find method is managed.

@soullivaneuh
Copy link
Author

The findOneBy is not the issue. See #20

@github-actions
Copy link

github-actions bot commented May 2, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant