diff --git a/src/Entity/Bank.php b/src/Entity/Bank.php new file mode 100644 index 00000000..a66f0fc0 --- /dev/null +++ b/src/Entity/Bank.php @@ -0,0 +1,40 @@ +id; + } + + public function getName(): ?string + { + return $this->name; + } + + public function setName(string $name): self + { + $this->name = $name; + + return $this; + } +} diff --git a/src/Migrations/Version20200707170739.php b/src/Migrations/Version20200707170739.php new file mode 100644 index 00000000..131719f9 --- /dev/null +++ b/src/Migrations/Version20200707170739.php @@ -0,0 +1,30 @@ +abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); + + $this->addSql('CREATE TABLE bank (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_D860BF7A5E237E06 (name), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB'); + } + + public function down(Schema $schema) : void + { + $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); + + $this->addSql('DROP TABLE bank'); + } +} diff --git a/src/Repository/BankRepository.php b/src/Repository/BankRepository.php new file mode 100644 index 00000000..617fad0a --- /dev/null +++ b/src/Repository/BankRepository.php @@ -0,0 +1,50 @@ +createQueryBuilder('b') + ->andWhere('b.exampleField = :val') + ->setParameter('val', $value) + ->orderBy('b.id', 'ASC') + ->setMaxResults(10) + ->getQuery() + ->getResult() + ; + } + */ + + /* + public function findOneBySomeField($value): ?Bank + { + return $this->createQueryBuilder('b') + ->andWhere('b.exampleField = :val') + ->setParameter('val', $value) + ->getQuery() + ->getOneOrNullResult() + ; + } + */ +}