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

  • Home
  • SEARCH
  • 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 9283681
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T18:41:34+00:00 2026-06-18T18:41:34+00:00

I have a pretty simple Propel question. I’m storing leads in a database. Those

  • 0

I have a pretty simple Propel question. I’m storing leads in a database. Those leads have one or more community interests. The tables I’m using are named, ‘lead’, ‘community’, and a ‘lead_communities’ join table. What’s the best way to delete all of a lead’s community interests?

Here are some more details. The Propel schema looks like this:

    <table name="community">
      <column name="id" type="INTEGER" required="true" primaryKey="true" autoIncrement="true" />
      <column name="name" type="VARCHAR" size="255" />
      <column name="address" type="VARCHAR" size="255" />
      etc...


    <table name="lead_communities">
      <column name="id" type="INTEGER" required="true" primaryKey="true" autoIncrement="true"/>
      <column name="lead_id" type="INTEGER" />
      <column name="community_id" type="INTEGER" />
      <column name="created_date" type="DATE" size="4" />
      <foreign-key foreignTable="community" refPhpName="Lead_Communities">
        <reference local="community_id" foreign="id"/>
      </foreign-key>
      <foreign-key foreignTable="lead" refPhpName="Lead_Communities">
        <reference local="lead_id" foreign="id"/>
      </foreign-key>      
    </table>  

    <table name="lead">
      <column name="id" type="INTEGER" required="true" primaryKey="true" autoIncrement="true"/>
      <column name="salutation" type="VARCHAR" size="20" />
      <column name="first_name" type="VARCHAR" size="255" defaultValue="" />
      <column name="last_name" type="VARCHAR" size="255" defaultValue="" />
      <column name="email" type="VARCHAR" size="255" defaultValue="" />
      etc..

Here’s how I select the lead from the database:

$lead = LeadQuery::create()->filterByEmail($enauk)->findOne();

So, what I hope to do is something like:

$lead->deleteLeadCommunities();
  • 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-06-18T18:41:35+00:00Added an answer on June 18, 2026 at 6:41 pm

    Well, the easiest way I can think of without any other context is simply doing a query on the join table with a delete() call:

    $numDeleted = LeadCommunitiesQuery::create()
                    ->filterByLead($lead)
                    ->delete();
    

    Just to be clear, there is no generated method like what you want (deleteLeadCommunities), but you could always write it for convenience, and replace $lead in my example code with $this. So inside Lead.php:

    public function deleteLeadCommunities() {
      return LeadCommunitiesQuery::create()
               ->filterByLead($this)
               ->delete();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have pretty simple simple question (i hope so). How do i change the
I have a pretty simple question which perhaps someone familiar with Server/Client design &
My question is pretty simple: If you have two web-application components: Server-side (secret-capable) code
This one should be pretty simple. The use case is that I have a
I have pretty simple jquery code : $(document).ready(function(){ $('img.marqFl').on({ mouseenter: function() { $(this).animate({height: 300},
I have a pretty simple trigger: CREATE OR REPLACE FUNCTION f_log_datei() RETURNS TRIGGER AS
I have a pretty simple ASP.NET Web Form that looks a bit like the
I have a pretty simple Linq to XML query: var q = from c
I have a pretty simple SQL I need to perform. I have a ProcessUser
I have a pretty simple problem. Basically I have an array called $list that

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.