PHP Class Backend\Modules\Faq\Engine\Model

Show file Open project: forkcms/forkcms Class Usage Examples

Public Methods

Method Description
delete ( integer $id ) Delete a question
deleteCategory ( integer $id ) Delete a specific category
deleteCategoryAllowed ( integer $id ) : boolean Is the deletion of a category allowed?
deleteFeedback ( integer $itemId ) Delete the feedback
exists ( integer $id ) : boolean Does the question exist?
existsCategory ( integer $id ) : boolean Does the category exist?
get ( integer $id ) : array Fetch a question
getAllFeedback ( integer $limit = 5 ) : array Fetches all the feedback that is available
getAllFeedbackForQuestion ( integer $id ) : array Fetches all the feedback for a question
getByTag ( integer $tagId ) : array Get all items by a given tag id
getCategories ( boolean $includeCount = false ) : array Get all the categories
getCategory ( integer $id ) : array Fetch a category
getCategoryCount ( ) : integer Fetch the category count
getFeedback ( integer $id ) : array Fetch the feedback item
getMaximumCategorySequence ( ) : integer Get the maximum sequence for a category
getMaximumSequence ( integer $id ) : integer Get the max sequence id for a category
getURL ( string $url, integer $id = null ) : string Retrieve the unique URL for an item
getURLForCategory ( string $url, integer $id = null ) : string Retrieve the unique URL for a category
insert ( array $item ) : integer Insert a question in the database
insertCategory ( array $item, array $meta = null ) : integer Insert a category in the database
update ( array $item ) Update a certain question
updateCategory ( array $item ) Update a certain category

Method Details

delete() public static method

Delete a question
public static delete ( integer $id )
$id integer

deleteCategory() public static method

Delete a specific category
public static deleteCategory ( integer $id )
$id integer

deleteCategoryAllowed() public static method

Is the deletion of a category allowed?
public static deleteCategoryAllowed ( integer $id ) : boolean
$id integer
return boolean

deleteFeedback() public static method

Delete the feedback
public static deleteFeedback ( integer $itemId )
$itemId integer

exists() public static method

Does the question exist?
public static exists ( integer $id ) : boolean
$id integer
return boolean

existsCategory() public static method

Does the category exist?
public static existsCategory ( integer $id ) : boolean
$id integer
return boolean

get() public static method

Fetch a question
public static get ( integer $id ) : array
$id integer
return array

getAllFeedback() public static method

Fetches all the feedback that is available
public static getAllFeedback ( integer $limit = 5 ) : array
$limit integer
return array

getAllFeedbackForQuestion() public static method

Fetches all the feedback for a question
public static getAllFeedbackForQuestion ( integer $id ) : array
$id integer The question id.
return array

getByTag() public static method

Get all items by a given tag id
public static getByTag ( integer $tagId ) : array
$tagId integer
return array

getCategories() public static method

Get all the categories
public static getCategories ( boolean $includeCount = false ) : array
$includeCount boolean
return array

getCategory() public static method

Fetch a category
public static getCategory ( integer $id ) : array
$id integer
return array

getCategoryCount() public static method

Fetch the category count
public static getCategoryCount ( ) : integer
return integer

getFeedback() public static method

Fetch the feedback item
public static getFeedback ( integer $id ) : array
$id integer
return array

getMaximumCategorySequence() public static method

Get the maximum sequence for a category
public static getMaximumCategorySequence ( ) : integer
return integer

getMaximumSequence() public static method

Get the max sequence id for a category
public static getMaximumSequence ( integer $id ) : integer
$id integer The category id.
return integer

getURL() public static method

Retrieve the unique URL for an item
public static getURL ( string $url, integer $id = null ) : string
$url string
$id integer The id of the item to ignore.
return string

getURLForCategory() public static method

Retrieve the unique URL for a category
public static getURLForCategory ( string $url, integer $id = null ) : string
$url string
$id integer The id of the category to ignore.
return string

insert() public static method

Insert a question in the database
public static insert ( array $item ) : integer
$item array
return integer

insertCategory() public static method

Insert a category in the database
public static insertCategory ( array $item, array $meta = null ) : integer
$item array
$meta array The metadata for the category to insert.
return integer

update() public static method

Update a certain question
public static update ( array $item )
$item array

updateCategory() public static method

Update a certain category
public static updateCategory ( array $item )
$item array