getData( 'action' ); $profile = $observer->getData( 'profile' ); $proceed = $profile->getData( 'options/export/conf_child_url' ); if ( !$proceed ) { return; } switch ( $action ) { case 'start': $columns = $profile->getColumns(); foreach ( $columns as $col ) { if ( $col[ 'field' ] == $this->columnName ) { // column present, no need to do anything return; } } $columns[ ] = array( 'field' => $this->columnName ); $profile->setData( 'columns', $columns ); break; case 'stop': // in case we don't want to save the column, we remove it here case 'finish': $columns = $profile->getColumns(); foreach ( $columns as $idx => $col ) { if ( $col[ 'field' ] == $this->columnName ) { unset( $columns[ $idx ] ); } } $profile->setData( 'columns', $columns ); break; default : return; break; } } }