Questions tagged [dbal]

Database Abstraction Layer for Doctrine ORM (PHP)

Database abstraction layer with many features for database schema introspection, schema management and PDO abstraction.

261 questions
3
votes
1 answer

Doctrine 2 DBAL returns only string datatypes

I'm building a simple REST backend using Silex micro-framework. Inside each controller, I'm running some query against MySQL database (using Doctrine 2 DBAL API), like the follow: $app->get('/customers', function (Application $app) { $recordset…
Jerus
  • 65
  • 1
  • 7
2
votes
2 answers

Method setSQLLogger deprecated - Doctrine\DBAL\Configuration

I am in the process of upgrading an application from Symfony 5.4 to Symfony 6.0. Along the way, I had to upgrade some doctrine libraries. We are currently using setSQLLogger(null) to avoid having SQL logging enabled. By using the newer version of…
2
votes
1 answer

How to search through a translated entity in shopware 6?

We want to search for the translated name in Shopware 6 programatically and came up with this: $criteria = (new Criteria()) ->addAssociation('property_group_option_translation.name') ->addFilter(new EqualsFilter('name', $value)) …
Alex
  • 32,506
  • 16
  • 106
  • 171
2
votes
1 answer

How to Update Order custom field in Shopware 6 during order process?

I want to add a selector for date during order process in checkout. In which step should the custom field of an order be updated? And how is the custom field update done for order or other entity? I want to add the fields as it is shown in official…
David
  • 553
  • 6
  • 21
2
votes
1 answer

Laravel 5.5 Unknown database type enum requested Doctrine\DBAL may not support it

When I run CMD> php artisan migrate I got the below error Changing columns for table "gift_cards" requires Doctrine DBAL; install "doctrine/dbal". Unknown database type enum requested, Doctrine\DBAL\Platforms\MySqlPlatform may not support…
Mohammad Fareed
  • 1,927
  • 6
  • 26
  • 59
2
votes
1 answer

symfony 4: An exception occurred in driver: could not find driver

Working with Doctrine DBAL in Symfony 4 with the following conofiguration (doctrine.yaml): dbal: # configure these for your database server driver: 'pdo_mysql' server_version: '5.7' charset: utf8mb4 default_table_options: …
user1748166
  • 147
  • 1
  • 2
  • 14
2
votes
3 answers

Laravel Database Migration Column altered to Unique and Nullable causing error

I am attempting to integrate social logins with my existing laravel app. I am attempting to change email and password to nullable but I also need email to remain unique. On executing my migration I am getting an error for duplicate key name…
CirqueM
  • 77
  • 2
  • 9
2
votes
1 answer

Extending doctrine:build --db to create a DB View

I'm working on a Symfony 1.4 project with Doctrine 1.x, and functionality that merits using a Doctrie_View (as an interface for native MySQL Views). As I understand it, the View (as in DB View as opposed to the View in MVC) has to be created wth…
BenLanc
  • 2,344
  • 1
  • 19
  • 24
2
votes
3 answers

Load Categorywith id in bootstrap.php Shopware 5

in my bootstrap.php I try to load a category with a special id. Its not quite working. public function getCatFromDb($idCat){ /** @var \Doctrine\DBAL\Connection $connection */ $connection = $connection->get('dbal_connection'); $sql =…
Langer.197
  • 78
  • 8
2
votes
1 answer

Request count sql in symfony return boolean not integer

in symfony I want to get count from table in database but it return boolean ! $sql = "...."; $em = $this->getDoctrine()->getManager(); $stmt = $em->getConnection()->prepare($sql); $stmt->execute(); $res =…
Fredj
  • 59
  • 2
  • 9
2
votes
1 answer

Notice: Undefined index in array result of native query doctrine

I get array result of a native query in Doctrine. The query is $conn = $em->getConnection(); $sql = 'SELECT * FROM Stock_drink d WHERE id=?'; $stmt = $conn->prepare($sql); $stmt->bindValue(1,$idstockdrink); $stmt->execute(); …
DBCooper
  • 73
  • 8
2
votes
1 answer

How do I properly use Silex 2, Doctrine, and PDO via docker containers?

So I am attempting to build a Silex 2 application; using docker service containerization as the ENV control system. However, when accessing the resource the return is a PDO Exception 'driver not found'. docker-compose.yml # program code code: …
David J Eddy
  • 1,999
  • 1
  • 19
  • 37
2
votes
1 answer

Doctrine2 DBAL Exists query

I would like to ask for your help with Doctrine2 DBAL query built with QueryBuilder. I'm used to ORM, but I think it's an overkill for such query which is being called in a listener. I need a query with SELECT EXISTS and I don't know how I can…
pzaj
  • 1,062
  • 1
  • 17
  • 37
2
votes
0 answers

MySQL DBAL: How to get ALL the last insert id's for a multiple row insert?

I want to speed up my system a bit, and make some inserts happen in a one bigger insert. Currently I'm inserting some items into the db in a for-loop, but if I make a one sql-query out of the inserts and insert them at the end of the process, this…
GotBatteries
  • 1,346
  • 1
  • 19
  • 28
2
votes
1 answer

DBAL : save DateTime in DB

i'm trying to save DatTime object in MySQL DB. On insert, i have this error : "An exception occurred while executing 'INSERT INTO event (name_event, desc_event, minimalPrice_event, startDate_event, endDate_event, startHour_event, endHour_event,…
YoannLth
  • 197
  • 2
  • 14