private function initializeFromHardcodedObject($object)
    {
        //Typecast arrays to objects
        if (is_array($object)) $object = (object)$object;

        if (!empty($object->path)) {
            $this->path = $object->path;
        }

        if (!empty($object->name)) {
            $this->name = $object->name;
        }

        if (!empty($object->class)) {
            $this->class = $object->class;
        }

        if (!empty($object->priority)) {
            $this->priority = $object->priority;
        }

        if (!empty($object->pattern)) {
            if ($object->pattern instanceof Pattern)
            {
                $this->patternString = $object->pattern->getPatternString();
                $this->pattern = $object->pattern;
            }
            else
            {
                $this->patternString = $object->pattern;
                $this->pattern = new Pattern($this->path, $this->patternString);
            }
        }

        if (!empty($object->parameters)) {
            if (is_array($object->parameters)) {
                $this->parameters = (object)$object->parameters;
            } else {
                $this->parameters = $object->parameters;
            }
        }
    }
private function initializeFromHardcodedObject($object)
    {
        //Typecast arrays to objects
        if (is_array($object)) $object = (object)$object;

        if (!empty($object->path)) {
            $this->path = $object->path;
        }

        if (!empty($object->name)) {
            $this->name = $object->name;
        }

        if (!empty($object->class)) {
            $this->class = $object->class;
        }

        if (!empty($object->priority)) {
            $this->priority = $object->priority;
        }

        if (!empty($object->pattern)) {
            if ($object->pattern instanceof Pattern)
            {
                $this->patternString = $object->pattern->getPatternString();
                $this->pattern = $object->pattern;
            }
            else
            {
                $this->patternString = $object->pattern;
                $this->pattern = new Pattern($this->path, $this->patternString);
            }
        }

        if (!empty($object->parameters)) {
            if (is_array($object->parameters)) {
                $this->parameters = (object)$object->parameters;
            } else {
                $this->parameters = $object->parameters;
            }
        }
    }
private function initializeFromHardcodedObject ( $ object ) { //Typecast arrays to objects if ( is_array ( $ object ) ) $ object = ( object ) $ object ; if ( ! empty ( $ object -> path ) ) { $ this -> path = $ object -> path ; } if ( ! empty ( $ object -> name ) ) { $ this -> name = $ object -> name ; } if ( ! empty ( $ object -> class ) ) { $ this -> class = $ object -> class ; } if ( ! empty ( $ object -> priority ) ) { $ this -> priority = $ object -> priority ; } if ( ! empty ( $ object -> pattern ) ) { if ( $ object -> pattern instanceof Pattern ) { $ this -> patternString = $ object -> pattern -> getPatternString ( ) ; $ this -> pattern = $ object -> pattern ; } else { $ this -> patternString = $ object -> pattern ; $ this -> pattern = new Pattern ( $ this -> path , $ this -> patternString ) ; } } if ( ! empty ( $ object -> parameters ) ) { if ( is_array ( $ object -> parameters ) ) { $ this -> parameters = ( object ) $ object -> parameters ; } else { $ this -> parameters = $ object -> parameters ; } } }
Allow programmatic initialization of a route
@param \stdClass $object
@throws \Exception
Allow programmatic initialization of a route