public function setRawProperties( $properties )
    {
        if ( ! empty( $properties ) )
        {
            foreach ( $properties as $name => $value )
            {
                switch ( true )
                {
                    case is_array( $value ) &&
                            array_key_exists( 'value', $value ):
                        $value = (object) $value;

                    case is_object( $value ):
                        if ( ! isset( $value->value ) )
                        {
                            $value->value = null;
                        }

                        if ( ! isset( $value->priority ) )
                        {
                            $value->priority = null;
                        }

                        if ( ! isset( $value->name ) )
                        {
                            $value->name = $name;
                        }

                        $this->setRawProperty(
                            $value->name,
                            $value->value,
                            $value->priority
                        );
                        break;

                    case is_array( $value ):
                        if ( count( $value ) > 2 )
                        {
                            list( $rawName, $value, $priority ) = $value;

                            if ( empty( $rawName ) )
                            {
                                $rawName = $name;
                            }
                        }
                        else if ( count( $value ) > 1 )
                        {
                            $rawName = $name;
                            list( $value, $priority ) = $value;
                        }
                        else
                        {
                            $rawName    = $name;
                            $priority   = null;
                            $value      = empty( $value ) ? null : current( $value );
                        }

                        $this->setRawProperty( $rawName, $value, $priority );
                        break;

                    default:
                        $this->setRawProperty( $name, $value );
                        break;
                }
            }
        }

        return $this;
    }