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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:56:03+00:00 2026-05-23T19:56:03+00:00

i use a simple PHP framework (like Codeigniter) without ORM. I have a database

  • 0

i use a simple PHP framework (like Codeigniter) without ORM.

I have a database with product data (prices, sells, page in catalog…).

And i want to calculate the conversion per page and the conversion per product.

The calculations with SQL are not a problem, but i don’t really know where to put them in.

Should I create a “Page” and a “Products” model with methods like
"Page::getConversions($page_id)" or a "ConversionPerPage" and a "ConversionPerProduct" model, or sth. completely other.

  • 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-23T19:56:04+00:00Added an answer on May 23, 2026 at 7:56 pm

    I think that the best model classes are to have two classes for each table – one for object and plural for static classes.
    For example: if you have Page table then you should have Page and Pages classes.
    First one will allow you to have one object from table and you can do the regular methods on it like:

    $page = new Page($page_id);
    $conversions = $page->getConversions();
    $page_number = $page->getNumberInBook(); etc
    

    On the other hand in Pages class you can put the methods that will (usually) return the array of Page and those methods will usually be static:

    $pages = Pages::getPagesByCatalog($catalog_id);
    

    This way you will have real OOP and code complete with full model MVC implementation.
    I hope that this model hierarchy will help you. We are using it in our office and it showed to be really good.
    All the best!

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

Sidebar

Related Questions

I want to use the php simple HTML DOM parser to grab the image,
I'm looking for good/working/simple to use PHP code for parsing raw email into parts.
This question is simple. What function would I use in a PHP script to
My use case is very simple : I have a GUI application, and inside
I am developing a website in PHP and I would like to use a
I am using PHP and the codeigniter framework for a project I am working
Currently the php framework I'm dealing with has a simple conf file with define
For one specific client I have to use PHP. This and this question were
We use a simple object model for our low level networking code at work
I'm looking for something simple to use where the grammar is easy to define.

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.