PHPRtfLite_Table::checkIfCellExists PHP Méthode

checkIfCellExists() public méthode

returns true, if rowIndex and columnIndex do exists in table
public checkIfCellExists ( integer $rowIndex, integer $columnIndex ) : boolean
$rowIndex integer
$columnIndex integer
Résultat boolean
    public function checkIfCellExists($rowIndex, $columnIndex)
    {
        return $this->checkRowIndex($rowIndex) && $this->checkColumnIndex($columnIndex);
    }

Usage Example

Exemple #1
0
 /**
  * sets border to a cell
  *
  * @param PHPRtfLite_Border $border
  */
 public function setBorder(PHPRtfLite_Border $border)
 {
     $borderFormatTop = $border->getBorderTop();
     $borderFormatBottom = $border->getBorderBottom();
     $borderFormatLeft = $border->getBorderLeft();
     $borderFormatRight = $border->getBorderRight();
     if ($this->_border === null) {
         $this->_border = new PHPRtfLite_Border($this->_rtf);
     }
     if ($borderFormatLeft) {
         $this->_border->setBorderLeft($borderFormatLeft);
     }
     if ($borderFormatRight) {
         $this->_border->setBorderRight($borderFormatRight);
     }
     if ($borderFormatTop) {
         $this->_border->setBorderTop($borderFormatTop);
     }
     if ($borderFormatBottom) {
         $this->_border->setBorderBottom($borderFormatBottom);
     }
     if ($borderFormatTop && $this->_table->checkIfCellExists($this->_rowIndex - 1, $this->_columnIndex)) {
         $this->getBorderForCell($this->_rowIndex - 1, $this->_columnIndex)->setBorderBottom($borderFormatTop);
     }
     if ($borderFormatBottom && $this->_table->checkIfCellExists($this->_rowIndex + 1, $this->_columnIndex)) {
         $this->getBorderForCell($this->_rowIndex + 1, $this->_columnIndex)->setBorderTop($borderFormatBottom);
     }
     if ($borderFormatLeft && $this->_table->checkIfCellExists($this->_rowIndex, $this->_columnIndex - 1)) {
         $this->getBorderForCell($this->_rowIndex, $this->_columnIndex - 1)->setBorderRight($borderFormatLeft);
     }
     if ($borderFormatRight && $this->_table->checkIfCellExists($this->_rowIndex, $this->_columnIndex + 1)) {
         $this->getBorderForCell($this->_rowIndex, $this->_columnIndex + 1)->setBorderLeft($borderFormatRight);
     }
 }
All Usage Examples Of PHPRtfLite_Table::checkIfCellExists