Difference between revisions of "Core"
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
− | === SpinCMS Instansiation === | + | ==== SpinCMS Instansiation ==== |
− | + | === [[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()]] === | |
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 ==== |
− | + | === 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/get|Details]]** | **[[Core/get|Details]]** | ||
− | + | === 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/getelements|Details]]** | **[[Core/getelements|Details]]** | ||
− | + | === 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/getfolders|Details]]** | **[[Core/getfolders|Details]]** | ||
− | + | === 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.\\ | ||
**[[Core/getelementbyid|Details]]** | **[[Core/getelementbyid|Details]]** | ||
− | + | === 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/getfieldbyid|Details]]** | ||
− | + | === 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/getelementbytemplate|Details]]** | **[[Core/getelementbytemplate|Details]]** | ||
− | + | === getElementsByTemplate (templateApiName, [getFirst], [recursive], [random]) === | |
Get a collection of elements with a specific template api name from the root folder.\\ | Get a collection of elements with a specific template api name from the root folder.\\ | ||
**[[Core/getelementsbytemplate|Details]]** | **[[Core/getelementsbytemplate|Details]]** | ||
− | + | === getElementByTemplateId (templateId, [recursive], [random]) === | |
Get the first element with a specific template id from the root folder.\\ | Get the first element with a specific template id from the root folder.\\ | ||
**[[Core/getelementbytemplateid|Details]]** | **[[Core/getelementbytemplateid|Details]]** | ||
− | + | === getElementsByTemplateId (templateId, [getFirst], [recursive], [random]) === | |
Get a collection of elements with a specific template id from the root folder.\\ | Get a collection of elements with a specific template id from the root folder.\\ | ||
**[[Core/getelementsbytemplateid|Details]]** | **[[Core/getelementsbytemplateid|Details]]** | ||
− | + | === getElementsFromParent (elementId, [getFirst], [recursive]) === | |
Get a list of elements with a specific parent id.\\ | Get a list of elements with a specific parent id.\\ | ||
**[[Core/getelementsfromparent|Details]]** | **[[Core/getelementsfromparent|Details]]** | ||
− | + | === getAliasId () === | |
Get the element id converted from the curent URL alias.\\ | Get the element id converted from the curent URL alias.\\ | ||
**[[Core/getaliasid|Details]]** | **[[Core/getaliasid|Details]]** | ||
− | + | === find (query, filters, [exact], [arrAllowedTypes]) === | |
Search through the CMS using a query and optional filters.\\ | Search through the CMS using a query and optional filters.\\ | ||
**[[Core/find|Details]]** | **[[Core/find|Details]]** | ||
− | + | === getLanguages () === | |
Get a collection of all active languages.\\ | Get a collection of all active languages.\\ | ||
**[[Core/getlanguages|Details]]** | **[[Core/getlanguages|Details]]** | ||
− | + | === getLanguage () === | |
Get the currently active language.\\ | Get the currently active language.\\ | ||
**[[Core/getlanguage|Details]]** | **[[Core/getlanguage|Details]]** | ||
− | + | === getBasePath () === | |
Get the base path to the website.\\ | Get the base path to the website.\\ | ||
**[[Core/getbasepath|Details]]** | **[[Core/getbasepath|Details]]** | ||
− | + | === setBasePath (value) === | |
Set the base path of the website. This overrides the value from the singleton method.\\ | Set the base path of the website. This overrides the value from the singleton method.\\ | ||
**[[Core/setbasepath|Details]]** | **[[Core/setbasepath|Details]]** | ||
− | + | === getFilePath () === | |
Get the base path to files uploaded by the CMS.\\ | Get the base path to files uploaded by the CMS.\\ | ||
**[[Core/getfilepath|Details]]** | **[[Core/getfilepath|Details]]** | ||
− | + | === getDownloadPath () === | |
Get the base path to files uploaded by the CMS relative to the website path.\\ | Get the base path to files uploaded by the CMS relative to the website path.\\ | ||
**[[Core/getdownloadpath|Details]]** | **[[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.\\ | 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]]** | **[[Core/getfromcache|Details]]** | ||
− | + | === getSetting (value) === | |
Get the value of a setting in the CMS.\\ | Get the value of a setting in the CMS.\\ | ||
**[[Core/getsetting|Details]]** | **[[Core/getsetting|Details]]** | ||
− | + | === useAliases (value) === | |
Set wether aliases should be used or not. Using aliases has a slight performance impact.\\ | Set wether aliases should be used or not. Using aliases has a slight performance impact.\\ | ||
**[[Core/usealiases|Details]]** | **[[Core/usealiases|Details]]** | ||
− | + | === setDbConnection ([reInit]) === | |
This method forces a reset on the internal database connection object.\\ | This method forces a reset on the internal database connection object.\\ | ||
**[[Core/setdbconnection|Details]]** | **[[Core/setdbconnection|Details]]** |
Revision as of 23:46, 23 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.\\
- Details**
getElements ([elementApiName], [getFirst], [recursive])
Get a collection of elements and folders with an optional specific api name from the root folder.\\
- Details**
getFolders ([elementApiName], [getFirst])
Get a collection of folders with an optional specific api name from the root folder.\\
- Details**
getElementById (elementId)
Get an element or folder with a specific id from the CMS. If not found it will return NULL.\\
- Details**
getFieldById (elementFieldId)
Get a field with a specific id from the CMS.\\
- Details**
getElementByTemplate (templateApiName, [recursive], [random])
Get the first element with a specific template api name from the root folder.\\
- Details**
getElementsByTemplate (templateApiName, [getFirst], [recursive], [random])
Get a collection of elements with a specific template api name from the root folder.\\
- Details**
getElementByTemplateId (templateId, [recursive], [random])
Get the first element with a specific template id from the root folder.\\
- Details**
getElementsByTemplateId (templateId, [getFirst], [recursive], [random])
Get a collection of elements with a specific template id from the root folder.\\
- Details**
getElementsFromParent (elementId, [getFirst], [recursive])
Get a list of elements with a specific parent id.\\
- Details**
getAliasId ()
Get the element id converted from the curent URL alias.\\
- Details**
find (query, filters, [exact], [arrAllowedTypes])
Search through the CMS using a query and optional filters.\\
- Details**
getLanguages ()
Get a collection of all active languages.\\
- Details**
getLanguage ()
Get the currently active language.\\
- Details**
getBasePath ()
Get the base path to the website.\\
- Details**
setBasePath (value)
Set the base path of the website. This overrides the value from the singleton method.\\
- Details**
getFilePath ()
Get the base path to files uploaded by the CMS.\\
- Details**
getDownloadPath ()
Get the base path to files uploaded by the CMS relative to the website path.\\
- 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.\\
- Details**
getSetting (value)
Get the value of a setting in the CMS.\\
- Details**
useAliases (value)
Set wether aliases should be used or not. Using aliases has a slight performance impact.\\
- Details**
setDbConnection ([reInit])
This method forces a reset on the internal database connection object.\\
- Details**