Methods summary
public
|
|
public
|
|
public
|
|
public
|
#
afterSave( CModelEvent $event )
Responds to CModel::onAfterSave event.
Responds to CModel::onAfterSave event.
Matches tags provided they: - start with a # - consist of these characters:
UTF-8 letters, numbers, _ and - (but only in the middle of the tag) - come after
a space or . or are at the beginning - are not in quotes
Looks up any current tag records, and saves a tag record for each new tag.
Note: does not delete tags when they are removed from text fields (this would
screw with manual tagging)
Parameters
- $event
CModelEvent $event event parameter
Overrides
CActiveRecordBehavior::afterSave()
|
public
|
#
afterDelete( CModelEvent $event )
Responds to CActiveRecord::onAfterDelete event. Deletes all the tags
for this model
Responds to CActiveRecord::onAfterDelete event. Deletes all the tags
for this model
Parameters
- $event
CModelEvent $event event parameter
Overrides
CActiveRecordBehavior::afterDelete()
|
public
array
|
#
scanForTags( )
Scans through every 'varchar' and 'text' field in the owner model for
tags.
Scans through every 'varchar' and 'text' field in the owner model for
tags.
Returns
array an array of tags
|
public
array
|
#
matchTags( string $text )
Finds all tag matches in text
Finds all tag matches in text
Parameters
Returns
array
|
public
true
|
#
hasTag( string $tag, array $oldTags = null, mixed $refresh = false )
Parameters
- $tag
string $tag
- $oldTags
array|null $oldTags
- $refresh
Returns
true if record has tag already, false otherwise
|
public
boolean
|
#
hasTags( mixed $tags, array $mode = 'OR' )
Tests whether the owner model has any (OR mode) or all (AND mode) of the
provided tags
Tests whether the owner model has any (OR mode) or all (AND mode) of the
provided tags
Parameters
- $tags
mixed $tags sring or array of strings containing tags
- $mode
array $mode logic mode (either "AND" or "OR") for the test
Returns
boolean the test result
|
public
array
|
#
getTags( mixed $refreshCache = false )
Looks up the tags associated with the owner model. Uses $tags as a
cache to prevent repeated queries.
Looks up the tags associated with the owner model. Uses $tags as a
cache to prevent repeated queries.
Returns
array an array of tags
|
public
|
#
setTags( mixed $tags, mixed $rawInput = false )
|
public
|
|
public
|
|
public
boolean
|
#
addTags( mixed $tags )
Adds the specified tag(s) to the owner model, but not if the tag has already
been added.
Adds the specified tag(s) to the owner model, but not if the tag has already
been added.
Parameters
- $tags
mixed $tags a string or array of strings containing tags
Returns
boolean whether or not at least one tag was added successfully
|
public
boolean
|
#
removeTags( mixed $tags )
Removes the specified tag(s) from the owner model
Removes the specified tag(s) from the owner model
Parameters
- $tags
mixed $tags a string or array of strings containing tags
Returns
boolean whether or not at least one tag was deleted successfully
|
public
|
#
clearTags( )
Deletes all tags associated with the owner model
Deletes all tags associated with the owner model
|
Methods inherited from CComponent
__call(),
__get(),
__isset(),
__set(),
__unset(),
asa(),
attachBehavior(),
attachBehaviors(),
attachEventHandler(),
canGetProperty(),
canSetProperty(),
detachBehavior(),
detachBehaviors(),
detachEventHandler(),
disableBehavior(),
disableBehaviors(),
enableBehavior(),
enableBehaviors(),
evaluateExpression(),
getEventHandlers(),
hasEvent(),
hasEventHandler(),
hasProperty(),
raiseEvent()
|