Quasardb API for PHP
Introduction Installation Compilation Configuration API Reference

Namespaces

  • qdb

Classes

  • QdbAliasAlreadyExistsException
  • QdbAliasNotFoundException
  • QdbBatch
  • QdbBatchResult
  • QdbBlob
  • QdbCluster
  • QdbConnectionException
  • QdbContainerEmptyException
  • QdbDeque
  • QdbEntry
  • QdbEntryCollection
  • QdbException
  • QdbExpirableEntry
  • QdbIncompatibleTypeException
  • QdbInputException
  • QdbInteger
  • QdbOperationDisabledException
  • QdbOperationException
  • QdbProtocolException
  • QdbSystemException
  • QdbTag
  • QdbTagCollection

Class QdbEntry

An entry in the database

Direct known subclasses

qdb\QdbDeque, qdb\QdbExpirableEntry, qdb\QdbTag

Indirect known subclasses

qdb\QdbBlob, qdb\QdbInteger
Abstract
Namespace: qdb
Methods summary
public boolean
# attachTag( qdb\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

qdb\QdbAliasNotFoundException
qdb\QdbIncompatibleTypeException

Example

$cluster->blob('Bob the blob')->attachTag('male');
public
# attachTags( array $tags )

Attachs one or more tags to the entry

Attachs one or more tags to the entry

Parameters

$tags
$tag An array of string or QdbTag.

Throws

qdb\QdbAliasNotFoundException
qdb\QdbIncompatibleTypeException

Example

$cluster->blob('Bob the blob')->attachTags(array('male','funny'));
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 qdb\QdbTagCollection
# getTags( qdb\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

qdb\QdbTagCollection
A traversable collection of qdb\QdbTag

Throws

qdb\QdbAliasNotFoundException

Example

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

public boolean
# hasTag( qdb\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

qdb\QdbAliasNotFoundException

Example

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

public boolean
# detachTag( qdb\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

qdb\QdbAliasNotFoundException
qdb\QdbIncompatibleTypeException

Example

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