PHP Class Frontend\Modules\Tags\Engine\Model

Show file Open project: forkcms/forkcms Class Usage Examples

Public Methods

Method Description
callFromInterface ( string $module, string $class, string $method, mixed $parameter = null ) : mixed Calls a method that has to be implemented though the tags interface
get ( string $url, string $language = null ) : array Get the tag for a given URL
getAll ( ) : array Fetch the list of all tags, ordered by their occurrence
getForItem ( string $module, integer $otherId ) : array Get tags for an item
getForMultipleItems ( string $module, array $otherIds ) : array Get tags for multiple items.
getIdByURL ( string $url ) : integer Get the tag-id for a given URL
getModulesForTag ( integer $id ) : array Get the modules that used a tag.
getName ( integer $id ) : string Fetch a specific tag name
getRelatedItemsByTags ( integer $id, integer $module, integer $otherModule, integer $limit = 5 ) : array Get all related items

Method Details

callFromInterface() public static method

Calls a method that has to be implemented though the tags interface
public static callFromInterface ( string $module, string $class, string $method, mixed $parameter = null ) : mixed
$module string The module wherein to search.
$class string The class that should contain the method.
$method string The method to call.
$parameter mixed The parameters to pass.
return mixed

get() public static method

Get the tag for a given URL
public static get ( string $url, string $language = null ) : array
$url string The URL to get the tag for.
$language string
return array

getAll() public static method

Fetch the list of all tags, ordered by their occurrence
public static getAll ( ) : array
return array

getForItem() public static method

Get tags for an item
public static getForItem ( string $module, integer $otherId ) : array
$module string The module wherein the otherId occurs.
$otherId integer The id of the item.
return array

getForMultipleItems() public static method

Get tags for multiple items.
public static getForMultipleItems ( string $module, array $otherIds ) : array
$module string The module wherefore you want to retrieve the tags.
$otherIds array The ids for the items.
return array

getIdByURL() public static method

Get the tag-id for a given URL
public static getIdByURL ( string $url ) : integer
$url string The URL to get the id for.
return integer

getModulesForTag() public static method

Get the modules that used a tag.
public static getModulesForTag ( integer $id ) : array
$id integer The id of the tag.
return array

getName() public static method

Fetch a specific tag name
public static getName ( integer $id ) : string
$id integer The id of the tag to grab the name for.
return string

getRelatedItemsByTags() public static method

Get all related items
public static getRelatedItemsByTags ( integer $id, integer $module, integer $otherModule, integer $limit = 5 ) : array
$id integer The id of the item in the source-module.
$module integer The source module.
$otherModule integer The module wherein the related items should appear.
$limit integer The maximum of related items to grab.
return array