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
1 answer

Propel - merge collection

Working with Propel ORM 1.5, I'm missing a method to merge two PropelCollections. A short proposal may be : public function mergeCollection($collection){ foreach($collection as $i => $item){ if( ! $this->contains($item)){ …
domi27
  • 6,903
  • 2
  • 21
  • 33
0
votes
1 answer

Execution of target "convert-conf" failed for the following reason - No valid xmlConfFile specified.

After following the tutorial on the propel website and executing the following 2 command without error: ./propel-gen om ./propel-gen sql I tried: ./propel-gen convert-conf The following error occurs. django@ubuntu{~/www/propel/addons/schema}…
Django23
  • 75
  • 9
0
votes
1 answer

How to access other filter values inside of a custom addXXXColumnCriteria?

I have a request to create a form filter that has two fields, one a freeform text and the other a select. The value in the select will determine how to handle the value of the text is turned into a criteria. I can create a custom…
Geoff Maddock
  • 1,700
  • 3
  • 26
  • 47
0
votes
2 answers

symfony 1.4 propel:build-model not working as expected

Just wondering if anyone might know what's happening here. I have several schema.yml files, and when I try to build model classes using symfony propel:build-model I don't get any error message, however instead of any classes being generated I get…
blackbourna
  • 1,223
  • 2
  • 16
  • 29
0
votes
1 answer

Propel custom Setter with SQL-specific stuff

I am using Propel 1.2 in a Symfony 1.0 project, with PostgreSQL db. I can use Criteria::CUSTOM in SELECT statements in order to use Postgres functions, like this (fulltext search): `$c = new Criteria(); $c->add(MyTablePeer::FULLTEXT_COLUMN,…
danieli
  • 33
  • 5
0
votes
1 answer

Propel to Doctrine Code Snippets

This is a totally newbie question, so please bear with me. I am learning symfony from the online Jobeet and Askeet tutorials, but most of my hacks have involved Doctrine, so I am not familiar at all with Propel. I have managed so far by researching…
Martin Fall
  • 121
  • 7
0
votes
1 answer

Multiple variable in propel create-query

According to the api (http://trac.propelorm.org/wiki/Documentation/1.6/ModelCriteria) I was searching for something like that: $param1 = 5; $param2 = 3; select id, name from testtable where ((sin(?) * (cos(?)); equal to select id, name from…
eav
  • 2,123
  • 7
  • 25
  • 34
0
votes
1 answer

Propel Nested Set in combination with Pagination

$root = AnimeCommentQuery::create()->findRoot(2); $html = "
    {$root->getComment()}"; foreach ($root->getDescendants() as $post) { $html .= '
  • '; $html .= $post->getComment(); $html .= ' by…
0
votes
1 answer

Cannot customize sfGuardGroup - cached version autosfGuardGroup is always used

I'm using the sfGuardPlugin with Propel on Symfony 1.4.11. I'm overriding some templates in sfGuardUser as well as sfGuardGroup and sfGuardPermission. On my localhost version this works, but on shared hosting the sfGuardGroup and sfGuardPermission…
Timm
  • 2,488
  • 2
  • 22
  • 25
0
votes
1 answer

Symfony - sfGuardUser - How to log group or permissions changes?

I log changes for objects in my application within the processForm function by checking for differences in the object before and after its been saved. I persist that to a log table in my database. For the sfGuardUser backend, I use the generated…
Geoff Maddock
  • 1,700
  • 3
  • 26
  • 47
0
votes
1 answer

Propel to Doctrine Code Snippet

I am using symfony 1.4 with Doctrine ORM. I am editing some of the actions, and I need to rewrite a Propel query into Doctrine. Here's the snippet: $c = new Criteria(); $c->add(BlogCommentPeer::BLOG_POST_ID, $request->getParameter('id')); …
Martin Fall
  • 121
  • 7
0
votes
2 answers

How to hydrate columns from JOIN tables into a Propel Object collection using custom SQL in just 1 query?

I'm using Symfony 2 with the propelorm/PropelBundle (Propel 1.6) and MySQL (InnoDB with declared foreign keys), and I'm using custom SQL as shown in the section Using Custom SQL to hydrate a propel object collection, as follows: $con =…
RayOnAir
  • 2,038
  • 2
  • 22
  • 33
0
votes
1 answer

Is it possible to only build certain models?

./symfony propel:build-model tries to build all models. Is it possible, and if so how, to specify only a certain model?
k0pernikus
  • 60,309
  • 67
  • 216
  • 347
0
votes
1 answer

Include Virtual Columns in toArray() Call with PropelORM

In a PropelORM object retrieved from a query with virtual columns from a join, is there a way/method to include virtual columns in the toArray() call? For example: $book = BookQuery::create() ->join('Book.Author') ->with('Author') …
Will Bonde
  • 560
  • 6
  • 19
0
votes
2 answers

PropelORM IN Clauses with ModelCriteria Object Parameter

With PropelORM, is it possible to add an IN clause with another ModelCritera object as the parameter? I had been trying the following without success: $oAuthorQ = new AuthorQuery(); $oAuthorQ->filterByLastName('Smith'); $oBookQ = new…
Will Bonde
  • 560
  • 6
  • 19