PHP Class Backend\Modules\Tags\Engine\Model

Afficher le fichier Open project: forkcms/forkcms Class Usage Examples

Méthodes publiques

Méthode Description
delete ( mixed $ids ) Delete one or more tags.
exists ( integer $id ) : boolean Check if a tag exists.
existsTag ( string $tag ) : boolean Check if a tag exists
get ( integer $id ) : array Get tag record.
getAll ( string $language = null ) : array Get all tags.
getStartsWith ( string $term, string $language = null ) : array Get tags that start with the given string
getTags ( string $module, integer $otherId, string $type = 'string', string $language = null ) : mixed Get tags for an item
getURL ( string $url, integer $id = null ) : string Get a unique URL for a tag
insert ( string $tag, string $language = null ) : integer Insert a new tag
saveTags ( integer $otherId, mixed $tags, string $module, string $language = null ) Save the tags
update ( array $item ) Update a tag Remark: $tag['id'] should be available.

Method Details

delete() public static méthode

Delete one or more tags.
public static delete ( mixed $ids )
$ids mixed The ids to delete.

exists() public static méthode

Check if a tag exists.
public static exists ( integer $id ) : boolean
$id integer The id to check for existence.
Résultat boolean

existsTag() public static méthode

Check if a tag exists
public static existsTag ( string $tag ) : boolean
$tag string The tag to check for existence.
Résultat boolean

get() public static méthode

Get tag record.
public static get ( integer $id ) : array
$id integer The id of the record to get.
Résultat array

getAll() public static méthode

Get all tags.
public static getAll ( string $language = null ) : array
$language string
Résultat array

getStartsWith() public static méthode

Get tags that start with the given string
public static getStartsWith ( string $term, string $language = null ) : array
$term string The searchstring.
$language string The language to use, if not provided use the working language.
Résultat array

getTags() public static méthode

Get tags for an item
public static getTags ( string $module, integer $otherId, string $type = 'string', string $language = null ) : mixed
$module string The module wherein will be searched.
$otherId integer The id of the record.
$type string The type of the returnvalue, possible values are: array, string (tags will be joined by ,).
$language string The language to use, if not provided the working language will be used.
Résultat mixed

getURL() public static méthode

Get a unique URL for a tag
public static getURL ( string $url, integer $id = null ) : string
$url string The URL to use as a base.
$id integer The ID to ignore.
Résultat string

insert() public static méthode

Insert a new tag
public static insert ( string $tag, string $language = null ) : integer
$tag string The data for the tag.
$language string The language wherein the tag will be inserted, if not provided the workinglanguage will be used.
Résultat integer

saveTags() public static méthode

Save the tags
public static saveTags ( integer $otherId, mixed $tags, string $module, string $language = null )
$otherId integer The id of the item to tag.
$tags mixed The tags for the item.
$module string The module wherein the item is located.
$language string The language wherein the tags will be inserted, if not provided the workinglanguage will be used.

update() public static méthode

Update a tag Remark: $tag['id'] should be available.
public static update ( array $item )
$item array The new data for the tag.