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
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
I am using Propel ORM and I set everything that must be from Propel Documentation. I have tables and when i echo the result from some Table row the result is just NULL, and NULL for everything. Of course these tables/rows are not empty. It works fine
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
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
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
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
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
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
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
I need to use transaction for a block of code, it consists of multiple insertions. Is it a good practice to have whole block of code within a try catch block, start transaction before the try..catch block. Then for any exception caught rollback the t
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
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:
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 =
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: "
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
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
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
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
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
select a.id, b.title, b.start_time, b.end_time from tv_channel a left join tv_program b on a.id = 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
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
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
I have a table that uses an auto-incremented primary key and it has several fields. <column name="id" type="INTEGER" primaryKey="true" required="true" autoIncrement="true" /> <column name="fi
I have a functionality in my project where in I have to show a preview to the user as to how the page will look like after submitting the form. For preview, I am setting related propel object with the form values and in the end not saving any values
I am new to Symfony framework. I got Symfony (v1.4.8) on my Netbeans 6.8 and also got the initial success page. Now, I want to Configure a database using Propel ORM Tool. But in Netbeans I am getting Doctrine as the default tool enabled. I am not eve
I have a raw sql query I need to run, but the database name changes in each environment (live: db, dev db_test) I need to get the current database name from the databases.yml file. How can I get just the current database name? I am using the Propel O
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
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
This has to be simple... I'm trying to preserve the current date that is already stored in an updated_at field in the DB. I'm updating a single field value in the same row and then saving but I don't want it to update the updated_at field. I want to