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

  • SEARCH
  • Home
  • 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 6672151
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:28:27+00:00 2026-05-26T03:28:27+00:00

I tried all the tricks available in the net, but dont know why, i

  • 0

I tried all the tricks available in the net, but dont know why, i am not able to access the variable.. heres the snippet of class containing private variable:

class PANASONIC_PRICESHEET {

    public $models = array();
    public $options = array();       
    public $accessories = array();    

    private $identifier = '';
    private $name = '';
    private $currency1 = '€';
    private $currency2 = '£';

    /**
     * 
     */        
    public function __construct($name1 = 'unnamed', $identifier1 = '') {
        $this->name = $name1;
        $this->identifier = $identifier1;
    }

    public function getIdentifier() {
        return $this->identifier;       
    }

    /**
     * 
     */        
    public function getName($withIdentifier = false) {       
        if ($withIdentifier) {
            return $this->name . " - " . $this->identifier;
        } else {
            return $this->name;
        }
    }
}

And here is how i am accessing it:

$thisName = $pricesheet->getName();
$thisIdentifier = $pricesheet->getIdentifier();

And I am getting this error:

Fatal error: Cannot access private property PANASONIC_PRICESHEET::$name in
C:\AppServ\www\dashboard\sites\all\modules\_custom\pricing_system\pricing_system.inc
on line 316

How to fix this? I cannot make the field PUBLIC, its not a option at all. Any suggestions please.

EDIT – 1

Issue has been solved:
I was suppose to call $_pricesheet->getName();
thanks a lot for 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-05-26T03:28:28+00:00Added an answer on May 26, 2026 at 3:28 am

    This is currently working for me. Take a look here. You must be probably trying to access $pricesheet->name;

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

Sidebar

Related Questions

I've tried all scaletypes, but all of them result in the image to be
I've tried all the time calculating examples I found on this site but somehow
I have tried all the solutions that have been provided including using PRAGMA but
I've looked high and low, and tried all sorts of things, but it simply
Hi I tried all the solutions on the web and in SO but nothing
I have tried all of my normal tricks for detecting odd numbers (NaN, QNaN,etc)
I'm following (or rather not following!) the tutorial found here: http://www.flashuser.net/flash-tricks/tips-tricks-10-using-drag-drop-in-actionscript-3-0.html I've drawn a
How can I have a list with all the functions of a class but
I have tried all of these various ways to set the value of the
I have 2 path objects in my android code.I have tried all the way

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.