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 6829689
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:31:47+00:00 2026-05-26T22:31:47+00:00

I am doing all sorts of stuff with Propel that is probably a bit

  • 0

I am doing all sorts of stuff with Propel that is probably a bit edge case – specifically I have found that a classname associated with a tablename is cached somewhere, and due to my rebuilding a model with different classnames but same table names (for unit testing purposes) Propel is getting in a right pickle. (You won’t need Propel experience for this question; just an understanding of PHP, probably magic calls in particular).

To debug this issue, I have found that Propel populates a “tablemap” class for a table when a column value is being set. My intention is to work out where in the code this population takes place, so I can clear the cached tablemap(s) in Propel.

Specifically, the class TestOrganiser has a generated parent BaseTestOrganiser, and this has a column setter method thus:

// The ** lines are mine, the rest are auto-generated by propel.
// The output when setting a value and saving is "no yes " which
// shows that the '$this->modifiedColumns[]' line triggers the
// tablemap population
public function setName($v)
{
    if ($v !== null) {
        $v = (string) $v;
    }

    if ($this->name !== $v) {
        $this->name = $v;

        $map = Propel::getDatabaseMap('test'); // **
        echo $map->getTables() ? 'yes ' : 'no '; // **
        $this->modifiedColumns[] = TestOrganiserPeer::NAME;
        echo $map->getTables() ? 'yes ' : 'no '; // **
    }

    return $this;
} // setName()

As per the comments, the value of $map->getTables() moves from empty to non-empty as a result of the $this->modifiedColumns[] = TestOrganiserPeer::NAME line. However, there is no __set() method in this class or its child or parents, so I am quite mystified what code could be triggered here.

Any ideas?

  • 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-26T22:31:48+00:00Added an answer on May 26, 2026 at 10:31 pm

    D’oh! It’s quite obvious, with hindsight!

    I added in a line to print debug_backtrace() and found the code that triggers the populations of the tablemap. This eventually showed that the use of TestOrganiserPeer triggers Propel’s autoloader, and when a peer class is loaded, this in turn results in an immediate call to BaseTestOrganiserPeer::buildTableMap().

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am doing a greeting card app.I do all sorts of stuff on my
I'm looking at a complex bit of JavaScript, which is doing all sorts of
If all that you're doing is a simple one-pass iteration (i.e. only hasNext() and
I have a Windows service that has a number of threads that all need
I'm doing some stuff that uses snow clusters. Currently the only way I know
I've been doing all people told me to make it works , but there
we're transitioning to doing all our task tracking in TFS 2010 and I'm wondering
I'm deleting an item and want to pop-up a confirmation window before doing all
I'm using rails, but doing all my Javascript unobtrusively using jQuery in application.js .
I'm in a project where it's pretty much my first time doing all the

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.