Questions tagged [propel]

Propel is an open-source object-relational mapping (ORM) for PHP 5. It allows you to access your database using a set of objects, providing a simple API for storing and retrieving data. There are two major versions, 1 and 2.

Propel is an open-source object-relational mapping (ORM) for PHP 5.

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:

1161 questions
0
votes
3 answers

Implementing GeocodableBehavior in Symfony 1.4 (using Propel)

I'm trying to implement the GeocodableBehavior on a Symfony 1.4 (with Propel 1.6) project i'm working on, but until now it's a complete failure. I've tried to search if other people but I didn't found anything, like if I was the only one having…
evanesis
  • 260
  • 1
  • 9
-1
votes
1 answer

Many-to-many relations are dropped when updating a foreign entity in symfony

I'm working with Symfony 1.2 (can't update, it's not up to me) with Propel as ORM. I'm having a bizarre problem with my many-to-many relations. Let's say you have two tables A and B, and a many-to-many relation A_has_B. Let's say I have an a entity…
Waiting for Dev...
  • 12,629
  • 5
  • 47
  • 57
-1
votes
1 answer

Are incomplete key references in Propel useful?

I am using Propel to develop a system in which users can develop their own schemas, so am looking at some "edge cases". I have come across a schema that I think Propel should disallow, but it does seem to build. Can anyone suggest a use case for…
halfer
  • 19,824
  • 17
  • 99
  • 186
-1
votes
1 answer

Symfony 3.4 + Propel + Authentication Error

I have setup Symfony 3.4 with propel and it's working fine. I have create one login script and get error. public function loginAction(Request $request) { $session = $request->getSession(); $authUtils =…
-1
votes
2 answers

Join multiple table in one join in propel

I've been all over the web looking for answers on this. I hope someone here could help me with this. I am trying to compose the query below using propel. Is possible? SELECT * FROM table1 LEFT JOIN (table2, table3) ON ( table1.id =…
uji
  • 1,603
  • 3
  • 12
  • 12
-1
votes
1 answer

Propel - get primary key after find

The question boils down to finding the proper way how to getPrimaryKey when iterating over a yielded result. When using select method, the result is an object of ArrayCollection which doesn't provide the getPrimaryKey method. A simple snippet $q =…
sitilge
  • 3,687
  • 4
  • 30
  • 56
-1
votes
1 answer

Send array list to Twig View without headers in Symfony 2

I need help sending query list to Twig without headers. I have already query my data and I am stuck. I had to have this data in JSON structure. This is name of my root: 'AdminBundle:Note:viewPdf.html.twig' And here is name of query class in propel -…
Mac
  • 1
  • 2
-1
votes
1 answer

Propel diff command is not working as expected

When I use propel diff command, it makes a migration but it's not as expected. If I add a new field to the database, it generates a drop migration. So the up function contains: ALTER TABLE `mytable` DROP `field` Why Propel is doing so? Am I missing…
Omid
  • 4,575
  • 9
  • 43
  • 74
-1
votes
2 answers

Symfony 1.4 - Updating hidden value when form is updated

I am trying to modify the default value of a form field every time the form is updated. I have tried to edit the $form->bind in my processForm (..) but I am unsure how to do so. Is it possible to get some example code or any approaches to do? The…
aam1r
  • 11
  • 2
-1
votes
1 answer

Delete propel migration

When I try to generate a migration class with php app/console propel:migration:generate-diff --connection=control but I get the error: [Propel] Error …
Stan
  • 493
  • 4
  • 15
-1
votes
3 answers

Database error handling: what if you have to call outside service and the transaction fails?

We all know that we can always wrap our database call in transaction ( with or without a proper ORM), in a form like this: $con = Propel::getConnection(EventPeer::DATABASE_NAME); try { $con->begin(); // do your update, save, delete or…
Graviton
  • 81,782
  • 146
  • 424
  • 602
-1
votes
1 answer

Propel Criteria

I'm trying to create the following statement using Criteria and Propel: AND unix_timestamp(table.last_action) > unix_timestamp(table.last_action) -1800 But i don't seem to be able to get it right $kriterien->add(sfGuardUserProfilePeer::LAST_ACTION,…
ldrocks
  • 1,095
  • 1
  • 10
  • 14
-1
votes
1 answer

OR sentence example in PROPEL

im learning about propel, in documentation i found examples about WHERE/AND WHERE/IN but i cant found examples for WHERE/OR. How i can make this SQL in propel? SELECT * FROM `users` WHERE `username`='carasuman' OR…
Carasuman
  • 636
  • 1
  • 7
  • 17
-1
votes
1 answer

In a unit test using Propel in symfony, how can I reset the connection after an expected Exception

Working in symfony 1.4, with Propel for my ORM (not sure how to find the version of Propel). In a unit test of an object with a unique constraint in the database, I test for the exception being caught: try { $room1a->save(); // Shouldn't have…
Colin Fine
  • 3,334
  • 1
  • 20
  • 32
-2
votes
1 answer

Database-neutral table locking library for PHP

I have a scenario in which I think I need to lock a table against all activity (reads and writes). I am using Propel 1.6.x and intend to write a small extra library to handle the locking. My use case is a version table that has a primary key of (id,…
halfer
  • 19,824
  • 17
  • 99
  • 186
1 2 3
77
78