Quasardb API for PHP
Introduction Installation Compilation Configuration API Reference

Classes

  • QdbBatch
  • QdbBatchResult
  • QdbBlob
  • QdbCluster
  • QdbDeque
  • QdbEntry
  • QdbEntryCollection
  • QdbExpirableEntry
  • QdbHashSet
  • QdbInteger
  • QdbTag
  • QdbTagCollection

Exceptions

  • QdbAliasAlreadyExistsException
  • QdbAliasNotFoundException
  • QdbConnectionException
  • QdbContainerEmptyException
  • QdbException
  • QdbIncompatibleTypeException
  • QdbInputException
  • QdbOperationDisabledException
  • QdbOperationException
  • QdbProtocolException
  • QdbSystemException

Class QdbEntry

An entry in the database

Direct known subclasses

QdbDeque, QdbExpirableEntry, QdbHashSet, QdbTag

Indirect known subclasses

QdbBlob, QdbInteger
Abstract
Methods summary
public boolean
# attachTag( QdbTag|string $tag )

Attachs a tag to the entry

Attachs a tag to the entry

Parameters

$tag
The tag to add to the entry, or its alias.

Returns

boolean
true if the tag was added, or false it the entry already had this tag.

Throws

QdbAliasNotFoundException
QdbIncompatibleTypeException

Example

$cluster->blob('Bob the blob')->attachTag('male');
public string
# alias( )

Gets the alias (i.e. its "key") of the entry.

Gets the alias (i.e. its "key") of the entry.

Alias starting with qdb are reserved.

Returns

string
The alias of the entry.
public QdbTagCollection
# getTags( QdbTag|string $tag )

Enumerates the tags attached to the entry.

Enumerates the tags attached to the entry.

Parameters

$tag
The tag to the entry, or it's alias.

Returns

QdbTagCollection
A traversable collection of QdbTag

Throws

QdbAliasNotFoundException

Example

$bobsTags = $cluster->blob('Bob the blob')->getTags();
foreach ($bobsTags as $tag) {
    echo('Bob has the tag ' . $tag->alias());
}

public boolean
# hasTag( QdbTag|string $tag )

Checks if a tag is attached to the entry.

Checks if a tag is attached to the entry.

Parameters

$tag
The tag to check for, or its alias.

Returns

boolean
true if the entry is tagged with the given tag, false otherwise.

Example

$bob_is_male = $cluster->blob('Bob the Blob')->hasTag('male');
// same as $bob_is_male = $cluster->tag('male')->hasEntry('Bob the Blob');

public
# remove( )

Deletes the entry.

Deletes the entry.

Throws

QdbAliasNotFoundException

Example

// Bye-bye Bob :-(
$cluster->blob('Bob the blob')->remove();

public boolean
# detachTag( QdbTag|string $tag )

Detaches a tag from the entry.

Detaches a tag from the entry.

Parameters

$tag
The tag to the entry, or its alias.

Returns

boolean
true if the tag was added, or false it the entry already had this tag.

Throws

QdbAliasNotFoundException
QdbIncompatibleTypeException

Example

$cluster->blob('Bob the blob')->detachTag('stupid name');
Copyright 2009-2017 quasardb SAS Documentation generated by ApiGen