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 QdbTag

A tag in the database.

A tag is a lightweight means of finding entries in the database.

QdbEntry
Extended by QdbTag
Example:

You get a QdbTag instance by calling QdbCluster::tag(). Then enumerate entry having this tag:

$users = $cluster->tag('user')->getEntries();
foreach ($user as $user) {
    echo($user->alias());
}

Methods summary
public boolean
# attachEntry( QdbEntry|string $entry )

Attaches the tag to an entry.

Attaches the tag to an entry.

Parameters

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

Returns

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

Throws

QdbIncompatibleTypeException

Example

$cluster->tag('male')->attachEntry('Bob the Blob');
// same as $cluster->blob('Bob the Blob')->attachTag('male');

public QdbEntryCollection
# getEntries( )

Enumerates tagged entries.

Enumerates tagged entries.

Returns

QdbEntryCollection
A traversable collection of QdbEntry.

Throws

QdbIncompatibleTypeException

Example

$males = $cluster->tag('male')->getEntries();
foreach ($males as $entry) {
    echo($entry->alias() . ' is a male');
}

public boolean
# hasEntry( QdbEntry|string $entry )

Checks if an entry is attached with the tag.

Checks if an entry is attached with the tag.

Parameters

$entry
The entry to check, or its alias.

Returns

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

Example

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

public boolean
# detachEntry( QdbEntry|string $entry )

Detachs the tag from an entry.

Detachs the tag from an entry.

Parameters

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

Returns

boolean
true if the tag was removed, or false it the entry already didn't have this tag.

Throws

QdbIncompatibleTypeException

Example

$cluster->tag('stupid name')->detachEntry('Bob the Blob');
// same as $cluster->blob('Bob the Blob')->detachTag('stupid name');

Methods inherited from QdbEntry
alias(), attachTag(), detachTag(), getTags(), hasTag(), remove()
Copyright 2009-2017 quasardb SAS Documentation generated by ApiGen