0

What I'm trying to do is bitwise flagging when using setPARAM().

What I know is magic function __get() or __set() being called when you refering protected variables and its also not a good practice.

So,

// This is an example for what I did.
class boo {
    // @var string name ;
    public $name;
    // @var int edit ;
    public $edit;

    public function setName($var=null) {
        .. do stuff..
    }
}

Every time when I add an property, class requires additional get, set function. Can I handle this differently except using __set()?

GatesPlan
  • 465
  • 1
  • 4
  • 17
  • 1
    http://stackoverflow.com/questions/2697922/are-magic-methods-best-practice-in-php – yivi Jan 05 '17 at 07:32
  • 1
    http://stackoverflow.com/questions/6184337/best-practice-php-magic-methods-set-and-get – yivi Jan 05 '17 at 07:32
  • http://stackoverflow.com/questions/18351877/should-i-or-should-i-not-use-getter-and-setter-methods – yivi Jan 05 '17 at 07:32

0 Answers0