ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
PHPExcel_Calculation_Logical Class Reference
+ Collaboration diagram for PHPExcel_Calculation_Logical:

Static Public Member Functions

static TRUE ()
 
static FALSE ()
 
static LOGICAL_AND ()
 
static LOGICAL_OR ()
 
static NOT ($logical=FALSE)
 
static STATEMENT_IF ($condition=TRUE, $returnIfTrue=0, $returnIfFalse=FALSE)
 
static IFERROR ($testValue='', $errorpart='')
 

Detailed Description

Definition at line 46 of file Logical.php.

Member Function Documentation

◆ FALSE()

static PHPExcel_Calculation_Logical::FALSE ( )
static

Definition at line 77 of file Logical.php.

77 {
78 return FALSE;
79 } // function FALSE()

References FALSE().

Referenced by FALSE(), LOGICAL_AND(), LOGICAL_OR(), NOT(), STATEMENT_IF(), and LogicalTest\testFALSE().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IFERROR()

static PHPExcel_Calculation_Logical::IFERROR (   $testValue = '',
  $errorpart = '' 
)
static

Definition at line 281 of file Logical.php.

281 {
282 $testValue = (is_null($testValue)) ? '' : PHPExcel_Calculation_Functions::flattenSingleValue($testValue);
283 $errorpart = (is_null($errorpart)) ? '' : PHPExcel_Calculation_Functions::flattenSingleValue($errorpart);
284
285 return self::STATEMENT_IF(PHPExcel_Calculation_Functions::IS_ERROR($testValue), $errorpart, $testValue);
286 } // function IFERROR()
static flattenSingleValue($value='')
Convert an array to a single scalar value by extracting the first element.
Definition: Functions.php:662
static IS_ERROR($value='')
IS_ERROR.
Definition: Functions.php:384
static STATEMENT_IF($condition=TRUE, $returnIfTrue=0, $returnIfFalse=FALSE)
Definition: Logical.php:260

References PHPExcel_Calculation_Functions\flattenSingleValue(), PHPExcel_Calculation_Functions\IS_ERROR(), and STATEMENT_IF().

+ Here is the call graph for this function:

◆ LOGICAL_AND()

static PHPExcel_Calculation_Logical::LOGICAL_AND ( )
static

Definition at line 103 of file Logical.php.

103 {
104 // Return value
105 $returnValue = TRUE;
106
107 // Loop through the arguments
108 $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
109 $argCount = -1;
110 foreach ($aArgs as $argCount => $arg) {
111 // Is it a boolean value?
112 if (is_bool($arg)) {
113 $returnValue = $returnValue && $arg;
114 } elseif ((is_numeric($arg)) && (!is_string($arg))) {
115 $returnValue = $returnValue && ($arg != 0);
116 } elseif (is_string($arg)) {
117 $arg = strtoupper($arg);
118 if (($arg == 'TRUE') || ($arg == PHPExcel_Calculation::getTRUE())) {
119 $arg = TRUE;
120 } elseif (($arg == 'FALSE') || ($arg == PHPExcel_Calculation::getFALSE())) {
121 $arg = FALSE;
122 } else {
124 }
125 $returnValue = $returnValue && ($arg != 0);
126 }
127 }
128
129 // Return
130 if ($argCount < 0) {
132 }
133 return $returnValue;
134 } // function LOGICAL_AND()
static flattenArray($array)
Convert a multi-dimensional array to a simple 1-dimensional array.
Definition: Functions.php:598
static getFALSE()
Return the locale-specific translation of FALSE.
static getTRUE()
Return the locale-specific translation of TRUE.

References FALSE(), PHPExcel_Calculation_Functions\flattenArray(), PHPExcel_Calculation\getFALSE(), PHPExcel_Calculation\getTRUE(), TRUE(), and PHPExcel_Calculation_Functions\VALUE().

+ Here is the call graph for this function:

◆ LOGICAL_OR()

static PHPExcel_Calculation_Logical::LOGICAL_OR ( )
static

Definition at line 158 of file Logical.php.

158 {
159 // Return value
160 $returnValue = FALSE;
161
162 // Loop through the arguments
163 $aArgs = PHPExcel_Calculation_Functions::flattenArray(func_get_args());
164 $argCount = -1;
165 foreach ($aArgs as $argCount => $arg) {
166 // Is it a boolean value?
167 if (is_bool($arg)) {
168 $returnValue = $returnValue || $arg;
169 } elseif ((is_numeric($arg)) && (!is_string($arg))) {
170 $returnValue = $returnValue || ($arg != 0);
171 } elseif (is_string($arg)) {
172 $arg = strtoupper($arg);
173 if (($arg == 'TRUE') || ($arg == PHPExcel_Calculation::getTRUE())) {
174 $arg = TRUE;
175 } elseif (($arg == 'FALSE') || ($arg == PHPExcel_Calculation::getFALSE())) {
176 $arg = FALSE;
177 } else {
179 }
180 $returnValue = $returnValue || ($arg != 0);
181 }
182 }
183
184 // Return
185 if ($argCount < 0) {
187 }
188 return $returnValue;
189 } // function LOGICAL_OR()

References FALSE(), PHPExcel_Calculation_Functions\flattenArray(), PHPExcel_Calculation\getFALSE(), PHPExcel_Calculation\getTRUE(), TRUE(), and PHPExcel_Calculation_Functions\VALUE().

+ Here is the call graph for this function:

◆ NOT()

static PHPExcel_Calculation_Logical::NOT (   $logical = FALSE)
static

Definition at line 212 of file Logical.php.

212 {
214 if (is_string($logical)) {
215 $logical = strtoupper($logical);
216 if (($logical == 'TRUE') || ($logical == PHPExcel_Calculation::getTRUE())) {
217 return FALSE;
218 } elseif (($logical == 'FALSE') || ($logical == PHPExcel_Calculation::getFALSE())) {
219 return TRUE;
220 } else {
222 }
223 }
224
225 return !$logical;
226 } // function NOT()

References FALSE(), PHPExcel_Calculation_Functions\flattenSingleValue(), PHPExcel_Calculation\getFALSE(), PHPExcel_Calculation\getTRUE(), TRUE(), and PHPExcel_Calculation_Functions\VALUE().

+ Here is the call graph for this function:

◆ STATEMENT_IF()

static PHPExcel_Calculation_Logical::STATEMENT_IF (   $condition = TRUE,
  $returnIfTrue = 0,
  $returnIfFalse = FALSE 
)
static

Definition at line 260 of file Logical.php.

260 {
261 $condition = (is_null($condition)) ? TRUE : (boolean) PHPExcel_Calculation_Functions::flattenSingleValue($condition);
262 $returnIfTrue = (is_null($returnIfTrue)) ? 0 : PHPExcel_Calculation_Functions::flattenSingleValue($returnIfTrue);
263 $returnIfFalse = (is_null($returnIfFalse)) ? FALSE : PHPExcel_Calculation_Functions::flattenSingleValue($returnIfFalse);
264
265 return ($condition) ? $returnIfTrue : $returnIfFalse;
266 } // function STATEMENT_IF()

References FALSE(), PHPExcel_Calculation_Functions\flattenSingleValue(), and TRUE().

Referenced by IFERROR().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TRUE()

static PHPExcel_Calculation_Logical::TRUE ( )
static

Definition at line 60 of file Logical.php.

60 {
61 return TRUE;
62 } // function TRUE()

References TRUE().

Referenced by LOGICAL_AND(), LOGICAL_OR(), NOT(), STATEMENT_IF(), LogicalTest\testTRUE(), and TRUE().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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