Forums / Developer / eZmatrix attribute and export to csv

"Please Note:
  • At the specific request of Ibexa we are changing this projects name to "Exponential" or "Exponential (CMS)" effective as of August, 11th 2025.
  • This project is not associated with the original eZ Publish software or its original developer, eZ Systems or Ibexa".

eZmatrix attribute and export to csv

Author Message

laurent le cadet

Tuesday 07 August 2007 1:55:43 am

Hi,

I'm trying to build a new parser for the Extract contribution to export the matrix datatype in a CSV.
But due to my none level in php i'm not able to do it.
I can only hit the "rows" attribute of the datatype which is an array, but I'm stuck :

class eZMatrixHandler extends BaseHandler {

	function exportAttribute(&$attribute) {
		$content  = $attribute->content();
		$rows = $content->attribute( 'rows' );
		return $this->escape( $rows );
	}
}

Some help will be greatly appreciated.

Regards.

Laurent

laurent le cadet

Tuesday 07 August 2007 2:39:27 am

replying to myself :

<?
class eZMatrixHandler extends BaseHandler {

	function exportAttribute(&$attribute) {
		$content  = $attribute->content();
		$rows = $content->attribute( 'rows' );
		foreach( $rows['sequential'] as $row )
        {
            $matrixArray[] = eZStringUtils::implodeStr( $row['columns'], '|' );
        }

        return eZStringUtils::implodeStr( $matrixArray, '&' );
		return $this->escape( $matrixArray );
	}
}

?>

A copy/paste from ezmatriwtype.php.

Hope this help

Laurent