Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6766567
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:50:48+00:00 2026-05-26T14:50:48+00:00

I have noticed a strange behaviour when intercepting the preUpdate row hook in Propel

  • 0

I have noticed a strange behaviour when intercepting the preUpdate row hook in Propel (1.6.1). Consider this schema:

<?xml version="1.0" encoding="UTF-8"?>
<database name="test" defaultIdMethod="native" baseClass="MyBaseObject">
    <table name="test_event">
        <column name="id" type="integer" required="true" primaryKey="true" autoIncrement="true" />
        <column name="name" type="varchar" size="50" required="true" />
        <column name="description" type="varchar" size="250" />
        <column name="location" type="varchar" size="250" />
        <column name="nearest_city" type="varchar" size="100" />
        <column name="start_time" type="timestamp" />
        <column name="duration_mins" type="integer" />
        <column name="organiser_id" type="integer" required="true" />
        <foreign-key foreignTable="test_organiser">
            <reference local="organiser_id" foreign="id" />
        </foreign-key>
    </table>

    <table name="test_organiser">
        <column name="id" type="integer" required="true" primaryKey="true" autoIncrement="true" />
        <column name="name" type="varchar" size="50" required="true" />     
        <column name="email" type="varchar" size="100" />
    </table>
</database>

I’ve noticed that an update to TestOrganiser results in two preUpdate calls to the custom class – one for itself and one for TestEvent. However, if the first table is updated, only itself gets a preUpdate call. Why is this?

Edit: earlier I added my own answer. However if anyone would like to add further detail, please do – the more clarity the better! If an update is made to test_organiser, in what sense can test_event be said to be updating, especially since it is marked as unmodified?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T14:50:49+00:00Added an answer on May 26, 2026 at 2:50 pm

    I typed out most of this question, and then worked it out for myself! I thought I would add the q anyway, as I think it is of general interest.

    I’d initially thought that TestEvent ought to get the two calls – one for itself, and one for its dependent object. But a save to TestEvent doesn’t affect TestOrganiser, since the relation goes out from test_event to test_organiser.

    So, the Propel behaviour is correct; since test_organiser is dependent on test_event, both are notified if the former is modified. This can be thought of like a non-hierarchical parent-child relation (test_event has the foreign key, so that is the ‘parent’).

    My solution to filtering out related row notifications of this kind (and non-modified rows generally) is simply to do this in the custom row ancestor class:

        public function preUpdate(PropelPDO $con = null)
        {
            // Ignore (related) rows with no changes
            if (!$this->isModified())
            {
                return true;
            }
    
            // Rest of handling code here...
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've noticed some very strange behaviour today in Code Igniter. I have this locations
I am creating a responsive website, and have just noticed a strange behaviour in
after adding adMob ads to my application, I have noticed some strange memory behaviour.
I have noticed a strange piece of behaviour when using MessageDlg and attempting to
I have noticed a rather strange behaviour in IE. I have a HTML form
I have noticed a strange behaviour of TextBox while BorderThickness property is set to
I have noticed a strange behaviour of a str_replace function. Can you tell me
I just noticed a strange behaviour in IE7. I have radio buttons with associated
I noticed a strange behavior regarding keydown event in Chrome. I have this simple
I have noticed a strange behaviour when using the command functionality in Silverlight: When

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.