Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

Public Member Functions | Public Attributes | Protected Member Functions | List of all members
eZMatrix Class Reference

The class eZMatrix does. More...

## Public Member Functions
| __construct ( $name, $numRows=false, $matrixColumnDefinition=false)
| adjustColumnIndex ( $columnIndex, $newColumnIndex)
| setColumnIndex ( $columnIndex, $newColumnIndex)
| addColumn ( $columnDefinition)
| addColumnToMatrix ( $columnDefinition)
| addColumnToCells ( $columnDefinition)
| adjustColumnName ( $columnIndex, $newColumnName)
| setColumnName ( $columnIndex, $newColumnName)
| adjustColumnsToDefinition ( $classColumnsDefinition)
| buildReorderRuleForColumn ( $columns, $pos)
| buildReorderRules ()
| reorderColumns ()
| hasRuleForColumn ( $rules, $pos)
| setColumn ( $colIdx, $column)
| column ( $colIdx)
| copyDataBetweenColumns ( $firstColIdx, $secondColIdx)
| removeUselessColumns ( $matrixColumnDefinition)
| getColumnsToRemove ( $matrixColumnsDefinition)
| removeColumn ( $columnDefinition)
| setName ( $name)
| name ()
| attributes ()
| hasAttribute ( $name)
| attribute ( $name)
| addRow ( $beforeIndex=false, $addCount=1)
| removeRow ( $rowNum)
| decodeXML ( $xmlString)
| domString ( $domDocument)
| xmlString ()

## Public Attributes
| $Name
| Contains the Matrix name. More...
| $Matrix
| Contains the Matrix array. More...
| $NumColumns
| Contains the number of columns. More...
| $NumRows
| Contains the number of rows. More...
| $Cells

## Protected Member Functions
| updateColumns ( $matrixColumnDefinition)
| setColumnDefinition ( $colIdx, $columnDefinition)
| columnDefinition ( $colIdx)
| setColumnCellData ( $colIdx, $cellData)
| columnCellsData ( $colIdx)
| copyDefinitionBetweenColumns ( $col1, $col2)
| copyCellsDataBetweenColumns ( $firstColIdx, $secondColIdx)
| columnIndex ( $columnIdent)
| columnExists ( $columnToFind, $matrixColumnsDefinition)
| removeColumnFromCells ( $columnDefinition)
| removeColumnFromMatrix ( $columnDefinition)

## Detailed Description

The class eZMatrix does.

Definition at line 18 of file ezmatrix.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZMatrix::__construct | ( |  | $name,
|  |  | $numRows = `false`,
|  |  | $matrixColumnDefinition = `false`
| ) |  |

Parameters

  string | $name |
  int | bool | $numRows |
  eZMatrixDefinition | bool | $matrixColumnDefinition |

Definition at line 25 of file ezmatrix.php.

References decodeXML(), and xmlString().

## Member Function Documentation

## ◆ addColumn()

eZMatrix::addColumn | ( |  | $columnDefinition | ) |

Adds column $columnDefinition to eZMatrix object.

Definition at line 124 of file ezmatrix.php.

References addColumnToCells(), and addColumnToMatrix().

Referenced by updateColumns().

## ◆ addColumnToCells()

eZMatrix::addColumnToCells | ( |  | $columnDefinition | ) |

Adds column $columnDefinition to 'cells' member of eZMatrix.

Definition at line 146 of file ezmatrix.php.

References attribute().

Referenced by addColumn().

## ◆ addColumnToMatrix()

eZMatrix::addColumnToMatrix | ( |  | $columnDefinition | ) |

Adds column $columnDefinition to 'matrix' member of eZMatrix.

Definition at line 134 of file ezmatrix.php.

Referenced by addColumn().

## ◆ addRow()

eZMatrix::addRow | ( |  | $beforeIndex = `false`,
|  |  | $addCount = `1`
| ) |  |

Definition at line 643 of file ezmatrix.php.

References attribute().

## ◆ adjustColumnIndex()

eZMatrix::adjustColumnIndex | ( |  | $columnIndex,
|  |  | $newColumnIndex
| ) |  |

Check if column index differs, and so, set new index.

Parameters

  columnIndex | internal column index
  newColumnIndex | new column index

Returns
  true if index differs

Definition at line 72 of file ezmatrix.php.

References attribute(), and setColumnIndex().

Referenced by updateColumns().

## ◆ adjustColumnName()

eZMatrix::adjustColumnName | ( |  | $columnIndex,
|  |  | $newColumnName
| ) |  |

Check if new column name differs from existing column name, and sets new name.

Parameters

  columnIndex | internal column index
  newColumnName | column name

Returns
  true if name differs

Definition at line 170 of file ezmatrix.php.

References attribute(), and setColumnName().

Referenced by updateColumns().

## ◆ adjustColumnsToDefinition()

eZMatrix::adjustColumnsToDefinition | ( |  | $classColumnsDefinition | ) |

Checks current eZMatrix object against definition. If columns ids are wrong or there are additional/redundant columns in definition/eZMatrix object then current eZMatix object will be adjusted according to $matrixColumnDefinition. Note: if id of some column was changed form "old_id" to "new_id" then a column with "old_id" will be removed(all data of this column will be lost) and an empty column with "new_id" will be created. Returns true if adjustment(matrix modification) was performed. Otherwise - false.

Definition at line 200 of file ezmatrix.php.

References decodeXML(), removeUselessColumns(), reorderColumns(), updateColumns(), and xmlString().

## ◆ attribute()

eZMatrix::attribute | ( |  | $name | ) |

Definition at line 603 of file ezmatrix.php.

References $Cells, $Matrix, $Name, and eZDebug\writeError().

Referenced by addColumnToCells(), addRow(), adjustColumnIndex(), adjustColumnName(), buildReorderRules(), columnCellsData(), columnDefinition(), columnIndex(), copyCellsDataBetweenColumns(), getColumnsToRemove(), removeColumnFromCells(), removeColumnFromMatrix(), removeRow(), and setColumnCellData().

## ◆ attributes()

eZMatrix::attributes | ( |  | ) |

Definition at line 587 of file ezmatrix.php.

Referenced by hasAttribute().

## ◆ buildReorderRuleForColumn()

eZMatrix::buildReorderRuleForColumn | ( |  | $columns,
|  |  | $pos
| ) |  |

Create reorder column reference array.

Definition at line 225 of file ezmatrix.php.

Referenced by buildReorderRules().

## ◆ buildReorderRules()

eZMatrix::buildReorderRules | ( |  | ) |

Build column reorder rules.

Definition at line 244 of file ezmatrix.php.

References attribute(), buildReorderRuleForColumn(), and hasRuleForColumn().

Referenced by reorderColumns().

## ◆ column()

eZMatrix::column | ( |  | $colIdx | ) |

Get column data and definition

Parameters

  colIdx | column index

Returns
  column data and definition

Definition at line 334 of file ezmatrix.php.

References columnCellsData(), and columnDefinition().

Referenced by reorderColumns().

## ◆ columnCellsData()

eZMatrix::columnCellsData | ( |  | $colIdx | ) |
| protected

Get column data

Parameters

  colIdx | column index

Returns
  column data

Definition at line 391 of file ezmatrix.php.

References attribute().

Referenced by column().

## ◆ columnDefinition()

eZMatrix::columnDefinition | ( |  | $colIdx | ) |
| protected

Get column definition.

Parameters

  colIdx | column index

Returns
  column definition

Definition at line 358 of file ezmatrix.php.

References attribute().

Referenced by column().

## ◆ columnExists()

eZMatrix::columnExists | ( |  | $columnToFind,
|  |  | $matrixColumnsDefinition
| ) |  |
| protected

Searches column $columnToFind in $matrixColumnDefinition. Returns true if found, false - otherwise.

Definition at line 507 of file ezmatrix.php.

Referenced by getColumnsToRemove().

## ◆ columnIndex()

eZMatrix::columnIndex | ( |  | $columnIdent | ) |
| protected

Get internal column index by column indentifier

Parameters

  columnIdent | column identifier

Returns
  column index.

Definition at line 487 of file ezmatrix.php.

References attribute().

Referenced by updateColumns().

## ◆ copyCellsDataBetweenColumns()

eZMatrix::copyCellsDataBetweenColumns | ( |  | $firstColIdx,
|  |  | $secondColIdx
| ) |  |
| protected

Definition at line 421 of file ezmatrix.php.

References attribute().

Referenced by copyDataBetweenColumns().

## ◆ copyDataBetweenColumns()

eZMatrix::copyDataBetweenColumns | ( |  | $firstColIdx,
|  |  | $secondColIdx
| ) |  |

Definition at line 410 of file ezmatrix.php.

References copyCellsDataBetweenColumns(), and copyDefinitionBetweenColumns().

Referenced by reorderColumns().

## ◆ copyDefinitionBetweenColumns()

eZMatrix::copyDefinitionBetweenColumns | ( |  | $col1,
|  |  | $col2
| ) |  |
| protected

Definition at line 416 of file ezmatrix.php.

Referenced by copyDataBetweenColumns().

## ◆ decodeXML()

eZMatrix::decodeXML | ( |  | $xmlString | ) |

Will decode an xml string and initialize the eZ matrix object

Definition at line 692 of file ezmatrix.php.

References setName().

Referenced by __construct(), and adjustColumnsToDefinition().

## ◆ domString()

eZMatrix::domString | ( |  | $domDocument | ) |

Returns
  the XML structure in $domDocument as text. It will take of care of the necessary charset conversions for content storage.

Definition at line 802 of file ezmatrix.php.

References eZTextCodec\internalCharset(), and eZCharsetInfo\realCharsetCode().

Referenced by xmlString().

## ◆ getColumnsToRemove()

eZMatrix::getColumnsToRemove | ( |  | $matrixColumnsDefinition | ) |

Searches columns that are in matrix but not in $matrixColumnDefinition.

Definition at line 463 of file ezmatrix.php.

References attribute(), and columnExists().

Referenced by removeUselessColumns().

## ◆ hasAttribute()

eZMatrix::hasAttribute | ( |  | $name | ) |

Definition at line 598 of file ezmatrix.php.

References attributes().

## ◆ hasRuleForColumn()

eZMatrix::hasRuleForColumn | ( |  | $rules,
|  |  | $pos
| ) |  |

static

Definition at line 300 of file ezmatrix.php.

Referenced by buildReorderRules().

## ◆ name()

eZMatrix::name | ( |  | ) |

Returns the name of the matrix.

Definition at line 582 of file ezmatrix.php.

References $Name.

## ◆ removeColumn()

eZMatrix::removeColumn | ( |  | $columnDefinition | ) |

Removess column $columnDefinition from eZMatrix object.

Definition at line 523 of file ezmatrix.php.

References removeColumnFromCells(), and removeColumnFromMatrix().

Referenced by removeUselessColumns().

## ◆ removeColumnFromCells()

eZMatrix::removeColumnFromCells | ( |  | $columnDefinition | ) |
| protected

Removess column $columnDefinition from 'cells' member of eZMatrix.

Definition at line 532 of file ezmatrix.php.

References attribute().

Referenced by removeColumn().

## ◆ removeColumnFromMatrix()

eZMatrix::removeColumnFromMatrix | ( |  | $columnDefinition | ) |
| protected

Removess column $columnDefinition from 'matrix' member of eZMatrix.

Definition at line 553 of file ezmatrix.php.

References attribute().

Referenced by removeColumn().

## ◆ removeRow()

eZMatrix::removeRow | ( |  | $rowNum | ) |

Definition at line 679 of file ezmatrix.php.

References attribute().

## ◆ removeUselessColumns()

eZMatrix::removeUselessColumns | ( |  | $matrixColumnDefinition | ) |

Removes columns that are in matrix but not in $matrixColumnDefinition

Returns
  true if matrix was modified.

Definition at line 443 of file ezmatrix.php.

References getColumnsToRemove(), and removeColumn().

Referenced by adjustColumnsToDefinition().

## ◆ reorderColumns()

eZMatrix::reorderColumns | ( |  | ) |

Definition at line 266 of file ezmatrix.php.

References buildReorderRules(), column(), copyDataBetweenColumns(), and setColumn().

Referenced by adjustColumnsToDefinition().

## ◆ setColumn()

eZMatrix::setColumn | ( |  | $colIdx,
|  |  | $column
| ) |  |

Set column data and definition

Parameters

  column | index
  column | data and definition

Definition at line 321 of file ezmatrix.php.

References setColumnCellData(), and setColumnDefinition().

Referenced by reorderColumns().

## ◆ setColumnCellData()

eZMatrix::setColumnCellData | ( |  | $colIdx,
|  |  | $cellData
| ) |  |
| protected

Set column cell data

Parameters

  colIdx | column index
  cellData | column definition

Definition at line 370 of file ezmatrix.php.

References attribute().

Referenced by setColumn().

## ◆ setColumnDefinition()

eZMatrix::setColumnDefinition | ( |  | $colIdx,
|  |  | $columnDefinition
| ) |  |
| protected

Set column definition.

Parameters

  colIdx | column index
  columnDefinition | column definition

Definition at line 346 of file ezmatrix.php.

Referenced by setColumn().

## ◆ setColumnIndex()

eZMatrix::setColumnIndex | ( |  | $columnIndex,
|  |  | $newColumnIndex
| ) |  |

Sets column's index to $newColumnIndex.

Definition at line 87 of file ezmatrix.php.

Referenced by adjustColumnIndex().

## ◆ setColumnName()

eZMatrix::setColumnName | ( |  | $columnIndex,
|  |  | $newColumnName
| ) |  |

Sets column's name to $newColumnName.

Definition at line 185 of file ezmatrix.php.

Referenced by adjustColumnName().

## ◆ setName()

eZMatrix::setName | ( |  | $name | ) |

Sets the name of the matrix

Definition at line 574 of file ezmatrix.php.

Referenced by decodeXML().

## ◆ updateColumns()

eZMatrix::updateColumns | ( |  | $matrixColumnDefinition | ) |
| protected

Searches in matrix columns with identifiers that in $matrixColumnDefinition and a) if column exists then modification of column attributes is performed ( index, name, etc. ); b) if column doesn't exist then new column will be created.

Definition at line 97 of file ezmatrix.php.

References addColumn(), adjustColumnIndex(), adjustColumnName(), and columnIndex().

Referenced by adjustColumnsToDefinition().

## ◆ xmlString()

eZMatrix::xmlString | ( |  | ) |

Will return the XML string for this matrix.

Definition at line 825 of file ezmatrix.php.

References $NumColumns, $NumRows, and domString().

Referenced by __construct(), and adjustColumnsToDefinition().

## Member Data Documentation

## ◆ $Cells

eZMatrix::$Cells

Definition at line 891 of file ezmatrix.php.

Referenced by attribute().

## ◆ $Matrix

eZMatrix::$Matrix

Contains the Matrix array.

Definition at line 883 of file ezmatrix.php.

Referenced by attribute().

## ◆ $Name

eZMatrix::$Name

Contains the Matrix name.

Definition at line 880 of file ezmatrix.php.

Referenced by attribute(), and name().

## ◆ $NumColumns

eZMatrix::$NumColumns

Contains the number of columns.

Definition at line 886 of file ezmatrix.php.

Referenced by xmlString().

## ◆ $NumRows

eZMatrix::$NumRows

Contains the number of rows.

Definition at line 890 of file ezmatrix.php.

Referenced by xmlString().

The documentation for this class was generated from the following file:

- ezmatrix.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.