Class CMS_resource

Description

Class CMS_resource

represent a resource. Can be either a page or a module resource.

Located in /automne/classes/workflow/resource.php (line 29)

CMS_grandFather
   |
   --CMS_resource
Direct descendents
Class Description
 class CMS_superResource General-purpose Class
 class CMS_resource_cms_aliases Class CMS_resource_cms_aliases
 class CMS_poly_object Class CMS_poly_object
 class CMS_page Class CMS_page
Class Constant Summary
Method Summary
 void CMS_resource ([integer $id = 0])
 boolean addEdition (integer $edition, CMS_profile_user &$user)
 boolean addValidationRefused (integer $edition)
 void destroy ()
 array(integer) getAllDataLocations ()
 array(integer=>integer) getAllLinkTypes ()
 array(CMS_profile_user) getEditors ([integer $edition = false])
 integer getID ()
 integer getLocation ()
 integer getLock ()
 integer getLockDate ()
 integer getProposedLocation ()
 integer getPublication ()
 CMS_date getPublicationDateEnd ([ $public = true])
 CMS_date getPublicationDateStart ([ $public = true])
 boolean lock ( &$user, CMS_profile_user $user)
 boolean setProposedLocation (integer $location, CMS_profile_user &$user)
 boolean setPublicationDates (CMS_date $start, CMS_date $end)
 void unlock ()
 boolean validateEdition (integer $edition)
 boolean writeToPersistence ()
Methods
Constructor CMS_resource (line 65)

Constructor.

initializes the resource if the id is given

  • access: public
void CMS_resource ([integer $id = 0])
  • integer $id: DB id
addEdition (line 214)

Add an edition.

  • return: true on success, false on failure.
  • access: public
boolean addEdition (integer $edition, CMS_profile_user &$user)
  • integer $edition: the edition to add
  • CMS_profile_user &$user: the user who did the edition
addValidationRefused (line 256)

Add an edition to the validation refused

  • return: true on success, false on failure.
  • access: public
boolean addValidationRefused (integer $edition)
  • integer $edition: the edition to add
cancelAllEditions (line 292)

Cancel all the editions on the resource

  • access: public
void cancelAllEditions ()
destroy (line 491)

Totally destroys the resource from persistence. Also destroys the status.

  • access: public
void destroy ()

Redefined in descendants as:
getAllDataLocations (line 569)

Returns an array of all the available resource data locations Static function

  • return: The Data locations
  • access: public
array(integer) getAllDataLocations ()
getAllLinkTypes (line 554)

Returns an array of all the available link types Static function

  • return: The link types indexed by their translation messages DB ID
  • access: public
array(integer=>integer) getAllLinkTypes ()
getEditors (line 305)

Get the editors for an edition, or all the editors if no edition given.

  • return: The users, or an empty array if none found
  • access: public
array(CMS_profile_user) getEditors ([integer $edition = false])
  • integer $edition: We want the editors that edited this edition, or all if it's set to false
getEditorsStack (line 329)

Get the editors stack

  • return: The users stack
  • access: public
CMS_stack getEditorsStack ()
getID (line 129)

Gets the DB ID of the instance.

  • return: the DB id
  • access: public
integer getID ()

Redefined in descendants as:
getLocation (line 362)

Get the resource location

  • return: the resource location
  • access: public
integer getLocation ()
getLock (line 140)

Gets the locksmith data of a lock placed on the resource.

  • return: the locksmithData : DB ID of the user who placed the lock
  • access: public
integer getLock ()
getLockDate (line 155)

Gets the locksmith data of a lock placed on the resource.

  • return: the locksmithData : DB ID of the user who placed the lock
  • access: public
integer getLockDate ()
getProposedLocation (line 373)

Gets the proposedFor location

  • return: the location
  • access: public
integer getProposedLocation ()
getPublication (line 351)

Get the resource publication status

  • return: the resource publication
  • access: public
integer getPublication ()
getPublicationDateEnd (line 480)

Gets the publication date end.

  • return: the publication date end.
  • access: public
CMS_date getPublicationDateEnd ([ $public = true])
  • $public
getPublicationDateStart (line 469)

Gets the publication date start.

  • return: the publication date start.
  • access: public
CMS_date getPublicationDateStart ([ $public = true])
  • $public
getStatus (line 201)

Gets the status

  • return: The resource status
  • access: public
CMS_resourceStatus getStatus ()

Redefined in descendants as:
isProposedForOutsideUserspace (line 443)

Does the resource has a proposed location outside of userspace ?

  • return: true if the resource may move out of user space soon (proposedFor attribute)
  • access: public
boolean isProposedForOutsideUserspace ()
lock (line 171)

Locks the page. Takes the user DB ID and place it as locksmith data. Impossible if resource is already locked.

  • return: true on success, false on failure.
  • access: public
boolean lock ( &$user, CMS_profile_user $user)
removeProposedLocation (line 410)

Remove the proposed location. Also removes the editors who proposed the location.

  • return: true on success, false on failure
  • access: public
boolean removeProposedLocation ()
resetEditorsStack (line 340)

Resets the editors stack to an empty stack

  • access: public
void resetEditorsStack ()
setProposedLocation (line 386)

Set the proposedFor location of the resource. Also add the editor who proposed the location.

  • return: true on success, false on failure
  • access: public
boolean setProposedLocation (integer $location, CMS_profile_user &$user)
  • integer $location: the location to set
  • CMS_profile_user &$user: the user who did the edition
setPublicationDates (line 457)

Set the publication dates of the resource.

  • return: true on success, false on failure
  • access: public
boolean setPublicationDates (CMS_date $start, CMS_date $end)
  • CMS_date $start: the publication start to set
  • CMS_date $end: the publication end to set
unlock (line 186)

Unlocks the page. No checks done here.

  • access: public
void unlock ()
validateEdition (line 272)

Validates an edition. Sets the status as validated if it's a content validation.

  • return: true on success, false on failure.
  • access: public
boolean validateEdition (integer $edition)
  • integer $edition: the edition to validate

Redefined in descendants as:
  • CMS_page::validateEdition() : Validates an edition. Adds the publishing of siblings orders to the parent function, and the setting of reminded editors
validateProposedLocation (line 429)

Validate the location proposition of the resource (proposedFor attribute).

  • access: public
void validateProposedLocation ()

Redefined in descendants as:
writeToPersistence (line 515)

Writes the resource into persistence (MySQL for now).

  • return: true on success, false on failure
  • access: public
boolean writeToPersistence ()

Redefined in descendants as:

Inherited Methods

Inherited From CMS_grandFather

 CMS_grandFather::autoload()
 CMS_grandFather::hasError()
 CMS_grandFather::log()
 CMS_grandFather::PHPErrorHandler()
 CMS_grandFather::raiseError()
 CMS_grandFather::setDebug()
 CMS_grandFather::setLog()
 CMS_grandFather::_raiseError()
 CMS_grandFather::__call()
Class Constants
MESSAGE_RESOURCE_LINK_TYPE_EXTERNAL = 210 (line 33)
MESSAGE_RESOURCE_LINK_TYPE_FILE = 191 (line 34)
MESSAGE_RESOURCE_LINK_TYPE_INTERNAL = 209 (line 32)
MESSAGE_RESOURCE_LINK_TYPE_NONE = 208 (line 31)

Inherited Constants

Inherited from CMS_grandFather

CMS_grandFather::ERROR_LOG
CMS_grandFather::SYSTEM_LABEL

Documentation generated on Wed, 15 Feb 2012 15:38:19 +0100 by phpDocumentor 1.4.3