TYPO3
7.6
|
Static Public Member Functions | |
static | forceIntegerInRange ($theInt, $min, $max=2000000000, $defaultValue=0) |
static | convertToPositiveInteger ($theInt) |
static | canBeInterpretedAsInteger ($var) |
static | canBeInterpretedAsFloat ($var) |
static | calculateWithPriorityToAdditionAndSubtraction ($string) |
static | calculateWithParentheses ($string) |
static | isIntegerInRange ($value, $minimum, $maximum) |
Class with helper functions for mathematical calculations
Definition at line 20 of file MathUtility.php.
|
static |
Calculates the input with parenthesis levels
string | $string | Input string, eg "(123 + 456) / 789 - 4 |
Definition at line 170 of file MathUtility.php.
Referenced by ContentObjectRenderer\stdWrap_prioriCalc().
|
static |
Calculates the input by +,-,*,/,%,^ with priority to + and -
string | $string | Input string, eg "123 + 456 / 789 - 4 |
Definition at line 111 of file MathUtility.php.
|
static |
Tests if the input can be interpreted as float.
Note: Float casting from objects or arrays is considered undefined and thus will return false.
mixed | $var | Any input variable to test |
Definition at line 90 of file MathUtility.php.
|
static |
Tests if the input can be interpreted as integer.
Note: Integer casting from objects or arrays is considered undefined and thus will return false.
mixed | $var | Any input variable to test |
Definition at line 73 of file MathUtility.php.
Referenced by ResourceCompressor\__construct(), TcaInlineIsOnSymmetricSide\addData(), DatabaseRecordTypeValue\addData(), GeneralUtility\array2xml(), ContentObjectRenderer\calcAge(), PageLinkHandler\canHandleLink(), TableController\changeFunc(), TypoScriptFrontendController\checkAndSetAlias(), FileMetadataPermissionsAspect\checkModifyAccessList(), DataHandler\checkValueForInline(), DataHandler\clear_cacheCmd(), RelationHandler\convertPosNeg(), NormalizeCommand\convertRangeToListOfValues(), DataHandler\dbAnalysisStoreExec(), ContentObjectRenderer\detectLinkTypeFromLinkParameter(), TypoScriptFrontendController\determineIdIsHiddenPage(), DataHandler\doesRecordExist(), FrontendEditPanel\editPanelLinkWrap(), PageLinkHandler\expandPage(), ExtendedTemplateService\ext_getObjTree(), ExtendedTemplateService\ext_getTSCE_config(), ContentObjectRenderer\fillInMarkerArray(), AbstractRepository\findByUid(), FileRepository\findFileReferenceByUid(), SplitStorage\get(), EditDocumentController\getButtons(), AbstractFile\getCombinedIdentifier(), ImageManipulationElement\getFile(), BackendUtility\getFlexFormDS(), ImageService\getImageFromSourceString(), FormInlineAjaxController\getInlineExpandCollapseStateArrayForTableUid(), StagesService\getNextStage(), StagesService\getNotificationMode(), StagesService\getPrevStage(), StagesService\getPropertyOfCurrentWorkspaceStage(), LiveSearch\getRecordTitlePrep(), CleanUp\getTypo3TempStatistics(), SoftReferenceIndex\getTypoLinkParts(), ImageManipulationWizard\getWizardAction(), BackendController\handlePageEditing(), ContentObjectRenderer\imageLinkWrap(), AddController\init(), ShowImageController\initialize(), Clipboard\initializeClipboard(), RequestHandler\initializeOutputCompression(), Bootstrap\initializeOutputCompression(), ShortcutToolbarItem\initShortcuts(), DataHandler\insertUpdateDB_preprocessBasedOnFieldType(), PageGenerator\isAllowedLinkVarValue(), RelationHandler\isOnSymmetricSide(), TemplateService\linkData(), ContentObjectRenderer\listNum(), PageLayoutController\makeButtons(), LiveSearch\makeQuerySearchByTable(), AbstractDatabaseRecordList\makeSearchString(), AbstractMenuContentObject\menuTypoLink(), ElementBuilder\moveAllOtherUserdefinedPropertiesToAdditionalArguments(), NormalizeCommand\normalizeIntegerField(), ElementBuilder\overlayUserdefinedHtmlAttributeValues(), AbstractPlugin\pi_getFFvalueFromSheetArray(), AbstractPlugin\pi_isOnlyFields(), AbstractMenuContentObject\prepareMenuItemsForKeywordsMenu(), AbstractMenuContentObject\prepareMenuItemsForRootlineMenu(), AbstractMenuContentObject\prepareMenuItemsForUpdatedMenu(), AbstractItemProvider\processForeignTableClause(), SplitStorage\put(), RelationHandler\readList(), NormalizeCommand\reduceListOfValuesByStepValue(), RichTextElement\render(), InfoPageTyposcriptConfigController\renderList(), TypoScriptTemplateModuleController\renderList(), DateViewHelper\renderStatic(), ContentObjectRenderer\replacement(), ResourceFactory\retrieveFileOrFolderObject(), WorkspaceService\selectAllVersionsFromPages(), DataHandler\setTSconfigPermissions(), SoftReferenceIndex\setTypoLinkPartsElement(), TemplateService\sortedKeyList(), ContentObjectRenderer\splitObj(), RteHtmlParser\TS_links_rte(), DataHandler\updateFlexFormData(), ProcessedFile\updateProperties(), FileStorageIndexingAdditionalFieldProvider\validateAdditionalFields(), FileStorageExtractionAdditionalFieldProvider\validateAdditionalFields(), TypoScriptTemplateObjectBrowserModuleFunctionController\verify_TSobjects(), RelationHandler\writeForeignField(), and GeneralUtility\xml2arrayProcess().
|
static |
Returns $theInt if it is greater than zero, otherwise returns zero.
int | $theInt | Integer string to process |
Definition at line 55 of file MathUtility.php.
Referenced by EditDocumentController\generatePreviewCode(), LiveSearch\setLimitCount(), and LiveSearch\setStartCount().
|
static |
Forces the integer $theInt into the boundaries of $min and $max. If the $theInt is FALSE then the $defaultValue is applied.
int | $theInt | Input value |
int | $min | Lower limit |
int | $max | Higher limit |
int | $defaultValue | Default value if input is FALSE. |
Definition at line 31 of file MathUtility.php.
Referenced by AbstractItemProvider\addItemsFromFolder(), ImportExportController\addRecordsForPid(), Indexer\bodyDescription(), GraphicalFunctions\convertColor(), VersionNumberUtility\convertVersionsStringToVersionNumbers(), VersionNumberUtility\convertVersionStringToArray(), GraphicalFunctions\copyGifOntoGif(), MagicImageService\createMagicImage(), IndexSearchRepository\doSearch(), ExtendedTemplateService\ext_procesInput(), FileContentParser\fileContentParts(), NoneElement\formatValue(), SearchFormController\getDisplayResults(), VersionNumberUtility\getNumericTypo3Version(), SearchFormController\getResultRows(), GraphicalFunctions\getTextScalFactor(), GraphicalFunctions\IMparams(), GraphicalFunctions\IMreduceColors(), TableController\init(), SimpleDataHandlerController\init(), GraphicalFunctions\init(), Indexer\init(), SearchController\initialize(), SearchFormController\initialize(), Clipboard\initializeClipboard(), TcaInlineConfiguration\initializeMinMaxItems(), PageTreeNavigationController\initializeTemporaryDBmount(), FileContentParser\initParser(), GeneralUtility\initSysLog(), GraphicalFunctions\inputLevels(), SearchController\loadSettings(), SearchFormController\loadSettings(), CreateFolderController\main(), ThumbnailView\main(), GraphicalFunctions\makeBox(), GraphicalFunctions\makeOutline(), SearchController\makeRating(), GraphicalFunctions\makeShadow(), GraphicalFunctions\makeText(), SearchController\markupSWpartsOfString(), GeneralUtility\modifyHTMLColor(), TypoScriptParser\modifyHTMLColor(), GraphicalFunctions\output(), GraphicalFunctions\outputLevels(), AbstractPlugin\pi_exec_query(), AbstractPlugin\pi_getPidList(), AbstractPlugin\pi_list_browseresults(), SearchFormController\pi_list_browseresults(), AbstractMenuContentObject\prepareMenuItemsForKeywordsMenu(), AbstractMenuContentObject\prepareMenuItemsForUpdatedMenu(), LocalPreviewHelper\process(), ShowImageController\processImage(), VersionNumberUtility\raiseVersionNumber(), TcaTypesShowitem\removeFieldsByBitmaskExcludeBits(), NoneElement\render(), FilesContentObject\render(), RsaInputElement\render(), SelectMultipleSideBySideElement\render(), TextElement\render(), T3editorElement\render(), InlineControlContainer\renderPossibleRecordsSelectorTypeSelect(), SelectSingleBoxElement\renderSelectElement(), PageBrowsingViewHelper\renderStatic(), InfoboxViewHelper\renderStatic(), MailPostProcessor\setPriority(), AbstractDatabaseRecordList\start(), GraphicalFunctions\v5_blur(), GraphicalFunctions\v5_sharpen(), and JavaScriptMenuContentObject\writeMenu().
|
static |
Checks whether the given number $value is an integer in the range [$minimum;$maximum]
int | $value | Integer value to check |
int | $minimum | Lower boundary of the range |
int | $maximum | Upper boundary of the range |
Definition at line 200 of file MathUtility.php.
Referenced by Typo3DependencyViewHelper\isVersionSuitable(), and FileStorageExtractionAdditionalFieldProvider\validateAdditionalFields().