PHP Class PhpOrient\Protocols\Binary\Serialization\CSV

显示文件 Open project: ostico/phporient Class Usage Examples

Public Methods

Method Description
serialize ( mixed $value, boolean $embedded = false ) : string Serialize a value.
unserialize ( string $input ) : array | null Deserialize a record.

Protected Methods

Method Description
eatArray ( string $input ) : array Consume an array of values.
eatBag ( string $input ) : array Consume a record id bag.
eatBinary ( string $input ) : array Consume a binary field.
eatFirstKey ( string $input ) : array Consume the first field key, which could be a class name.
eatKey ( string $input ) : array Consume a field key, which may or may not be quoted.
eatMap ( string $input ) : array Consume a map of keys to values.
eatNumber ( string $input ) : array Consume a number.
eatRID ( string $input ) : array Consume a Record ID.
eatRecord ( string $input ) : array Consume an embedded record.
eatSet ( string $input ) : array Consume a set of values.
eatString ( string $input ) : array Consume a string.
eatValue ( string $input ) : array Consume a field value.
serializeArray ( array $array ) : string Serialize an array of values.
serializeDocument ( PhpOrient\Protocols\Binary\Abstracts\SerializableInterface $document, $embedded = false )

Method Details

eatArray() protected static method

Consume an array of values.
protected static eatArray ( string $input ) : array
$input string The input to consume
return array The collected array and any remaining content.

eatBag() protected static method

Consume a record id bag.
protected static eatBag ( string $input ) : array
$input string The input to consume
return array The collected record id bag and any remaining content.

eatBinary() protected static method

Consume a binary field.
protected static eatBinary ( string $input ) : array
$input string The input to consume
return array The collected binary and any remaining content.

eatFirstKey() protected static method

Consume the first field key, which could be a class name.
protected static eatFirstKey ( string $input ) : array
$input string The input to consume
return array The collected string and any remaining content, followed by a boolean indicating whether this is a class name.

eatKey() protected static method

Consume a field key, which may or may not be quoted.
protected static eatKey ( string $input ) : array
$input string The input to consume
return array The collected string and any remaining content.

eatMap() protected static method

Consume a map of keys to values.
protected static eatMap ( string $input ) : array
$input string The input to consume
return array The collected map and any remaining content.

eatNumber() protected static method

If the number has a suffix, consume it also and instantiate the right type, e.g. for dates
protected static eatNumber ( string $input ) : array
$input string The input to consume
return array The collected number and any remaining content.

eatRID() protected static method

Consume a Record ID.
protected static eatRID ( string $input ) : array
$input string The input to consume
return array The collected RID and any remaining content.

eatRecord() protected static method

Consume an embedded record.
protected static eatRecord ( string $input ) : array
$input string The input to unserialize.
return array The collected record and any remaining content.

eatSet() protected static method

Consume a set of values.
protected static eatSet ( string $input ) : array
$input string The input to consume
return array The collected set and any remaining content.

eatString() protected static method

Consume a string.
protected static eatString ( string $input ) : array
$input string The input to consume
return array The collected string and any remaining content.

eatValue() protected static method

Consume a field value.
protected static eatValue ( string $input ) : array
$input string The input to consume
return array The collected value and any remaining content.

serialize() public static method

Serialize a value.
public static serialize ( mixed $value, boolean $embedded = false ) : string
$value mixed The value to serialize.
$embedded boolean Whether this is a value embedded in another.
return string The serialized value.

serializeArray() protected static method

If the array is associative a map will be returned, otherwise a plain array.
protected static serializeArray ( array $array ) : string
$array array the array to serialize
return string the serialized array or map.

serializeDocument() protected static method

protected static serializeDocument ( PhpOrient\Protocols\Binary\Abstracts\SerializableInterface $document, $embedded = false )
$document PhpOrient\Protocols\Binary\Abstracts\SerializableInterface

unserialize() public static method

Deserialize a record.
public static unserialize ( string $input ) : array | null
$input string The input to un-serialize.
return array | null The un-serialized document, or null if the input is empty.