src/Subjects/ExportableTrait.php
/**
     * Create's and return's a new empty artefact entity.
     *
     * @param array $columns             The array with the column data
     * @param array $originalColumnNames The array with a mapping from the old to the new column names
     *
     * @return array The new artefact entity
     */
Create's and return's a new empty artefact entity.
@param array $columns             The array with the column data
@param array $originalColumnNames The array with a mapping from the old to the new column names

@return array The new artefact entity
Create ' s and return ' s a new empty artefact entity . @param array $columns The array with the column data @param array $originalColumnNames The array with a mapping from the old to the new column names @return array The new artefact entity
public function newArtefact(array $columns, array $originalColumnNames = array())
    {
        $artefact = array();
        $originalData = array();
        if (sizeof($originalColumnNames) > 0) {
            $originalData[ColumnKeys::ORIGINAL_FILENAME] = $this->getFilename();
            $originalData[ColumnKeys::ORIGINAL_LINE_NUMBER] = $this->getLineNumber();
            $originalData[ColumnKeys::ORIGINAL_COLUMN_NAMES] =  $originalColumnNames;
            $artefact = array(ColumnKeys::ORIGINAL_DATA => $originalData);
        }
        return array_merge($artefact, $columns);
    }
public function newArtefact ( array $ columns , array $ originalColumnNames = array ( ) ) { $ artefact = array ( ) ; $ originalData = array ( ) ; if ( sizeof ( $ originalColumnNames ) > 0 ) { $ originalData [ ColumnKeys :: ORIGINAL_FILENAME ] = $ this -> getFilename ( ) ; $ originalData [ ColumnKeys :: ORIGINAL_LINE_NUMBER ] = $ this -> getLineNumber ( ) ; $ originalData [ ColumnKeys :: ORIGINAL_COLUMN_NAMES ] = $ originalColumnNames ; $ artefact = array ( ColumnKeys :: ORIGINAL_DATA => $ originalData ) ; } return array_merge ( $ artefact , $ columns ) ; }
Create's and return's a new empty artefact entity.
Create ' s and return ' s a new empty artefact entity .
// initialize the original data and the artefact // query whether or not, we've original columns // prepare the original column data // add the original column data to the new artefact // merge the columns into the artefact entity and return it