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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T06:32:26+00:00 2026-06-14T06:32:26+00:00

this is my problem. I’m using codeigniter and this is my structure. I have

  • 0

this is my problem. I’m using codeigniter and this is my structure. I have 2 classes in 2 files

class Model_setup extends CI_Model 
{
    //functions

    // an update function
    public function update()
    {
        // update stuff
    }
}

// OTHER FILE

class Tests extends Model_setup
{
    // other functions....

    // a totally different update function
    public function update()
    {
        // update a specific set of stuff
    }
}

I want to know if and how it is possible to reference these two separate update functions. In a separate controller from these two, say the Places_Controller how would you tell the difference between these two class methods and how would you make sure that you are only using one or the other of the two updates? Thank you for the help in advance.

  • 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-14T06:32:27+00:00Added an answer on June 14, 2026 at 6:32 am

    So I was enlightened by a friend about how to solve this. This doesn’t need any codeigniter frmaework stuff to be made to work correctly. The following would work correctly:

    class Model_setup extends CI_Model 
    {
        //functions
    
        // an update function
        public function update()
        {
            // update stuff
        }
    }
    
    // OTHER FILE
    
    class Tests extends Model_setup
    {
        // other functions....
    
        // a reference function to the parent function
        public function parent_update($x)
        {
            // update a specific set of stuff
            parent::update($x);
        }
    
        // a totally different update function
        public function update()
        {
            // update stuff
        }
    }
    

    Now from the outside world, say another controller in the framework you can call the following once everything has been loaded. $this->tests_model->parent_update($x) when you wish to call the parent version and $this->tests_model->update when you wish to call the update function for the Tests model. This worked and I have tested this.

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

Sidebar

Related Questions

This problem occurs in both NHibernate 2 and 3. I have a Class A
This problem has bugged me so many times and i have now decided to
This problem is driving me nuts. I have a prototype UITableViewCell in my storyboard.
This problem may be a bug. i have spent too much time trying to
This problem is similar to my previously asked question. When I query data using
This problem has been bugging me for a while. I have to load a
This problem probably has been discussed, but this one is slightly different. I'm using
This problem is the bane of my asp.net coding life. I have a control,
this problem is so weird. i have used jquery to link a specific id
This problem is happening is both IE8 and IE7. I have a small swf

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.