Questions tagged [propel2]

Propel2 is the next major version of an open-source Object-Relational Mapping (ORM) for PHP5. It allows you to access your database using a set of objects, providing a simple API for storing and retrieving data.

Propel is an open-source Object-Relational Mapping (ORM) for PHP5.

It allows you to access the records in your database using a set of OOP objects, providing a simple API for basic CRUD operations. To accomplish this, Propel ORM includes a generator component which uses source code generation to build PHP classes based on a data model definition written in XML (or reverse-engineered from an existing database). Propel also includes a runtime component which manages connections, transactions, and any idiosyncratic rules that describe the workings of the RDBMS being used with Propel.

In addition to being open source, the code as implemented in a project is extendable with behaviors which alter the generated class structure and by working with the one-time generated model classes themselves which extend the base Active Record classes.

It is also an integral part of the PHP framework Symfony and was the default ORM up to and including version 1.2.

Documentation:

68 questions
0
votes
0 answers

Propelorm Override DELETE method in all tables

(Translated by Google) Hello I have already created and loaded for all tables, a behavior very similar to the example in: timestampable. There, I override the preInsert and preUpdate methods. That works very well. Now I need to be able to control…
Marco Scarnatto
  • 117
  • 1
  • 9
0
votes
0 answers

How to write SQL query in to Propel Query?

I have following query in SQL. SELECT * FROM sf_product LEFT JOIN sf_product_m ON sf_product_m.ref_m_id = sf_product.id LEFT JOIN ref_m ON ref_m.id = sf_product_m.ref_m_id; I'm new to propel and I have no idea how to do this in propel.
0
votes
0 answers

Having issue Propel Installation in Symfony 5

I'm using following command composer require propel/propel-bundle and getting the following error Problem 1 - propel/propel-bundle[1.5.0, ..., 1.5.2] require symfony/framework-bundle ^2.8.2 -> found symfony/framework-bundle[v2.8.2, ..., v2.8.52]…
0
votes
1 answer

How to retrieve rows from many to many relation in propel?

I did not find in the documentation how to select nested properties. I need the result like this: { "data": [ { "Id": 3, "Fname": "Fname", "Lname": "Lname", "Mname": "Mname", "UserId": 1549, "Login":…
Steve
  • 139
  • 7
0
votes
1 answer

Propel2 Reverse second run has deleted columns

I am new to propel. There doesn't appear to be a version command built in, but composer shows propel2 in my description. I reverse engineered my scheme and models from the database then took six months off the project, came back, remastered the…
Tom
  • 1,971
  • 3
  • 22
  • 32
0
votes
0 answers

PHP Propel delegate behavior

I've implemented the behavior like this
javal88
  • 1,188
  • 3
  • 17
  • 29
0
votes
1 answer

How to join two tables in Propel that don't have a foreign key defined between them?

I have a project that uses Propel 2 and there are two tables that I want to join on a certain field, but there is no foreign-key relationship there. I just want to match them up based on that value. Unfortunately I cannot get it to work, and…
Vilx-
  • 104,512
  • 87
  • 279
  • 422
0
votes
1 answer

UNION query in propel ORM v1.6

I am converting some existing queries into propel ORM. Now i am stuck with converting following similar query in propel. (SELECT name,address,phone FROM table_1) UNION (SELECT name,address,phone FROM table_2) UNION (SELECT name,address,phone FROM…
Nuwan Attanayake
  • 1,161
  • 9
  • 20
0
votes
1 answer

How create a behavior on propel 2

I installed the following packages on a symfony 2.8 project because I want to upgrade to version 3.4 to take advantage of the LTS "propel/propel-bundle" : "4.0.x-dev", "propel/propel" : "2.0.x-dev", I search how to declare a behavior, before I was…
skyhell
  • 43
  • 7
0
votes
1 answer

Propel database:reverse generates empty foreign key attributes in schema

I have a table which was created using the following syntax: CREATE TABLE `Agreements` ( `Agreement_ID` int(30) NOT NULL AUTO_INCREMENT, `Case_ID` int(11) NOT NULL, KEY `fk_case_id` (`Case_ID`), CONSTRAINT `fk_case_id` FOREIGN KEY…
leonardoborges
  • 5,579
  • 1
  • 24
  • 26
0
votes
1 answer

Propel object collection bind column alias to the foreign table object insted of getting it out

I have two db tables one is Item and the other (Unit) is represent all the measure units available for Item table. In this scenario Item table contains a foreign key of Unit table which acts as one to many relation. With Propel ORM I can join both…
Madushan Perera
  • 2,568
  • 2
  • 17
  • 36
0
votes
1 answer

Why does propel fail to set this ENUM field to "Y"?

I'm scratching my head over this. I have the following table:
Zeal
  • 474
  • 3
  • 4
0
votes
0 answers

PHP Propel cache query on runtime

Good morning, We are using propel combine with Thelia. But for some query we would like to add cache. Is it possible to set cache config on runtime ? For example, we need the id of the postal delivery mode, we use this query often, so I would like…
LinChan
  • 417
  • 1
  • 5
  • 17
0
votes
1 answer

Propel2 joining with the table and then grouping by with aggregate function

I have two tables: food(id, name), review(user_id, food_id, rating). Now I want to join food table with review table and add virtual column to the food table with name avg_rating, that will obviously hold value of average rating of the food based on…
0
votes
1 answer

Invalid type for path "propel.database.connections.project.attributes". Expected array, but got string

I'm trying to create the SQL Schema with Propel ORM based on the schema.xml file with the command .\vendor\bin\propel sql:build I'm getting an error which is this: [Symfony\Component\Config\Definition\Exception\InvalidTypeException] Invalid type…
sander
  • 1,426
  • 4
  • 19
  • 46