ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
PhpOffice\PhpSpreadsheet\Style\Conditional Class Reference
+ Inheritance diagram for PhpOffice\PhpSpreadsheet\Style\Conditional:
+ Collaboration diagram for PhpOffice\PhpSpreadsheet\Style\Conditional:

Public Member Functions

 __construct ()
 Create a new Conditional. More...
 
 getConditionType ()
 Get Condition type. More...
 
 setConditionType ($pValue)
 Set Condition type. More...
 
 getOperatorType ()
 Get Operator type. More...
 
 setOperatorType ($pValue)
 Set Operator type. More...
 
 getText ()
 Get text. More...
 
 setText ($value)
 Set text. More...
 
 getStopIfTrue ()
 Get StopIfTrue. More...
 
 setStopIfTrue ($value)
 Set StopIfTrue. More...
 
 getConditions ()
 Get Conditions. More...
 
 setConditions ($pValue)
 Set Conditions. More...
 
 addCondition ($pValue)
 Add Condition. More...
 
 getStyle ()
 Get Style. More...
 
 setStyle (?Style $pValue=null)
 Set Style. More...
 
 getDataBar ()
 get DataBar. More...
 
 setDataBar (ConditionalDataBar $dataBar)
 set DataBar. More...
 
 getHashCode ()
 Get hash code. More...
 
 __clone ()
 Implement PHP __clone to create a deep clone, not just a shallow copy. More...
 

Static Public Member Functions

static isValidConditionType (string $type)
 Verify if param is valid condition type. More...
 

Data Fields

const CONDITION_NONE = 'none'
 
const CONDITION_CELLIS = 'cellIs'
 
const CONDITION_CONTAINSTEXT = 'containsText'
 
const CONDITION_EXPRESSION = 'expression'
 
const CONDITION_CONTAINSBLANKS = 'containsBlanks'
 
const CONDITION_NOTCONTAINSBLANKS = 'notContainsBlanks'
 
const CONDITION_DATABAR = 'dataBar'
 
const CONDITION_NOTCONTAINSTEXT = 'notContainsText'
 
const OPERATOR_NONE = ''
 
const OPERATOR_BEGINSWITH = 'beginsWith'
 
const OPERATOR_ENDSWITH = 'endsWith'
 
const OPERATOR_EQUAL = 'equal'
 
const OPERATOR_GREATERTHAN = 'greaterThan'
 
const OPERATOR_GREATERTHANOREQUAL = 'greaterThanOrEqual'
 
const OPERATOR_LESSTHAN = 'lessThan'
 
const OPERATOR_LESSTHANOREQUAL = 'lessThanOrEqual'
 
const OPERATOR_NOTEQUAL = 'notEqual'
 
const OPERATOR_CONTAINSTEXT = 'containsText'
 
const OPERATOR_NOTCONTAINS = 'notContains'
 
const OPERATOR_BETWEEN = 'between'
 
const OPERATOR_NOTBETWEEN = 'notBetween'
 

Private Attributes

const CONDITION_TYPES
 
 $conditionType = self::CONDITION_NONE
 
 $operatorType = self::OPERATOR_NONE
 
 $text
 
 $stopIfTrue = false
 
 $condition = []
 
 $dataBar
 
 $style
 

Detailed Description

Definition at line 8 of file Conditional.php.

Constructor & Destructor Documentation

◆ __construct()

PhpOffice\PhpSpreadsheet\Style\Conditional::__construct ( )

Create a new Conditional.

Definition at line 96 of file Conditional.php.

97  {
98  // Initialise values
99  $this->style = new Style(false, true);
100  }
"color:#CC0000 style
Definition: example_001.php:92

Member Function Documentation

◆ __clone()

PhpOffice\PhpSpreadsheet\Style\Conditional::__clone ( )

Implement PHP __clone to create a deep clone, not just a shallow copy.

Definition at line 304 of file Conditional.php.

References $key.

305  {
306  $vars = get_object_vars($this);
307  foreach ($vars as $key => $value) {
308  if (is_object($value)) {
309  $this->$key = clone $value;
310  } else {
311  $this->$key = $value;
312  }
313  }
314  }
$key
Definition: croninfo.php:18

◆ addCondition()

PhpOffice\PhpSpreadsheet\Style\Conditional::addCondition (   $pValue)

Add Condition.

Parameters
string$pValueCondition
Returns
$this

Definition at line 232 of file Conditional.php.

233  {
234  $this->condition[] = $pValue;
235 
236  return $this;
237  }

◆ getConditions()

PhpOffice\PhpSpreadsheet\Style\Conditional::getConditions ( )

Get Conditions.

Returns
string[]

Definition at line 203 of file Conditional.php.

References PhpOffice\PhpSpreadsheet\Style\Conditional\$condition.

Referenced by PhpOffice\PhpSpreadsheet\Writer\Xls\Worksheet\writeCFRule().

+ Here is the caller graph for this function:

◆ getConditionType()

PhpOffice\PhpSpreadsheet\Style\Conditional::getConditionType ( )

Get Condition type.

Returns
string

Definition at line 107 of file Conditional.php.

References PhpOffice\PhpSpreadsheet\Style\Conditional\$conditionType.

Referenced by PhpOffice\PhpSpreadsheet\Writer\Xls\Worksheet\writeCFRule().

+ Here is the caller graph for this function:

◆ getDataBar()

PhpOffice\PhpSpreadsheet\Style\Conditional::getDataBar ( )

get DataBar.

Returns
ConditionalDataBar | null

Definition at line 268 of file Conditional.php.

References PhpOffice\PhpSpreadsheet\Style\Conditional\$dataBar.

◆ getHashCode()

PhpOffice\PhpSpreadsheet\Style\Conditional::getHashCode ( )

Get hash code.

Returns
string Hash code

Implements PhpOffice\PhpSpreadsheet\IComparable.

Definition at line 290 of file Conditional.php.

291  {
292  return md5(
293  $this->conditionType .
294  $this->operatorType .
295  implode(';', $this->condition) .
296  $this->style->getHashCode() .
297  __CLASS__
298  );
299  }
"color:#CC0000 style
Definition: example_001.php:92

◆ getOperatorType()

PhpOffice\PhpSpreadsheet\Style\Conditional::getOperatorType ( )

Get Operator type.

Returns
string

Definition at line 131 of file Conditional.php.

References PhpOffice\PhpSpreadsheet\Style\Conditional\$operatorType.

Referenced by PhpOffice\PhpSpreadsheet\Writer\Xls\Worksheet\writeCFRule().

+ Here is the caller graph for this function:

◆ getStopIfTrue()

PhpOffice\PhpSpreadsheet\Style\Conditional::getStopIfTrue ( )

Get StopIfTrue.

Returns
bool

Definition at line 179 of file Conditional.php.

References PhpOffice\PhpSpreadsheet\Style\Conditional\$stopIfTrue.

◆ getStyle()

PhpOffice\PhpSpreadsheet\Style\Conditional::getStyle ( )

◆ getText()

PhpOffice\PhpSpreadsheet\Style\Conditional::getText ( )

Get text.

Returns
string

Definition at line 155 of file Conditional.php.

References PhpOffice\PhpSpreadsheet\Style\Conditional\$text.

◆ isValidConditionType()

static PhpOffice\PhpSpreadsheet\Style\Conditional::isValidConditionType ( string  $type)
static

Verify if param is valid condition type.

Definition at line 319 of file Conditional.php.

319  : bool
320  {
321  return in_array($type, self::CONDITION_TYPES);
322  }
$type

◆ setConditions()

PhpOffice\PhpSpreadsheet\Style\Conditional::setConditions (   $pValue)

Set Conditions.

Parameters
bool|float|int|string|string[]$pValue Condition
Returns
$this

Definition at line 215 of file Conditional.php.

216  {
217  if (!is_array($pValue)) {
218  $pValue = [$pValue];
219  }
220  $this->condition = $pValue;
221 
222  return $this;
223  }

◆ setConditionType()

PhpOffice\PhpSpreadsheet\Style\Conditional::setConditionType (   $pValue)

Set Condition type.

Parameters
string$pValueCondition type, see self::CONDITION_*
Returns
$this

Definition at line 119 of file Conditional.php.

120  {
121  $this->conditionType = $pValue;
122 
123  return $this;
124  }

◆ setDataBar()

PhpOffice\PhpSpreadsheet\Style\Conditional::setDataBar ( ConditionalDataBar  $dataBar)

set DataBar.

Returns
$this

Definition at line 278 of file Conditional.php.

References PhpOffice\PhpSpreadsheet\Style\Conditional\$dataBar.

279  {
280  $this->dataBar = $dataBar;
281 
282  return $this;
283  }

◆ setOperatorType()

PhpOffice\PhpSpreadsheet\Style\Conditional::setOperatorType (   $pValue)

Set Operator type.

Parameters
string$pValueConditional operator type, see self::OPERATOR_*
Returns
$this

Definition at line 143 of file Conditional.php.

144  {
145  $this->operatorType = $pValue;
146 
147  return $this;
148  }

◆ setStopIfTrue()

PhpOffice\PhpSpreadsheet\Style\Conditional::setStopIfTrue (   $value)

Set StopIfTrue.

Parameters
bool$value
Returns
$this

Definition at line 191 of file Conditional.php.

192  {
193  $this->stopIfTrue = $value;
194 
195  return $this;
196  }

◆ setStyle()

PhpOffice\PhpSpreadsheet\Style\Conditional::setStyle ( ?Style  $pValue = null)

Set Style.

Parameters
Style$pValue
Returns
$this

Definition at line 256 of file Conditional.php.

257  {
258  $this->style = $pValue;
259 
260  return $this;
261  }
"color:#CC0000 style
Definition: example_001.php:92

◆ setText()

PhpOffice\PhpSpreadsheet\Style\Conditional::setText (   $value)

Set text.

Parameters
string$value
Returns
$this

Definition at line 167 of file Conditional.php.

168  {
169  $this->text = $value;
170 
171  return $this;
172  }

Field Documentation

◆ $condition

PhpOffice\PhpSpreadsheet\Style\Conditional::$condition = []
private

◆ $conditionType

PhpOffice\PhpSpreadsheet\Style\Conditional::$conditionType = self::CONDITION_NONE
private

◆ $dataBar

PhpOffice\PhpSpreadsheet\Style\Conditional::$dataBar
private

◆ $operatorType

PhpOffice\PhpSpreadsheet\Style\Conditional::$operatorType = self::OPERATOR_NONE
private

◆ $stopIfTrue

PhpOffice\PhpSpreadsheet\Style\Conditional::$stopIfTrue = false
private

◆ $style

PhpOffice\PhpSpreadsheet\Style\Conditional::$style
private

Definition at line 91 of file Conditional.php.

Referenced by PhpOffice\PhpSpreadsheet\Style\Conditional\getStyle().

◆ $text

PhpOffice\PhpSpreadsheet\Style\Conditional::$text
private

Definition at line 65 of file Conditional.php.

Referenced by PhpOffice\PhpSpreadsheet\Style\Conditional\getText().

◆ CONDITION_CELLIS

◆ CONDITION_CONTAINSBLANKS

const PhpOffice\PhpSpreadsheet\Style\Conditional::CONDITION_CONTAINSBLANKS = 'containsBlanks'

◆ CONDITION_CONTAINSTEXT

const PhpOffice\PhpSpreadsheet\Style\Conditional::CONDITION_CONTAINSTEXT = 'containsText'

◆ CONDITION_DATABAR

const PhpOffice\PhpSpreadsheet\Style\Conditional::CONDITION_DATABAR = 'dataBar'

◆ CONDITION_EXPRESSION

◆ CONDITION_NONE

const PhpOffice\PhpSpreadsheet\Style\Conditional::CONDITION_NONE = 'none'

◆ CONDITION_NOTCONTAINSBLANKS

const PhpOffice\PhpSpreadsheet\Style\Conditional::CONDITION_NOTCONTAINSBLANKS = 'notContainsBlanks'

◆ CONDITION_NOTCONTAINSTEXT

const PhpOffice\PhpSpreadsheet\Style\Conditional::CONDITION_NOTCONTAINSTEXT = 'notContainsText'

◆ CONDITION_TYPES

const PhpOffice\PhpSpreadsheet\Style\Conditional::CONDITION_TYPES
private
Initial value:
= [
self::CONDITION_CELLIS,
self::CONDITION_CONTAINSBLANKS,
self::CONDITION_CONTAINSTEXT,
self::CONDITION_DATABAR,
self::CONDITION_EXPRESSION,
self::CONDITION_NONE,
self::CONDITION_NOTCONTAINSBLANKS,
self::CONDITION_NOTCONTAINSTEXT,
]

Definition at line 20 of file Conditional.php.

◆ OPERATOR_BEGINSWITH

const PhpOffice\PhpSpreadsheet\Style\Conditional::OPERATOR_BEGINSWITH = 'beginsWith'

◆ OPERATOR_BETWEEN

const PhpOffice\PhpSpreadsheet\Style\Conditional::OPERATOR_BETWEEN = 'between'

◆ OPERATOR_CONTAINSTEXT

const PhpOffice\PhpSpreadsheet\Style\Conditional::OPERATOR_CONTAINSTEXT = 'containsText'

◆ OPERATOR_ENDSWITH

const PhpOffice\PhpSpreadsheet\Style\Conditional::OPERATOR_ENDSWITH = 'endsWith'

◆ OPERATOR_EQUAL

const PhpOffice\PhpSpreadsheet\Style\Conditional::OPERATOR_EQUAL = 'equal'

◆ OPERATOR_GREATERTHAN

const PhpOffice\PhpSpreadsheet\Style\Conditional::OPERATOR_GREATERTHAN = 'greaterThan'

◆ OPERATOR_GREATERTHANOREQUAL

const PhpOffice\PhpSpreadsheet\Style\Conditional::OPERATOR_GREATERTHANOREQUAL = 'greaterThanOrEqual'

◆ OPERATOR_LESSTHAN

const PhpOffice\PhpSpreadsheet\Style\Conditional::OPERATOR_LESSTHAN = 'lessThan'

◆ OPERATOR_LESSTHANOREQUAL

const PhpOffice\PhpSpreadsheet\Style\Conditional::OPERATOR_LESSTHANOREQUAL = 'lessThanOrEqual'

◆ OPERATOR_NONE

const PhpOffice\PhpSpreadsheet\Style\Conditional::OPERATOR_NONE = ''

◆ OPERATOR_NOTBETWEEN

const PhpOffice\PhpSpreadsheet\Style\Conditional::OPERATOR_NOTBETWEEN = 'notBetween'

Definition at line 44 of file Conditional.php.

◆ OPERATOR_NOTCONTAINS

const PhpOffice\PhpSpreadsheet\Style\Conditional::OPERATOR_NOTCONTAINS = 'notContains'

◆ OPERATOR_NOTEQUAL

const PhpOffice\PhpSpreadsheet\Style\Conditional::OPERATOR_NOTEQUAL = 'notEqual'

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