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
6
votes
2 answers

Is there a good comparison of Doctrine vs Propel?

I've seen plenty of comparisons of Doctrine vs Propel, but none of them has actually convinced me to choose Doctrine over Propel. I've been using Propel for a while now and almost every comparison I read states that Propel is not well documented as…
David Conde
  • 4,631
  • 2
  • 35
  • 48
6
votes
1 answer

MySQL Match ... Against query very slow

I work on a website running on Propel ORM and I have this query: if(isset($args["QueryText"]) && $args["QueryText"] != "") { $query = $query ->withColumn("(MATCH (Request.Subject, Request.Detail) AGAINST ('" . $args["QueryText"] . "' IN…
Pawel
  • 188
  • 4
  • 17
6
votes
1 answer

Multiple variable connections with Propel and Symfony2

I'm building an application in Symfony2 where every user gets its own database, meaning all users have their own set of database credentials. The user doesn't know those credentials, they are stored within the application. Depending on which user is…
Stan
  • 493
  • 4
  • 15
6
votes
2 answers

UNION query with Propel ORM

I'm trying to create a UNION query using the Propel ORM e.g $criterion1 UNION $criterion2 Does anyone know how to do this?
Stick it to THE MAN
  • 5,621
  • 17
  • 77
  • 93
6
votes
5 answers

How to compile Propel Criteria to SQL

How can I compile Propel Criteria to clear SQL? I've tried $criteria->toString(); but this is not I expected. Also I've tried ModelPeer::doSelectStmt($criteria) but it returned raw sql (required parameters substitution)
smileua
6
votes
1 answer

How can I get extra columns when hydrating Propel objects with custom SQL?

I am using custom SQL to join two tables, apply some business logic to dates, then use the results to hydrate a propel object (collection). Here's my code: $testtypes = TesttypeQuery::create()->find(); foreach ($testtypes as $testtype) { /* work…
LeonardChallis
  • 7,759
  • 6
  • 45
  • 76
5
votes
3 answers

How to specify defaultValue to "now" for a timestamp column in Propel?

Here is my table definition for Propel schema. Column modified has timestamp type (DateTime in PHP) and I'd like to assign a default value to now. I've tried setting it to "now" but I'm getting an error using propel-gen insert-sql command: "Syntaxt…
gremo
  • 47,186
  • 75
  • 257
  • 421
5
votes
1 answer

Why must we assign a clone to a new variable?

I am currently learning to use the Propel ORM, and I want to reuse a critera for two slightly different queries: $criteria = ArticleQuery::create() ->filterByIsPublished(true) ->orderByPublishFrom(Criteria::DESC) …
CheeseSucker
  • 1,270
  • 1
  • 9
  • 13
5
votes
4 answers

sfguard bundle for symfony2

There is a bundle for (Propel) for symfony2,is there sfguard bundle for symfony2
Bhanu Krishnan
  • 3,726
  • 1
  • 20
  • 40
5
votes
2 answers

How to order by multiple columns with propel

I need to sort a query by 2 columns. Is this possible using propel? i tried: $c->addAscendingOrderByColumn(self::COL1); $c->addAscendingOrderByColumn(self::COL2); but the second call to addAscendingOrderByColumn overrides the first…
Radu Dragomir
  • 660
  • 2
  • 9
  • 35
5
votes
1 answer

Propel and Composer in PHP: no connection

I've problem in configuring Propel with Composer in my php project. this is how appears my tree directory: project/ |--/public_html/index.php |--/app/ | |--data/ | | |--propel.json | | |--schema.xml | …
Sim Sca
  • 413
  • 7
  • 18
5
votes
2 answers

How to use MySQL functions in Propel

I want to select records that are 1 month old or newer. The query is: SELECT * FROM foobar WHERE created_at > DATE_SUB(curdate(), INTERVAL 1 MONTH) Using Propel in Symfony, I do: $c = new Criteria $c->add(FoobarPeer::CREATED_AT,…
Tomas Kohl
  • 1,388
  • 1
  • 19
  • 27
5
votes
5 answers

Symfony app - how to add calculated fields to Propel objects?

What is the best way of working with calculated fields of Propel objects? Say I have an object "Customer" that has a corresponding table "customers" and each column corresponds to an attribute of my object. What I would like to do is: add a…
Tomas Kohl
  • 1,388
  • 1
  • 19
  • 27
5
votes
4 answers

Unable to use Propel 2 (Class not found)

I'm tryng from several days to setup and use Propel now 2.0. PHP version is 5.4.4-14+deb7u5 What I have done: 0) Fresh LAMP with a folder "test" in /var/www 1) Composer.json with { "require": { "propel/propel": "2.0.*@dev" } } (also…
sineverba
  • 5,059
  • 7
  • 39
  • 84
5
votes
1 answer

Propel how to generate UPPERCASE columns

I'm updating an old project which uses Propel 1.6 I added the required table to the schema.xml file, and was about to generate when I realised I don't have propel_generate installed. So I installed propel/propel_generator via pear. Now when I…
Bjorn
  • 133
  • 1
  • 7
1 2
3
77 78