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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T08:16:44+00:00 2026-05-28T08:16:44+00:00

I’m currently re-writing a quote system in PHP which is used by multiple sales

  • 0

I’m currently re-writing a quote system in PHP which is used by multiple sales advisor’s. Each advisor can quote somebody multiple times a day and I’m looking for a better way of managing quote data from a MySQL table.

What would you suggest is the best way to write the system? I’m thinking of going down the route where each quote inherits a kind of quote class which allows it to perform certain operations. I can’t see why this would be bad, since the idea of writing a class is for it to be used by multiple children?

If I did this though, the question then becomes, how do I keep a lookup of these quotes when they’re being displayed and ensure that the right quote performs the right action? Perhaps an array with a pointer to the class it comes from, or dynamic variable names?

  • 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-28T08:16:44+00:00Added an answer on May 28, 2026 at 8:16 am

    I’m doing something similar with a client’s website I’m working on. They want to be able to offer promotions, of which could be something like buy one get one free, a set percentage off, a free item, etc. I made an base abstract Promotion class that handles some of the default functionality, but also defines other abstract methods — load() and save() being the important ones here I believe.

    When the information about a promotion is saved, it also stores its class name in there. When the system goes to load that row from the database, it sees the class name, creates an instance of it, and tells it to load the Promotion with information from that row.

    Since each Promotion might have different ways to save or load, the table is essentially a template that could be used, but doesn’t prevent each individual Promotion subclass from creating its own.

    You could essentially do the same thing with your Quotes. Store which subclass saved the quote, and have it load the information. Then when it comes time to display, you can call a general $quote->toHtml() — or however you want to do it — and it will be in charge of formatting itself appropriately.

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

Sidebar

Related Questions

I used javascript for loading a picture on my website depending on which small
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I am trying to understand how to use SyndicationItem to display feed which is
I have a jquery bug and I've been looking for hours now, I can't
Basically, what I'm trying to create is a page of div tags, each has
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
this is what i have right now Drawing an RSS feed into the php,
I would like to count the length of a string with PHP. The string
I am currently running into a problem where an element is coming back from

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.