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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T08:22:19+00:00 2026-06-07T08:22:19+00:00

Help/support application built with Zend Framework 1 and Doctrine 1.2.4. Problem: when creating new

  • 0

Help/support application built with Zend Framework 1 and Doctrine 1.2.4.

Problem: when creating new support ticket without assigning staff_id (support personnel) at first, Doctrine inserts empty row in staff table, because staff_id is NULL, and no matching id with NULL value could be found in staff table.

New ticket is created, note NULL value for staff_id

INSERT INTO tickets (closable, emergency, survey_sent, brands_id, departments_id, categories_id, status_id, staff_id, subject, contacts_id, mask, initial_categories_id, last_opened, last_activity, created_at, updated_at) VALUES ('0', '1', '0', '1', '4', '6', '1', NULL, 'Cancellation Request', '5463', 'MQXB-39568', '6', '2012-06-14 03:15:49', '2012-06-14 03:15:49', '2012-06-14 03:15:49', '2012-06-14 03:15:49')

New row in staff table with some default values, this is the problem.

INSERT INTO staff (enable_dst, last_page, external_links, replies_per_page, active) VALUES ('1', '0', '0', '10', '1')

wild query appears

DELETE FROM staff_index WHERE (id = '197')

and now ticket_posts (post = staff note) table is updated with newly inserted ticket ID, and newly inserted blank row in staff table (staff_id should be NULL here)

UPDATE ticket_posts SET tickets_id = '12455', staff_id = '197', updated_at = '2012-06-14 03:15:49' WHERE id = '48113'

I’ve “solved” empty rows by setting second column (username) to not null, but not a real solution.


Is there a way to tell Doctrine, nothing to do here, move on?


( ^ bottom line )

  • 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-07T08:22:22+00:00Added an answer on June 7, 2026 at 8:22 am

    http://doctrine.readthedocs.org/en/latest/en/manual/working-with-models.html#clearing-related-records

    public function preSave()
    {
        if (empty($this->staff_id))
            $this->clearRelated('Staff');
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a web application built in asp.net, which uses resource files to support
I want to know that how can I add help support to my winform
Help, I'm trying to create a new post in my wordpress blog with custom
Help, I can't function without Resharper . All of a sudden my Alt +
Help me please with the following problem: - (NSDictionary *)getGamesList { NSMutableDictionary *gamesDictionary =
In an application I'm creating, I've got two components that I want the user
I built a custom control, and with theme support on it looks very strange.
With all the new hype surrounding native extension support in AIR 3, I haven't
I'm creating a new rails 3.2 project and everything is loading fine except the
I want to build very simple help desk application in purpose of learning grails.

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.