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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:51:39+00:00 2026-06-15T11:51:39+00:00

I have a super class called LClass . Then I create other classes, which

  • 0

I have a super class called LClass. Then I create other classes, which extend LClass.
For example this are classes for tables in database. ( user, order, etc…)
In each of these classes I use some static function getRecordById($id), which returns some array. The difference between these functions, they use different table names for executing. I want to put this static function getRecordById($id) in LClass. The problem is, that function is static, and for this I need some static variables to be set before I do something like $someUser = user::getRecordById($id).
Or any other suggestions?

  • 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-15T11:51:43+00:00Added an answer on June 15, 2026 at 11:51 am

    Programming exclusively using static methods is not object oriented programming, it’s “class oriented” programming. And it’s essentially the same as procedural code with a sliver of namespacing. Static methods have their use, but it is limited. Static methods should never do the main work of a class.

    Read How Not To Kill Your Testability Using Statics.

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

Sidebar

Related Questions

I have a abstract super class called RealAlgebraicNumber and two inherited classes called IntervalRepresentation
I have a class called Animal which is a super-class and pure polymorphic. I
I have an abstract class called camera which PointCamera uses as its super class.
I have a super class called PageObject, and then two subclasses called AlphaPage and
I have a class called CoverFlowClass. I used to do this to create a
I have a super class 'Node' and several sub classes e.g. 'SubNode1', 'SubNode2' etc.
So I have this class. We'll call it ProcessBox. I have another class called
Hi I have two classes, one called Instruction, one called LDI which inherits from
I have a base class called Geometry from which there exists a subclass Sphere
I have a custom class called Device which implements the MKAnnotation protocol. In 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.