public function prepareAssociationsDrawerXMLElement(Entry $e, array $parent_association, $prepopulate = '')
    {
        $value = $this->prepareReadableValue($e->getData($this->get('id')), $e->get('id'));

        // fallback for compatibility since the default
        // `preparePlainTextValue` is not compatible with all fields
        // this should be removed in Symphony 3.0
        if (empty($value)) {
            $value = strip_tags($this->prepareTableValue($e->getData($this->get('id')), null, $e->get('id')));
        }

        // use our factory method to create the html
        $li = self::createAssociationsDrawerXMLElement($value, $e, $parent_association, $prepopulate);

        $li->setAttribute('class', 'field-' . $this->get('type'));

        return $li;
    }
public function prepareAssociationsDrawerXMLElement(Entry $e, array $parent_association, $prepopulate = '')
    {
        $value = $this->prepareReadableValue($e->getData($this->get('id')), $e->get('id'));

        // fallback for compatibility since the default
        // `preparePlainTextValue` is not compatible with all fields
        // this should be removed in Symphony 3.0
        if (empty($value)) {
            $value = strip_tags($this->prepareTableValue($e->getData($this->get('id')), null, $e->get('id')));
        }

        // use our factory method to create the html
        $li = self::createAssociationsDrawerXMLElement($value, $e, $parent_association, $prepopulate);

        $li->setAttribute('class', 'field-' . $this->get('type'));

        return $li;
    }
public function prepareAssociationsDrawerXMLElement ( Entry $ e , array $ parent_association , $ prepopulate = '' ) { $ value = $ this -> prepareReadableValue ( $ e -> getData ( $ this -> get ( 'id' ) ) , $ e -> get ( 'id' ) ) ; // fallback for compatibility since the default // `preparePlainTextValue` is not compatible with all fields // this should be removed in Symphony 3.0 if ( empty ( $ value ) ) { $ value = strip_tags ( $ this -> prepareTableValue ( $ e -> getData ( $ this -> get ( 'id' ) ) , null , $ e -> get ( 'id' ) ) ) ; } // use our factory method to create the html $ li = self :: createAssociationsDrawerXMLElement ( $ value , $ e , $ parent_association , $ prepopulate ) ; $ li -> setAttribute ( 'class' , 'field-' . $ this -> get ( 'type' ) ) ; return $ li ; }
Format this field value for display in the Associations Drawer publish index.
By default, Symphony will use the return value of the `prepareReadableValue` function.

@since Symphony 2.4
@since Symphony 2.5.0 The prepopulate parameter was added.

@param Entry $e
The associated entry
@param array $parent_association
An array containing information about the association
@param string $prepopulate
A string containing prepopulate parameter to append to the association url

@return XMLElement
The XMLElement must be a li node, since it will be added an ul node.
Format this field value for display in the Associations Drawer publish index . By default Symphony will use the return value of the prepareReadableValue function .