JsonNewsController
extends Controller
in package
implements
JsonAdapter
JsonNewsController Json controller for news module
Tags
Table of Contents
Interfaces
- JsonAdapter
- JSON Adapter for JSON requests
Properties
Methods
- __call() : mixed
- Route methods like getName(), getType(), getDirectory(), etc.
- __construct() : mixed
- Creates new controller
- getAccessableMethods() : array<string|int, mixed>
- Returns an array of method names accessable from a JSON request
- getDefaultPermissions() : object
- Returns default permission as object
- getMessagesAsString() : string
- Returns all messages as string
- getName() : string
- Returns the internal name used as identifier for this adapter
- getNews() : json
- get all news list
- getSystemComponentController() : SystemComponentController
- Returns the main controller
- switchCategoryVisibility() : string
- Switch the visibility state of a category
Properties
$cx
Main class instance
protected
Cx
$cx
= null
Methods
__call()
Route methods like getName(), getType(), getDirectory(), etc.
public
__call(string $methodName, array<string|int, mixed> $arguments) : mixed
Parameters
- $methodName : string
-
Name of method to call
- $arguments : array<string|int, mixed>
-
List of arguments for the method to call
Attributes
- #[ReturnTypeWillChange]
Return values
mixed —Return value of the method to call
__construct()
Creates new controller
public
__construct(SystemComponentController $systemComponentController, Cx $cx) : mixed
Parameters
- $systemComponentController : SystemComponentController
-
Main controller for this system component
- $cx : Cx
-
Main class instance
getAccessableMethods()
Returns an array of method names accessable from a JSON request
public
getAccessableMethods() : array<string|int, mixed>
Return values
array<string|int, mixed> —List of method names
getDefaultPermissions()
Returns default permission as object
public
getDefaultPermissions() : object
Return values
objectgetMessagesAsString()
Returns all messages as string
public
getMessagesAsString() : string
Return values
string —HTML encoded error messages
getName()
Returns the internal name used as identifier for this adapter
public
getName() : string
Return values
string —Name of this adapter
getNews()
get all news list
public
getNews([mixed $data = array() ]) : json
Parameters
- $data : mixed = array()
Return values
json —result
getSystemComponentController()
Returns the main controller
public
getSystemComponentController() : SystemComponentController
Return values
SystemComponentController —Main controller for this system component
switchCategoryVisibility()
Switch the visibility state of a category
public
switchCategoryVisibility(array<string|int, mixed> $params) : string
Parameters
- $params : array<string|int, mixed>
-
JsonData arguments
Return values
string —New visibility state of category, fetched from database. Returns "1" if category is visible, otherwise "0".