Num
+ Inheritance diagram for Num:

Description

A numeric expression.

Public Static Methods

static self pi (DB $db)
 PI() More...
 
static self rand (DB $db)
 RAND() float between 0 and 1 More...
 
- Public Static Methods inherited from Expression
magic static self factory (DB $db, string $expression)
 

Public Methods

DateTime toDateTime ()
 DateTime from a Unix timestamp. More...
 
- Public Methods inherited from Expression
 __construct (DB $db, string $expression)
 
string __toString ()
 
- Public Methods inherited from NumTrait
Num abs ()
 ABS($this) More...
 
Num acos ()
 ACOS($this) More...
 
Num add ($arg,... $args)
 ($this + $arg + ... More...
 
Num asin ()
 ASIN($this) More...
 
Num atan ()
 ATAN($this) More...
 
Num bAnd ($value)
 Bitwise AND More...
 
Num bNot ($value)
 Bitwise NOT More...
 
Num bOr ($value)
 Bitwise OR More...
 
Num bSL (int $bits=1)
 Bitwise shift left. More...
 
Num bSR (int $bits=1)
 Bitwise shift right. More...
 
Num ceil ()
 CEIL($this) More...
 
Num cos ()
 COS($this) More...
 
Num degrees ()
 Radians to degrees. More...
 
Num div ($arg,... $args)
 ($this / $arg / ...) More...
 
Num exp ()
 Euler's constant raised to the power of the expression. More...
 
Num floor ()
 FLOOR($this) More...
 
Predicate isEven ()
 ($this % 2) = 0 More...
 
Predicate isNegative ()
 $this < 0 More...
 
Predicate isOdd ()
 ($this % 2) <> 0 More...
 
Predicate isPositive ()
 $this > 0 More...
 
Predicate isZero ()
 $this = 0 More...
 
Num ln ()
 LN($this) More...
 
Num log (float $base)
 LOG($base,$this) More...
 
Num log10 ()
 LOG10($this) More...
 
Num log2 ()
 LOG2($this) More...
 
Num mod (float $divisor)
 ($this % $divisor) More...
 
Num mul ($arg,... $args)
 ($this * $arg * ...) More...
 
Num pow (float $exponent)
 POW($this,$exponent) More...
 
Num radians ()
 Degrees to radians. More...
 
Num root (int $radix)
 POW($this,1/$radix) More...
 
Num round (int $decimals=0)
 ROUND($this,$decimals) More...
 
Num sign ()
 SIGN($this) More...
 
Num sin ()
 SIN($this) More...
 
Num sqrt ()
 SQRT($this) More...
 
Num sub ($arg,... $args)
 ($this - $arg - ...) More...
 
Num tan ()
 TAN($this) More...
 
- Public Methods inherited from ValueTrait
Value coalesce (array $values)
 COALESCE($this, ...$values) More...
 
- Public Methods inherited from AggregateTrait
Num avg ()
 AVG($this) More...
 
Num avgDistinct ()
 AVG(DISTINCT $this) More...
 
Num count ()
 COUNT($this) More...
 
Num countDistinct ()
 COUNT(DISTINCT $this) More...
 
Str groupConcat (string $delimiter=',')
 GROUP_CONCAT($this) using a delimiter. More...
 
Num max ()
 MAX($this) More...
 
Num min ()
 MIN($this) More...
 
Num sum ()
 SUM($this) More...
 
Num sumDistinct ()
 SUM(DISTINCT $this) More...
 
- Public Methods inherited from ComparisonTrait
Predicate is ($arg)
 Null-safe type-strict equality. More...
 
Predicate isBetween ($min, $max)
 $this BETWEEN $min AND $max (inclusive) More...
 
Predicate isEqual ($arg)
 See Predicate::match(). More...
 
Predicate isFalse ()
 $this IS FALSE More...
 
Predicate isGt ($arg)
 $this > $arg, or driver-appropriate $this > ALL (SELECT ...) More...
 
Predicate isGtAny (Select $select)
 Driver-appropriate $this > ANY (SELECT ...) More...
 
Predicate isGte ($arg)
 $this >= $arg, or driver-appropriate $this >= ALL (SELECT ...) More...
 
Predicate isGteAny (Select $select)
 Driver-appropriate $this >= ANY (SELECT ...) More...
 
Predicate isLike (string $pattern)
 $this LIKE $pattern More...
 
Predicate isLt ($arg)
 $this < $arg, or driver-appropriate $this < ALL (SELECT ...) More...
 
Predicate isLtAny (Select $select)
 Driver-appropriate $this < ANY (SELECT ...) More...
 
Predicate isLte ($arg)
 $this <= $arg, or driver-appropriate $this <= ALL (SELECT ...) More...
 
Predicate isLteAny (Select $select)
 Driver-appropriate $this <= ANY (SELECT ...) More...
 
Predicate isNot ($arg)
 Null-safe type-strict inequality. More...
 
Predicate isNotBetween ($min, $max)
 $this NOT BETWEEN $min AND $max (inclusive) More...
 
Predicate isNotEqual ($arg)
 $this <> $arg or $this NOT IN ($arg) More...
 
Predicate isNotLike (string $pattern)
 $this NOT LIKE $pattern More...
 
Predicate isNotNull ()
 $this IS NOT NULL More...
 
Predicate isNotRegExp (string $pattern)
 $this NOT REGEXP $pattern More...
 
Predicate isNull ()
 $this IS NULL More...
 
Predicate isRegExp (string $pattern)
 $this REGEXP $pattern More...
 
Branch switch (array $values=[])
 CASE $this ... More...
 
- Public Methods inherited from BaseConversionTrait
Str toBase (int $from, int $to)
 Convert between arbitrary bases. More...
 
Str toBase16 (int $from=10)
 Convert from an arbitrary base to base 16. More...
 
Str toBase2 (int $from=10)
 Convert from an arbitrary base to base 2. More...
 
Str toBase8 (int $from=10)
 Convert from an arbitrary base to base 8. More...
 
- Public Methods inherited from NumCastIntTrait
Num toInt ()
 Casts the expression as a signed integer. More...
 
- Public Methods inherited from StrCastTrait
Str toStr ()
 Casts the expression as a character string. More...
 

Additional Inherited Members

- Protected Properties inherited from Expression
DB $db
 
string $expression
 

Methods

◆ pi()

static self pi ( DB  $db)
static

PI()

Parameters
DB$db
Returns
self

◆ rand()

static self rand ( DB  $db)
static

RAND() float between 0 and 1

Parameters
DB$db
Returns
self

◆ toDateTime()

DateTime toDateTime ( )

DateTime from a Unix timestamp.

The expression must be a non-negative integer.

Returns
DateTime