Swat/SwatUI.php
private function parseMapping($name, $value, SwatUIObject $object)
    {
        $renderer = null;
        $renderer_container = null;

        foreach (array_reverse($this->stack) as $ancestor) {
            if ($renderer === null && $ancestor instanceof SwatCellRenderer) {
                $renderer = $ancestor;
            } elseif ($ancestor instanceof SwatCellRendererContainer) {
                $renderer_container = $ancestor;
                break;
            }
        }

        if ($renderer === null || $renderer_container === null) {
            throw new SwatInvalidPropertyTypeException(
                "Property type 'data' is only allowed on a SwatCellRenderer " .
                    'or on a widget within a SwatWidgetCellRenderer.',
                0,
                $object,
                'data'
            );
        }

        $mapping = $renderer_container->addMappingToRenderer(
            $renderer,
            $value,
            $name,
            $object
        );

        return $mapping;
    }
private function parseMapping($name, $value, SwatUIObject $object)
    {
        $renderer = null;
        $renderer_container = null;

        foreach (array_reverse($this->stack) as $ancestor) {
            if ($renderer === null && $ancestor instanceof SwatCellRenderer) {
                $renderer = $ancestor;
            } elseif ($ancestor instanceof SwatCellRendererContainer) {
                $renderer_container = $ancestor;
                break;
            }
        }

        if ($renderer === null || $renderer_container === null) {
            throw new SwatInvalidPropertyTypeException(
                "Property type 'data' is only allowed on a SwatCellRenderer " .
                    'or on a widget within a SwatWidgetCellRenderer.',
                0,
                $object,
                'data'
            );
        }

        $mapping = $renderer_container->addMappingToRenderer(
            $renderer,
            $value,
            $name,
            $object
        );

        return $mapping;
    }
private function parseMapping ( $ name , $ value , SwatUIObject $ object ) { $ renderer = null ; $ renderer_container = null ; foreach ( array_reverse ( $ this -> stack ) as $ ancestor ) { if ( $ renderer === null && $ ancestor instanceof SwatCellRenderer ) { $ renderer = $ ancestor ; } elseif ( $ ancestor instanceof SwatCellRendererContainer ) { $ renderer_container = $ ancestor ; break ; } } if ( $ renderer === null || $ renderer_container === null ) { throw new SwatInvalidPropertyTypeException ( "Property type 'data' is only allowed on a SwatCellRenderer " . 'or on a widget within a SwatWidgetCellRenderer.' , 0 , $ object , 'data' ) ; } $ mapping = $ renderer_container -> addMappingToRenderer ( $ renderer , $ value , $ name , $ object ) ; return $ mapping ; }
Handle a 'data' type property value by parsing it into a mapping object

@param string $name the name of the property.
@param string $value the value of the property.
@param SwatUIObject $object the object the property applies to.

@return SwatCellRendererMapping the parsed mapping object.

@throws SwatInvalidPropertyTypeException
Handle a data type property value by parsing it into a mapping object