public function fillObject( $comment, $fieldNames = null )
    {
        $filledFields = $this->fields;
        if ( !is_null( $fieldNames ) && is_array( $fieldNames ) )
        {
            $filledFields = array();
            foreach ( $fieldNames as $fieldName )
            {
                $filledFields[$fieldName] = $this->fields[$fieldName];
            }
        }
        foreach ( $filledFields as $field => $fieldSetup )
        {
            $attributeName = $fieldSetup[self::ATTRIBUTENAME];
            if ( !is_null( $attributeName ) )
            {
                $fieldValue = $this->fieldValues[$field];
                $comment->setAttribute( $attributeName, $fieldValue );
            }
        }
    }
public function fillObject( $comment, $fieldNames = null )
    {
        $filledFields = $this->fields;
        if ( !is_null( $fieldNames ) && is_array( $fieldNames ) )
        {
            $filledFields = array();
            foreach ( $fieldNames as $fieldName )
            {
                $filledFields[$fieldName] = $this->fields[$fieldName];
            }
        }
        foreach ( $filledFields as $field => $fieldSetup )
        {
            $attributeName = $fieldSetup[self::ATTRIBUTENAME];
            if ( !is_null( $attributeName ) )
            {
                $fieldValue = $this->fieldValues[$field];
                $comment->setAttribute( $attributeName, $fieldValue );
            }
        }
    }
public function fillObject ( $ comment , $ fieldNames = null ) { $ filledFields = $ this -> fields ; if ( ! is_null ( $ fieldNames ) && is_array ( $ fieldNames ) ) { $ filledFields = array ( ) ; foreach ( $ fieldNames as $ fieldName ) { $ filledFields [ $ fieldName ] = $ this -> fields [ $ fieldName ] ; } } foreach ( $ filledFields as $ field => $ fieldSetup ) { $ attributeName = $ fieldSetup [ self :: ATTRIBUTENAME ] ; if ( ! is_null ( $ attributeName ) ) { $ fieldValue = $ this -> fieldValues [ $ field ] ; $ comment -> setAttribute ( $ attributeName , $ fieldValue ) ; } } }
Fill field to comment object
@param $comment ezcomcomment persistent object
@param $fieldNames field name array selected to be filled into comment
@return
Fill field to comment object