private function check_type(){
        $this_class = new \ReflectionClass( $this );

        $type = $this_class->getShortName();
        if ($type == 'Thing') {
            $type = $this->get_type();
            unset($this->type);
        }

        if(!is_null($this->realType)){
            $type = $this->realType;
            unset($this->realType);
        }
        return $type;
    }
private function check_type(){
        $this_class = new \ReflectionClass( $this );

        $type = $this_class->getShortName();
        if ($type == 'Thing') {
            $type = $this->get_type();
            unset($this->type);
        }

        if(!is_null($this->realType)){
            $type = $this->realType;
            unset($this->realType);
        }
        return $type;
    }
private function check_type ( ) { $ this_class = new \ ReflectionClass ( $ this ) ; $ type = $ this_class -> getShortName ( ) ; if ( $ type == 'Thing' ) { $ type = $ this -> get_type ( ) ; unset ( $ this -> type ) ; } if ( ! is_null ( $ this -> realType ) ) { $ type = $ this -> realType ; unset ( $ this -> realType ) ; } return $ type ; }
In most cases, the name of the object withing json-ld markup will be the class name.

Sometimes though we create a custom object on the fly with an array of properties, but we can't have
the object appear as a "Thing" so we have to set the type manually.

When classes are extended by implementing code, the namespace might be entirely different so we need
a mechanism to only create classes whose names exist within the schema.org namespace. The code doesn't
do namespace checks, we assume that implementing devs know what they're doing.

@return string
In most cases the name of the object withing json - ld markup will be the class name .