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
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
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
Throws
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');
|
public
|
#
remove( )
Deletes the entry.
Throws
Example
$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
Example
$cluster->blob('Bob the blob')->detachTag('stupid name');
|