PHP Class Backend\Modules\Tags\Engine\Model

Datei anzeigen Open project: forkcms/forkcms Class Usage Examples

Public Methods

Method 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 method

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

exists() public static method

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

existsTag() public static method

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

get() public static method

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

getAll() public static method

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

getStartsWith() public static method

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.
return array

getTags() public static method

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.
return mixed

getURL() public static method

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.
return string

insert() public static method

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.
return integer

saveTags() public static method

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 method

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