scalikephp

None extends Option Uses OptionOps

Scala like None.

Table of Contents

count()  : int
drop()  : Seq
each()  : void
exists()  : bool
filter()  : self
filterNot()  : self
find()  : Option
flatMap()  : self
flatten()  : self
fold()  : mixed
forAll()  : bool
from()  : Option
Returns an Option of the value.
fromArray()  : Option
Returns an Option of the array element.
generate()  : Generator
Creates a new {@link Generator} from this collection.
get()  : mixed
Returns the value, throw exception if empty.
getInstance()  : self
Returns the None instance.
getIterator()  : Traversable
getOrElse()  : mixed
Returns the value if the Option is non-empty, otherwise return the result of evaluating `$default`.
getOrElseValue()  : mixed
Returns the value if this Option is non-empty, otherwise return the `$default`.
groupBy()  : Map
head()  : mixed
headOption()  : Option
isDefined()  : bool
Returns true if this Option is non-empty, false otherwise.
isEmpty()  : bool
jsonSerialize()  : mixed
last()  : mixed
lastOption()  : Option
map()  : self
max()  : mixed
maxBy()  : mixed
min()  : mixed
minBy()  : mixed
mkString()  : string
none()  : None
Returns the None instance.
nonEmpty()  : bool
offsetExists()  : bool
PHP magic method: offsetExists.
offsetGet()  : mixed|void
PHP magic method: offsetGet.
offsetSet()  : void
PHP magic method: offsetSet.
offsetUnset()  : void
PHP magic method: offsetUnset.
orElse()  : Option
Returns this Option if it is non-empty, otherwise return the result of evaluating `$alternative`.
orNull()  : null|mixed
Returns the value if this Option is non-empty, otherwise return `null`.
partition()  : array<string|int, mixed>|array<string|int, Seq>
pick()  : Option
Returns the value of a single column of this Option's value if it exists, otherwise return None.
size()  : int
some()  : Some
Returns a Some of the value.
sum()  : float|int
Sums up the elements of this collection.
sumBy()  : int
tail()  : static
Returns rest of this collection without its first element.
take()  : Option
takeRight()  : Option
toArray()  : array<string|int, mixed>
toGenerator()  : Generator
toSeq()  : Seq

Methods

count()

public count() : int
Return values
int —

drop()

public drop(int $n) : Seq
Parameters
$n : int
Return values
Seq —

each()

public each(Closure $f) : void
Parameters
$f : Closure
Return values
void —

exists()

public exists(Closure $p) : bool
Parameters
$p : Closure
Return values
bool —

filter()

public filter(Closure $p) : self
Parameters
$p : Closure
Return values
self —

filterNot()

public filterNot(Closure $p) : self
Parameters
$p : Closure
Return values
self —

find()

public find(Closure $p) : Option
Parameters
$p : Closure
Return values
Option —

flatMap()

public flatMap(Closure $f) : self
Parameters
$f : Closure
Return values
self —

flatten()

public flatten() : self
Return values
self —

fold()

public fold(mixed $z, Closure $op) : mixed
Parameters
$z : mixed
$op : Closure
Return values
mixed —

forAll()

public forAll(Closure $p) : bool
Parameters
$p : Closure
Return values
bool —

from()

Returns an Option of the value.

public final static from(mixed $value[, mixed $none = null ]) : Option
Parameters
$value : mixed
$none : mixed = null
Return values
Option —

fromArray()

Returns an Option of the array element.

public final static fromArray(array<string|int, mixed>|ArrayAccess $array, int|string $key[, mixed $none = null ]) : Option
Parameters
$array : array<string|int, mixed>|ArrayAccess
$key : int|string
$none : mixed = null
Return values
Option —

generate()

Creates a new {@link Generator} from this collection.

public generate(Closure $f) : Generator
Parameters
$f : Closure

the function to apply to each element. it should returns a .

Return values
Generator —

get()

Returns the value, throw exception if empty.

public get() : mixed
Return values
mixed —

getInstance()

Returns the None instance.

public static getInstance() : self
Return values
self —

getIterator()

public getIterator() : Traversable
Return values
Traversable —

getOrElse()

Returns the value if the Option is non-empty, otherwise return the result of evaluating `$default`.

public getOrElse(Closure $default) : mixed
Parameters
$default : Closure

the default expression.

Return values
mixed —

getOrElseValue()

Returns the value if this Option is non-empty, otherwise return the `$default`.

public getOrElseValue(mixed $default) : mixed
Parameters
$default : mixed

the default value.

Return values
mixed —

groupBy()

public groupBy(mixed $f) : Map
Parameters
$f : mixed
Return values
Map —

head()

public head() : mixed
Return values
mixed —

isDefined()

Returns true if this Option is non-empty, false otherwise.

public isDefined() : bool
Return values
bool —

isEmpty()

public isEmpty() : bool
Return values
bool —

jsonSerialize()

public jsonSerialize() : mixed
Return values
mixed —

last()

public last() : mixed
Return values
mixed —

map()

public map(Closure $f) : self
Parameters
$f : Closure
Return values
self —

max()

public max() : mixed
Return values
mixed —

maxBy()

public maxBy(Closure $f) : mixed
Parameters
$f : Closure
Return values
mixed —

min()

public min() : mixed
Return values
mixed —

minBy()

public minBy(Closure $f) : mixed
Parameters
$f : Closure
Return values
mixed —

mkString()

public mkString([string $sep = '' ]) : string
Parameters
$sep : string = ''
Return values
string —

nonEmpty()

public nonEmpty() : bool
Return values
bool —

offsetExists()

PHP magic method: offsetExists.

public offsetExists(mixed $offset) : bool
Parameters
$offset : mixed
Return values
bool —

offsetGet()

PHP magic method: offsetGet.

public offsetGet(mixed $offset) : mixed|void
Parameters
$offset : mixed
Return values
mixed|void —

offsetSet()

PHP magic method: offsetSet.

public offsetSet(mixed $offset, mixed $value) : void
Parameters
$offset : mixed
$value : mixed
Return values
void —

offsetUnset()

PHP magic method: offsetUnset.

public offsetUnset(mixed $offset) : void
Parameters
$offset : mixed
Return values
void —

orElse()

Returns this Option if it is non-empty, otherwise return the result of evaluating `$alternative`.

public orElse(Closure $alternative) : Option
Parameters
$alternative : Closure
Return values
Option —

orNull()

Returns the value if this Option is non-empty, otherwise return `null`.

public orNull() : null|mixed
Return values
null|mixed —

partition()

public partition(Closure $p) : array<string|int, mixed>|array<string|int, Seq>
Parameters
$p : Closure
Return values
array<string|int, mixed>|array<string|int, Seq> —

pick()

Returns the value of a single column of this Option's value if it exists, otherwise return None.

public pick(mixed $name) : Option
Parameters
$name : mixed

the key of array, or property name.

Return values
Option —

size()

public size() : int
Return values
int —

some()

Returns a Some of the value.

public final static some(mixed $value) : Some
Parameters
$value : mixed
Return values
Some —

sum()

Sums up the elements of this collection.

public sum() : float|int
Return values
float|int —

the sum of all elements of this collection.

sumBy()

public sumBy(Closure $f) : int
Parameters
$f : Closure
Return values
int —

tail()

Returns rest of this collection without its first element.

public tail() : static
Return values
static —

takeRight()

public takeRight(int $n) : Option
Parameters
$n : int
Return values
Option —

toArray()

public toArray() : array<string|int, mixed>
Return values
array<string|int, mixed> —

toGenerator()

public toGenerator() : Generator
Return values
Generator —

Search results