phpDocumentor

IdType extends IntType
in package
implements IdInterface

Class IdType

IMPORTANT: When you need to cast an Id object to integer, cast it first to string, because otherwise the following command will return always 1:

EXAMPLE: $id = new IdType(948); bad - (int)$id >> 1 good - (int)(string)$id >> 948

Tags
category

System

subpackage

Types

Interfaces, Classes and Traits

IdInterface
Class IdInterface

Table of Contents

$value  : int
Instance Value
__construct()  : mixed
Class Constructor
__toString()  : string
asInt()  : int
Get the instance value as int.

Properties

Methods

__construct()

Class Constructor

public __construct(int $p_value) : mixed
Parameters
$p_value : int
Tags
throws
InvalidArgumentException

On negative values.

Return values
mixed

__toString()

public __toString() : string
Tags
deprecated

v2.7.1.0 To string method is left for backwards compatibility. Use asInt() method instead.

Return values
string

asInt()

Get the instance value as int.

public asInt() : int
Return values
int

Search results