Notice: Use of undefined constant self - assumed 'self' , When put in property_exists as the first argument

Use self to refer to the current class. Not class name.

Try using magic constants:

if(isset($user->$name) || property_exists(__CLASS__, $name)){

From php manual: __CLASS__

The class name. (Added in PHP 4.3.0) As of PHP 5 this constant returns the class name as it was declared (case-sensitive). In PHP 4 its value is always lowercased. The class name includes the namespace it was declared in (e.g. Foo\Bar). Note that as of PHP 5.4 CLASS works also in traits. When used in a trait method, CLASS is the name of the class the trait is used in.

PHP Manual

An example:

class Test {
    public function __construct(){
        echo __CLASS__;
    }
}

$test = new Test();

Output:

Test