| Package: machii_info_sample.controllers |
| Inherits from: MachII.framework.Listener |
| I am the listener for categories |
| Method Summary | |
|---|---|
| public void |
configure()
I initialize this listener as part of the framework startup. |
| public void |
createCategory(Event event)
I cause a Category to be created from the current event object. |
| public void |
deleteCategory(Event event)
I cause a Category to be deleted. |
| public query |
getAll()
I return a query containing all of the faqs. |
| public category |
getCategoryById(Event event)
I return a query containing a single Category identified by it's ID |
| public void |
updateCategory(Event event)
I cause a Category to be updated from the current event object. |
| Method Detail |
|---|
| configure |
|---|
public void configure( )
I initialize this listener as part of the framework startup.
Parameters:
Code:
<cffunction name="configure" access="public" returntype="void" output="true" displayname="Listener Constructor" hint="I initialize this listener as part of the framework startup.">
<cfscript>
var appConstants = getAppManager().getPropertyManager().getProperty("appConstants");
var dsn = appConstants.getDsn();
var dbType = appConstants.getDbType();
variables.categoryGateway = createObject("component","machii_info_sample.model.category.categoryGateway").init(dsn);
variables.categoryDAO = CreateObject("component", "machii_info_sample.model.dao.DAOFactory").init(dsn, "machii_info").getDAOFactory(dbType).getCategoryDAO();
</cfscript>
</cffunction>
| createCategory |
|---|
public void createCategory( Event event )
I cause a Category to be created from the current event object.
Parameters:
| Event event |
Code:
<cffunction name="createCategory" access="public" returntype="void" output="false" displayname="Create Category" hint="I cause a Category to be created from the current event object.">
<cfargument name="event" type="MachII.framework.Event" required="yes" displayname="Event" hint="I am the current event" />
<cfset var category = arguments.event.getArg("category") />
<cfset variables.categoryDAO.create(category) />
</cffunction>
| deleteCategory |
|---|
public void deleteCategory( Event event )
I cause a Category to be deleted.
Parameters:
| Event event |
Code:
<cffunction name="deleteCategory" access="public" returntype="void" output="true" displayname="Delete Category" hint="I cause a Category to be deleted.">
<cfargument name="event" type="MachII.framework.Event" required="yes" displayname="Event" hint="I am the current event" />
<cfset var category = arguments.event.getArg("category") />
<cfset variables.categoryDAO.delete(category) />
</cffunction>
| getAll |
|---|
public query getAll( )
I return a query containing all of the faqs.
Parameters:
Code:
<cffunction name="getAll" access="public" returntype="query" output="false" displayname="Get All Categorys" hint="I return a query containing all of the faqs."> <cfreturn variables.categoryGateway.findAll() /> </cffunction>
| getCategoryById |
|---|
public category getCategoryById( Event event )
I return a query containing a single Category identified by it's ID
Parameters:
| Event event |
Code:
<cffunction name="getCategoryById" access="public" returntype="machii_info_sample.model.category.category" output="false" displayname="Get Category By ID" hint="I return a query containing a single Category identified by it's ID">
<cfargument name="event" type="MachII.framework.Event" required="yes" displayname="Event" hint="I am the current event, containing an ID field that identifies an Category." />
<cfset var categoryid = arguments.event.getArg("categoryid") />
<cfset var category = createObject("component","machii_info_sample.model.category.category").init() />
<cfset variables.categoryDAO.read(category,categoryid) />
<cfreturn category />
</cffunction>
| updateCategory |
|---|
public void updateCategory( Event event )
I cause a Category to be updated from the current event object.
Parameters:
| Event event |
Code:
<cffunction name="updateCategory" access="public" returntype="void" output="true" displayname="Update Category" hint="I cause a Category to be updated from the current event object.">
<cfargument name="event" type="MachII.framework.Event" required="yes" displayname="Event" hint="I am the current event" />
<cfset var category = arguments.event.getArg("category") />
<cfset variables.categoryDAO.update(category) />
</cffunction>