forked from wallabag/wallabag
Migrate getRepository with entities
This commit is contained in:
@ -17,6 +17,7 @@ use Wallabag\ImportBundle\Import\PinboardImport;
|
||||
use Wallabag\ImportBundle\Import\ReadabilityImport;
|
||||
use Wallabag\ImportBundle\Import\WallabagV1Import;
|
||||
use Wallabag\ImportBundle\Import\WallabagV2Import;
|
||||
use Wallabag\UserBundle\Entity\User;
|
||||
|
||||
class ImportCommand extends ContainerAwareCommand
|
||||
{
|
||||
@ -47,9 +48,9 @@ class ImportCommand extends ContainerAwareCommand
|
||||
$em->getConnection()->getConfiguration()->setSQLLogger(null);
|
||||
|
||||
if ($input->getOption('useUserId')) {
|
||||
$entityUser = $em->getRepository('WallabagUserBundle:User')->findOneById($input->getArgument('username'));
|
||||
$entityUser = $em->getRepository(User::class)->findOneById($input->getArgument('username'));
|
||||
} else {
|
||||
$entityUser = $em->getRepository('WallabagUserBundle:User')->findOneByUsername($input->getArgument('username'));
|
||||
$entityUser = $em->getRepository(User::class)->findOneByUsername($input->getArgument('username'));
|
||||
}
|
||||
|
||||
if (!\is_object($entityUser)) {
|
||||
|
||||
@ -108,7 +108,7 @@ abstract class BrowserImport extends AbstractImport
|
||||
$url = \array_key_exists('uri', $importedEntry) ? $importedEntry['uri'] : $importedEntry['url'];
|
||||
|
||||
$existingEntry = $this->em
|
||||
->getRepository('WallabagCoreBundle:Entry')
|
||||
->getRepository(Entry::class)
|
||||
->findByUrlAndUserId($url, $this->user->getId());
|
||||
|
||||
if (false !== $existingEntry) {
|
||||
|
||||
@ -98,7 +98,7 @@ class DeliciousImport extends AbstractImport
|
||||
public function parseEntry(array $importedEntry)
|
||||
{
|
||||
$existingEntry = $this->em
|
||||
->getRepository('WallabagCoreBundle:Entry')
|
||||
->getRepository(Entry::class)
|
||||
->findByUrlAndUserId($importedEntry['url'], $this->user->getId());
|
||||
|
||||
if (false !== $existingEntry) {
|
||||
|
||||
@ -126,7 +126,7 @@ class InstapaperImport extends AbstractImport
|
||||
public function parseEntry(array $importedEntry)
|
||||
{
|
||||
$existingEntry = $this->em
|
||||
->getRepository('WallabagCoreBundle:Entry')
|
||||
->getRepository(Entry::class)
|
||||
->findByUrlAndUserId($importedEntry['url'], $this->user->getId());
|
||||
|
||||
if (false !== $existingEntry) {
|
||||
|
||||
@ -98,7 +98,7 @@ class PinboardImport extends AbstractImport
|
||||
public function parseEntry(array $importedEntry)
|
||||
{
|
||||
$existingEntry = $this->em
|
||||
->getRepository('WallabagCoreBundle:Entry')
|
||||
->getRepository(Entry::class)
|
||||
->findByUrlAndUserId($importedEntry['href'], $this->user->getId());
|
||||
|
||||
if (false !== $existingEntry) {
|
||||
|
||||
@ -179,7 +179,7 @@ class PocketImport extends AbstractImport
|
||||
$url = isset($importedEntry['resolved_url']) && '' !== $importedEntry['resolved_url'] ? $importedEntry['resolved_url'] : $importedEntry['given_url'];
|
||||
|
||||
$existingEntry = $this->em
|
||||
->getRepository('WallabagCoreBundle:Entry')
|
||||
->getRepository(Entry::class)
|
||||
->findByUrlAndUserId($url, $this->user->getId());
|
||||
|
||||
if (false !== $existingEntry) {
|
||||
|
||||
@ -98,7 +98,7 @@ class ReadabilityImport extends AbstractImport
|
||||
public function parseEntry(array $importedEntry)
|
||||
{
|
||||
$existingEntry = $this->em
|
||||
->getRepository('WallabagCoreBundle:Entry')
|
||||
->getRepository(Entry::class)
|
||||
->findByUrlAndUserId($importedEntry['article__url'], $this->user->getId());
|
||||
|
||||
if (false !== $existingEntry) {
|
||||
|
||||
@ -104,7 +104,7 @@ abstract class WallabagImport extends AbstractImport
|
||||
public function parseEntry(array $importedEntry)
|
||||
{
|
||||
$existingEntry = $this->em
|
||||
->getRepository('WallabagCoreBundle:Entry')
|
||||
->getRepository(Entry::class)
|
||||
->findByUrlAndUserId($importedEntry['url'], $this->user->getId());
|
||||
|
||||
if (false !== $existingEntry) {
|
||||
|
||||
Reference in New Issue
Block a user