Difference between revisions of "Core"

From PunchCMS
Jump to: navigation, search
Line 3: Line 3:
 
==== [[Core/singleton|PCMS_Client::singleton(dsn, account, basePath)]] ====
 
==== [[Core/singleton|PCMS_Client::singleton(dsn, account, basePath)]] ====
 
Instansiate the singleton class. This is done only once during the execution of a page.
 
Instansiate the singleton class. This is done only once during the execution of a page.
==== [[Core/getinstance|PCMS_Client::getInstance()]] ====
+
==== [[Core/getInstance|PCMS_Client::getInstance()]] ====
 
Get the CMS object instance. This way you don't have to work with a global CMS object.
 
Get the CMS object instance. This way you don't have to work with a global CMS object.
 
=== SpinCMS Methods ===
 
=== SpinCMS Methods ===
 
==== [[Core/get|get([elementApiName], [recursive])]] ====
 
==== [[Core/get|get([elementApiName], [recursive])]] ====
 
Get the first element or folder with an optional specific api name from the root folder.
 
Get the first element or folder with an optional specific api name from the root folder.
==== [[Core/getelements|getElements([elementApiName], [getFirst], [recursive])]] ====
+
==== [[Core/getElements|getElements([elementApiName], [getFirst], [recursive])]] ====
 
Get a collection of elements and folders with an optional specific api name from the root folder.
 
Get a collection of elements and folders with an optional specific api name from the root folder.
==== [[Core/getfolders|getFolders([elementApiName], [getFirst]) ====
+
==== [[Core/getFolders|getFolders([elementApiName], [getFirst]) ====
 
Get a collection of folders with an optional specific api name from the root folder.
 
Get a collection of folders with an optional specific api name from the root folder.
==== [[Core/getelementbyid|getElementById(elementId)]] ====
+
==== [[Core/getElementById|getElementById(elementId)]] ====
 
Get an element or folder with a specific id from the CMS. If not found it will return NULL.
 
Get an element or folder with a specific id from the CMS. If not found it will return NULL.
==== getFieldById (elementFieldId) ====
+
==== [[Core/getFieldById|getFieldById(elementFieldId)]] ====
Get a field with a specific id from the CMS.\\
+
Get a field with a specific id from the CMS.
**[[Core/getfieldbyid|Details]]**
+
==== [[Core/getElementByTemplate|getElementByTemplate(templateApiName, [recursive], [random])]] ====
==== getElementByTemplate (templateApiName, [recursive], [random]) ====
+
Get the first element with a specific template api name from the root folder.
Get the first element with a specific template api name from the root folder.\\
+
==== [[Core/getElementsByTemplate|getElementsByTemplate(templateApiName, [getFirst], [recursive], [random])]] ====
**[[Core/getelementbytemplate|Details]]**
+
Get a collection of elements with a specific template api name from the root folder.
==== getElementsByTemplate (templateApiName, [getFirst], [recursive], [random]) ====
+
==== [[Core/getElementByTemplateId|getElementByTemplateId(templateId, [recursive], [random])]] ====
Get a collection of elements with a specific template api name from the root folder.\\
+
Get the first element with a specific template id from the root folder.
**[[Core/getelementsbytemplate|Details]]**
+
==== [[Core/getElementsByTemplateId|getElementsByTemplateId(templateId, [getFirst], [recursive], [random])]] ====
==== getElementByTemplateId (templateId, [recursive], [random]) ====
+
Get a collection of elements with a specific template id from the root folder.
Get the first element with a specific template id from the root folder.\\
+
==== [[Core/getElementsFromParent|getElementsFromParent(elementId, [getFirst], [recursive])]] ====
**[[Core/getelementbytemplateid|Details]]**
+
Get a list of elements with a specific parent id.
==== getElementsByTemplateId (templateId, [getFirst], [recursive], [random]) ====
+
==== [[Core/getAliasId|getAliasId()]] ====
Get a collection of elements with a specific template id from the root folder.\\
+
Get the element id converted from the curent URL alias.
**[[Core/getelementsbytemplateid|Details]]**
+
==== [[Core/find|find(query, filters, [exact], [arrAllowedTypes])]] ====
==== getElementsFromParent (elementId, [getFirst], [recursive]) ====
+
Search through the CMS using a query and optional filters.
Get a list of elements with a specific parent id.\\
+
==== [[Core/getLanguages|getLanguages()]] ====
**[[Core/getelementsfromparent|Details]]**
+
Get a collection of all active languages.
==== getAliasId () ====
+
==== [[Core/getLanguage|getLanguage()]] ====
Get the element id converted from the curent URL alias.\\
+
Get the currently active language.
**[[Core/getaliasid|Details]]**
+
==== [[Core/getBasePath|getBasePath()]] ====
==== find (query, filters, [exact], [arrAllowedTypes]) ====
+
Get the base path to the website.
Search through the CMS using a query and optional filters.\\
+
==== [[Core/setBasePath|setBasePath(value)]] ====
**[[Core/find|Details]]**
+
Set the base path of the website. This overrides the value from the singleton method.
==== getLanguages () ====
+
==== [[Core/getFilePath|getFilePath()]] ====
Get a collection of all active languages.\\
+
Get the base path to files uploaded by the CMS.
**[[Core/getlanguages|Details]]**
+
==== [[Core/getDownloadPath|getDownloadPath()]] ====
==== getLanguage () ====
+
Get the base path to files uploaded by the CMS relative to the website path.
Get the currently active language.\\
+
==== [[Core/getFromCache|getFromCache(method, elementId, [arguments]) ====
**[[Core/getlanguage|Details]]**
+
Get the output of a method from the cache. If output doesn't exist is will call the method, cache and return the output.
==== getBasePath () ====
+
==== [[Core/getSetting|getSetting(value)]] ====
Get the base path to the website.\\
+
Get the value of a setting in the CMS.
**[[Core/getbasepath|Details]]**
+
==== [[Core/useAliases|useAliases(value)]] ====
==== setBasePath (value) ====
+
Set wether aliases should be used or not. Using aliases has a slight performance impact.
Set the base path of the website. This overrides the value from the singleton method.\\
+
==== [[Core/setDbConnection|setDbConnection([reInit])]] ====
**[[Core/setbasepath|Details]]**
+
This method forces a reset on the internal database connection object.
==== getFilePath () ====
+
Get the base path to files uploaded by the CMS.\\
+
**[[Core/getfilepath|Details]]**
+
==== getDownloadPath () ====
+
Get the base path to files uploaded by the CMS relative to the website path.\\
+
**[[Core/getdownloadpath|Details]]**
+
==== getFromCache (method, elementId, [arguments]) ====
+
Get the output of a method from the cache. If output doesn't exist is will call the method, cache and return the output.\\
+
**[[Core/getfromcache|Details]]**
+
==== getSetting (value) ====
+
Get the value of a setting in the CMS.\\
+
**[[Core/getsetting|Details]]**
+
==== useAliases (value) ====
+
Set wether aliases should be used or not. Using aliases has a slight performance impact.\\
+
**[[Core/usealiases|Details]]**
+
==== setDbConnection ([reInit]) ====
+
This method forces a reset on the internal database connection object.\\
+
**[[Core/setdbconnection|Details]]**
+

Revision as of 00:00, 24 December 2008

SpinCMS Instansiation

PCMS_Client::singleton(dsn, account, basePath)

Instansiate the singleton class. This is done only once during the execution of a page.

PCMS_Client::getInstance()

Get the CMS object instance. This way you don't have to work with a global CMS object.

SpinCMS Methods

get([elementApiName], [recursive])

Get the first element or folder with an optional specific api name from the root folder.

getElements([elementApiName], [getFirst], [recursive])

Get a collection of elements and folders with an optional specific api name from the root folder.

[[Core/getFolders|getFolders([elementApiName], [getFirst])

Get a collection of folders with an optional specific api name from the root folder.

getElementById(elementId)

Get an element or folder with a specific id from the CMS. If not found it will return NULL.

getFieldById(elementFieldId)

Get a field with a specific id from the CMS.

getElementByTemplate(templateApiName, [recursive], [random])

Get the first element with a specific template api name from the root folder.

getElementsByTemplate(templateApiName, [getFirst], [recursive], [random])

Get a collection of elements with a specific template api name from the root folder.

getElementByTemplateId(templateId, [recursive], [random])

Get the first element with a specific template id from the root folder.

getElementsByTemplateId(templateId, [getFirst], [recursive], [random])

Get a collection of elements with a specific template id from the root folder.

getElementsFromParent(elementId, [getFirst], [recursive])

Get a list of elements with a specific parent id.

getAliasId()

Get the element id converted from the curent URL alias.

find(query, filters, [exact], [arrAllowedTypes])

Search through the CMS using a query and optional filters.

getLanguages()

Get a collection of all active languages.

getLanguage()

Get the currently active language.

getBasePath()

Get the base path to the website.

setBasePath(value)

Set the base path of the website. This overrides the value from the singleton method.

getFilePath()

Get the base path to files uploaded by the CMS.

getDownloadPath()

Get the base path to files uploaded by the CMS relative to the website path.

[[Core/getFromCache|getFromCache(method, elementId, [arguments])

Get the output of a method from the cache. If output doesn't exist is will call the method, cache and return the output.

getSetting(value)

Get the value of a setting in the CMS.

useAliases(value)

Set wether aliases should be used or not. Using aliases has a slight performance impact.

setDbConnection([reInit])

This method forces a reset on the internal database connection object.