public function format()
    {
        $result     = array();

        $result["@type"] = $this->check_type();
        $values          = array_filter( get_object_vars( $this ) );

        foreach ($values as $key => $value) {
            if ($value instanceof ICanBecomeJSONLD) {
                $formatted = $value->format();
                if ( ! empty( $formatted )) {
                    $result[$key] = $formatted;
                }
            } else {
                $result[$key] = $value;
            }
        }

        return $result;
    }
public function format()
    {
        $result     = array();

        $result["@type"] = $this->check_type();
        $values          = array_filter( get_object_vars( $this ) );

        foreach ($values as $key => $value) {
            if ($value instanceof ICanBecomeJSONLD) {
                $formatted = $value->format();
                if ( ! empty( $formatted )) {
                    $result[$key] = $formatted;
                }
            } else {
                $result[$key] = $value;
            }
        }

        return $result;
    }
public function format ( ) { $ result = array ( ) ; $ result [ "@type" ] = $ this -> check_type ( ) ; $ values = array_filter ( get_object_vars ( $ this ) ) ; foreach ( $ values as $ key => $ value ) { if ( $ value instanceof ICanBecomeJSONLD ) { $ formatted = $ value -> format ( ) ; if ( ! empty ( $ formatted ) ) { $ result [ $ key ] = $ formatted ; } } else { $ result [ $ key ] = $ value ; } } return $ result ; }
Creates an array of schema.org attribute ready to be json encoded.

Grabs all properties from the class and uses those that aren't empty.


@return array
Creates an array of schema . org attribute ready to be json encoded .