wikimedia/cdb
CDB functions for PHP
Loading...
Searching...
No Matches
Cdb\Reader\Hash Class Reference

Hash implements the CdbReader interface based on an associative PHP array (a.k.a "hash"). More...

+ Inheritance diagram for Cdb\Reader\Hash:

Public Member Functions

 __construct (array $data)
 Create the object and open the file.
 
 close ()
 Close the file.
 
 get ( $key)
 Get a value with a given key.
 
 exists ( $key)
 Check whether key exists.
 
 firstkey ()
 Fetch first key.
 
 nextkey ()
 Fetch next key.
 

Additional Inherited Members

- Static Public Member Functions inherited from Cdb\Reader
static open ( $fileName)
 Open a file and return a subclass instance.
 
static haveExtension ()
 Returns true if the native extension is available.
 

Detailed Description

Hash implements the CdbReader interface based on an associative PHP array (a.k.a "hash").

Constructor & Destructor Documentation

◆ __construct()

Cdb\Reader\Hash::__construct ( array  $data)

Create the object and open the file.

Parameters
string[]$dataAn associative array

Member Function Documentation

◆ close()

Cdb\Reader\Hash::close ( )

Close the file.

Optional, you can just let the variable go out of scope.

Reimplemented from Cdb\Reader.

◆ exists()

Cdb\Reader\Hash::exists (   $key)

Check whether key exists.

Parameters
string | int$key
Returns
bool

Reimplemented from Cdb\Reader.

◆ firstkey()

Cdb\Reader\Hash::firstkey ( )

Fetch first key.

Returns
string|false

Reimplemented from Cdb\Reader.

◆ get()

Cdb\Reader\Hash::get (   $key)

Get a value with a given key.

Only string values are supported.

Parameters
string | int$key
Returns
string|false The value associated with $key, or false if $key is not known.

Reimplemented from Cdb\Reader.

◆ nextkey()

Cdb\Reader\Hash::nextkey ( )

Fetch next key.

Returns
string|false

Reimplemented from Cdb\Reader.


The documentation for this class was generated from the following file: