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 whatever here.
$con->commit();
} catch (PropelException $e) {
$con->rollback();
thr...
I have a database. I am trying to reverse engineer using symfony to create schema.yml. I get this error message:
[propel-schema-reverse] There was an error building XML from metadata: SQLSTATE[HY000]: General error: 2030 This command is not supported in the prepared statement protocol yet
I can generate the schema.xml using Creole but ...
I want to output the query generated by a symfony propel select for testing purposes. Is there any way to do this? I know I can use the sf_debug bar, but sometimes I need to see the statement in a situation where the sf_debug bar hasn't loaded yet, or isn't going to load at all.
...
Hi folks,
I'm trying to use Propel's NestedSet feature. However, I'm missing something about inserting such that the tree is balanced as it is created (i.e. fill it in horizontally).
Say I have these elements:
root
r1c1 r1c2
r2c1 r2c2
I want to insert r2c3 as the 1st child of r1c2 (i.e. fill row 2 before starting on r...
We are finding cases where we get the following 500 error:
File xyz.php does not exist or class "xyz" was not found in the file at () in SF_ROOT_DIR/lib/vendor/Zend/Loader.php line 107 ...
where xyz ==
Memcache (when trying to use symfony cc on the command line)
or
sfDoctrineAdminGenerator (when using an old-ish AdminGenerator-g...
I have an auto generated BaseBlahBlahBlahFilter.class file in my /lib/filter/base/ folder. It contain the following line for 'data' type field :
'date' => new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(), 'to_date' => new sfWidgetFormDate(), 'with_empty' => true)),
When the form loads it shows me empty va...
Hi,
I have an issue that is quite annoying with symfony 1.2 and propel.
I have a model where I have implemented inheritance using the single-table strategy. So, here is an excerpt of my model:
Ad (id, posted_date, description)
then RealEstateAd(location, price, transaction_type) and JobAd(position, requirements, company) which inherit bo...
In my project I have 2 databases. propel-build-model is already set up to work for 2 databases - http://stackoverflow.com/questions/733224/multiple-databases-support-in-symfony
If I make changes to either of the databases, I need the propel-build-schema command to rebuild the schemas for both.
I know I can do this manually by amending ...
How can I properly switch the newly installed Symfony 1.4 framework from Doctrine (that it is configured for by default) to Propel?
...
Hi,
I would like execute a query like this one in symfony using the Propel ORM:
UPDATE ADS SET HITS=HITS+1 WHERE ID=10;
I know that Propel API can let me set a previously fixed value for a column of a given record, but I definitely don't want to retrieve the column value first before issuing an update query since there are concurrent...
I am writing a query using the Propel ORM
The query is of the form:
select * from some_table where some_table.created_at = (SELECT MAX(some_table.created_at) from some_table);
I got this far:
$c = new Criteria();
$c->addSelectColumn('MAX('.self::CREATED_AT.')');
Anyone knows how to use Propel to do this, to save me writing RAW S...
I have a Page object whose uniqueness comes from its PageDomain. The schema is configured such that the page table contains a page_domain_id field to create the relationship. To show a page, I have an executeShow action and a custom handler. My route looks like this:
page_show:
url: /:domain_slug/:slug
class: sfPropelRoute
o...
I'm trying to create a UNION query using the Propel ORM e.g
$criterion1 UNION $criterion2
anyone knows how to do this?
...
Hi,
I'm starting a new project with symfony which is readily integrated with Doctrine and Propel, but I of course need to make a choice.... I was wondering if more experienced people out there have general pros and/or cons for going with either of these two?
Thanks a lot.
EDIT:
Thanks for the all the responses, useful stuff. There's n...
I have a table called "talk", which is defined as abstract in my schema.xml file.
It generates 4 objects (1 per classkey): Comment, Rating, Review, Checkin
It also generates TalkPeer, but I couldn't get it to generate the other 4 peers (CommentPeer, RatingPeer, ReviewPeer, CheckinPeer), so I created them by hand, and made them inherit ...
I am using the Propel ORM with SF (1.4). I am writing a class, and I need to rewrite a query Doctrine query into Propel:
$q = Doctrine_Core::getTable('sfGuardRememberKey')->createQuery('r')
->innerJoin('r.sfGuardUser u')
->where('r.remember_key = ?', $cookie);
if ($q->count()){ // Do Something }
can anyone help wi...
I am going through an issue to setup a file upload validator on callback.
I want to achieve this:
I have a form, where user choose the type of the file they are uploading and upload the file.
So I want to set the validator to handle images in case they chose "img" as type, and pdf if they chose "pdf".
Moreover I want to specify the mi...
When trying to create a build using propel-gen (propel v 1.4) I get:
[phing] Error reading project file
[wrapped: Unable to open
/path/to/project/build-propel.xml for
reading: ]
I can't find a reference to this file in the propel documentation.
...
I am using Propel (1.4) with Symfony 1.31 (with mySQL db).
I want to save save/retriev BLOB (gzipped) data to/from the database
My db schema is defined in YML.
Suppose the schema looks like this:
demo_blobbed_object:
_attributes: { phpName: MrBlobby }
id:
name: {type: varchar(32)}
data: {type: ? }
I have the following questi...
I use the following code to make Propel 1.4 works in a php file.
what should i do to make sure DatabaseManager delete correctly after its work?
shutdown at the end of the php file??
what will happen if there are multiple accesses to the same php file at the same time?
<?php
require_once(dirname(__FILE__).'/../config/ProjectConfigura...