PHP / Propel delete the record 1: n

I've got two tables: step and links joined 1:n. I'm aiming to maintain the links through the step objects. I retrieve all steps from the database and populate the relation with the links table. I persist the step object containing a collection of lin

MySQL finds multiple records by two columns

Let's say I have an array as follows (ID => Type): $contentIndexes = [ 32 => 'news', 40 => 'blog', 68 => 'blog', 109 => 'document', 124 => 'news' ] And the following database table: CREATE TABLE `ContentIndex` ( `ID` INT(11) NOT NULL AUT

Sql-server: trigger and last ID inserted

I have a PHP application using a sql-server database and trigger. The workflow is the following: - I create an object in the DB, - a trigger logs the creation into a dedicated table, by inserting a row within, - then from PHP I get the last inserted

Xsl error when installing propel_generator by pear

I'm in the install Propel 1.7.0 via pear in wamp. Currently have: PHP v. 5.4.16 - libxslt v. 1.1.27 - libxml v. 2.7.8 - libxml2 v. 2.7.6 Apache v. 2.4.4 Mysql v. 5.6.12 Log v. 1.12.7 Phing v. 2.7.0 When you try to install propel_generator: pear chann

Creating 3 Propel subqueries

Hi guys I would like to ask if anyone of you know how to create a select statement in propel using a 3 level subquery... Initially I have this query and it works fine but I want it to be more like propel type... can anyone help me with this? Here's m

Propeller: Selecting Columns from Aliased Join Tables

I have the following two tables: table_a: id_table_a: { type: integer, primaryKey: true, autoIncrement: true, required: true } name: { type: varchar(255) } id_table_b: { type: integer, foreignTable: table_b, foreignReference: id_table_b } table_b: id

Strategies to extend Propel Models cleanly in Symfony2?

I want to do this: // Model class namespace Bookshop\Inventory\Model; use Core\Inventory\Model\Product as BaseProduct; class Book extends BaseProduct { // ... } // Query class namespace Bookshop\Inventory\Model; use Core\Inventory\Model\ProductQuery

How can I filter date-time columns by dates in Propel 1.6?

I would like to filter results as in $searchDate = "2013-03-01"; $query->usePublicationQuery() ->filterByPublishedAt($searchDate) ->endUse(); However, the problem is, that the values in this column contain also the time, i.e. they're ac

Validation with Symfony2 and Propel

I've recently started using symfony2 and propel for a project. It's not a smooth ride but its coming along ok. A few nights ago, I got stuck with form validations. I have my validation.yml defined as such: Project\MainBundle\Model\User: properties: f

Using the connection closure to the database in php

I was always in assumption that it is always a good practice to close database connection, regardless of database/ORM, like mysql_close(), Propel::close() etc. With reference to one of my other question and some other research on Internet, I came to

Ordered by PROPEL relations

I have: # config/schema.yml propel: jobeet_category: id: ~ name: { type: varchar(255), required: true, index: unique } jobeet_job: id: ~ category_id: { type: integer, foreignTable: jobeet_category, foreignReference: id, required: true } type: { type:

Symfony task - memory leak

I wrote a symfony task to fill a database of sample data. Here's a sample piece of code: gc_enable(); Propel::disableInstancePooling(); public function test() { for($i = 0; $i < 10000; $i++) { $this->doIt($i); } } public function doIt($i) { $user =

Symfony: save null instead of empty string

I have a table and one of the columns can be null. In symfony, with generated form, when i leave field for that column empty, script saves to database an empty string instead of null. How to change it?You can override your doSave() function in your f

Propel - fetchArray or toArray

In Doctrine i can use function fetchArray() instead of execute or toArray(). I can't founded equivalent these function for Propel. Is this possible?if you really need array you can always use old Peer API $criteria = new Criteria(); /* ...setup your

Symfony e-mail task does not work

I have problems with sending mails in Symfony 1.4.14 project with Propel 1.6 (sfPropelORMPlugin). When I am trying to run: ./symfony project:send-emails --message-limit=2 --time-limit=20 I am getting errors: PHP Warning: call_user_func() expects para

sfPropelPager reduce queries

i'm working in a symfony project and using sfPropelPager to show a paged list of elements. The problem is that with a great amount of data to list (i.e. thousands of registers) it makes a query to the database for each page to show!!!! That means abo

Propel - Join the same table multiple times and group

I'm writing a report with Propel and need to join the same table multiple times in order to get different stats for different date ranges using the same data. The issue appears to be that propel ignores multiple ->leftJoin() calls on a query. I think

how to convert propel criteria in symfony

select, b.title, b.start_time, b.end_time from tv_channel a left join tv_program b on = b.tv_channel_id and b.start_time >= '2011-09-23 12:00:00′ and b.end_time <= '2011-09-23 14:30:00' order by a.code limit 0, 10; –pager object tnxWhat's

Using WHERE IN with SQL statements prepared in Propel

In a system I'm working on that uses Propel for handling the database, I'm preparing a raw query that needs to accept a varying WHERE IN condition. A simple example what I'm trying to do is this: $c = Propel::getConnection(); $q = $c->prepare("SEL

Symfony: Load device data with empty mandatory fields?

I noticed that propel loads the fixture data into the database, even though we didnt specify some of the required fields of the table inside the .yml files. What are the reasons behind this? Easier development, etc.? Schema: jobeet_job: id: ~ categor

Select a date range where the date is not null with Propel

Using Propel I would like to find records which have a date field which is not null and also between a specific range. N.B. Unfortunately, as this is part of a larger query, I cannot utilise a custom SQL query here. For example: I may have records li

incremental update with symfony / propel

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