X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FState.php;h=afedce9c7be7c6e9c8525afa1a3a9fa34e04604e;hb=172a3c1961127d07ce1c5d40a540272c16e6b2b4;hp=88b4a593437d6ab2f30386be3fce668d84dfec5f;hpb=718e934e2c6fa496ee84f56502d73cae125b1331;p=civicrm-core.git diff --git a/CRM/Core/State.php b/CRM/Core/State.php index 88b4a59343..afedce9c7b 100644 --- a/CRM/Core/State.php +++ b/CRM/Core/State.php @@ -3,7 +3,7 @@ +--------------------------------------------------------------------+ | CiviCRM version 4.6 | +--------------------------------------------------------------------+ - | Copyright CiviCRM LLC (c) 2004-2014 | + | Copyright CiviCRM LLC (c) 2004-2015 | +--------------------------------------------------------------------+ | This file is a part of CiviCRM. | | | @@ -23,7 +23,7 @@ | GNU Affero General Public License or the licensing of CiviCRM, | | see the CiviCRM license FAQ at http://civicrm.org/licensing | +--------------------------------------------------------------------+ -*/ + */ /** * The basic state element. Each state element is linked to a form and @@ -32,14 +32,14 @@ * things like going back / stepping forward / process etc * * @package CRM - * @copyright CiviCRM LLC (c) 2004-2014 + * @copyright CiviCRM LLC (c) 2004-2015 * $Id$ * */ class CRM_Core_State { /** - * State name + * State name. * @var string */ protected $_name; @@ -51,19 +51,19 @@ class CRM_Core_State { protected $_type; /** - * The state that precedes this state + * The state that precedes this state. * @var CRM_Core_State */ protected $_back; /** - * The state that succeeds this state + * The state that succeeds this state. * @var CRM_Core_State */ protected $_next; /** - * The state machine that this state is part of + * The state machine that this state is part of. * @var CRM_Core_StateMachine */ protected $_stateMachine; @@ -74,21 +74,25 @@ class CRM_Core_State { * bring in more complexity to the framework. For now, lets keep it simple * @var int */ - CONST START = 1, FINISH = 2, SIMPLE = 4; + const START = 1, FINISH = 2, SIMPLE = 4; /** - * Constructor + * Constructor. * - * @param string $name internal name of the state - * @param int $type state type - * @param CRM_Core_State $back state that precedes this state - * @param CRM_Core_State $next state that follows this state - * @param CRM_Core_StateMachine $stateMachine statemachine that this states belongs to + * @param string $name + * Internal name of the state. + * @param int $type + * State type. + * @param CRM_Core_State $back + * State that precedes this state. + * @param CRM_Core_State $next + * State that follows this state. + * @param CRM_Core_StateMachine $stateMachine + * Statemachine that this states belongs to. * * @return CRM_Core_State - * @access public */ - function __construct($name, $type, $back, $next, &$stateMachine) { + public function __construct($name, $type, $back, $next, &$stateMachine) { $this->_name = $name; $this->_type = $type; $this->_back = $back; @@ -97,19 +101,17 @@ class CRM_Core_State { $this->_stateMachine = &$stateMachine; } - function debugPrint() { + public function debugPrint() { CRM_Core_Error::debug("{$this->_name}, {$this->_type}", "{$this->_back}, {$this->_next}"); } /** * Given an CRM Form, jump to the previous page * - * @param object the CRM_Core_Form element under consideration - * - * @return mixed does a jump to the back state - * @access public + * @return mixed + * does a jump to the back state */ - function handleBackState(&$page) { + public function handleBackState(&$page) { if ($this->_type & self::START) { $page->handle('display'); } @@ -122,12 +124,10 @@ class CRM_Core_State { /** * Given an CRM Form, jump to the next page * - * @param object the CRM_Core_Form element under consideration - * - * @return mixed does a jump to the nextstate - * @access public + * @return mixed + * does a jump to the nextstate */ - function handleNextState(&$page) { + public function handleNextState(&$page) { if ($this->_type & self::FINISH) { $page->handle('process'); } @@ -142,9 +142,8 @@ class CRM_Core_State { * to display the navigation labels or potential path * * @return string - * @access public */ - function getNextState() { + public function getNextState() { if ($this->_type & self::FINISH) { return NULL; } @@ -158,12 +157,9 @@ class CRM_Core_State { * Mark this page as valid for the QFC framework. This is needed as * we build more advanced functionality into the StateMachine * - * @param object the QFC data container - * * @return void - * @access public */ - function validate(&$data) { + public function validate(&$data) { $data['valid'][$this->_name] = TRUE; } @@ -171,45 +167,37 @@ class CRM_Core_State { * Mark this page as invalid for the QFC framework. This is needed as * we build more advanced functionality into the StateMachine * - * @param object the QFC data container - * * @return void - * @access public */ - function invalidate(&$data) { + public function invalidate(&$data) { $data['valid'][$this->_name] = NULL; } /** - * Getter for name + * Getter for name. * * @return string - * @access public */ - function getName() { + public function getName() { return $this->_name; } /** - * Setter for name - * - * @param string + * Setter for name. * * @return void - * @access public */ - function setName($name) { + public function setName($name) { $this->_name = $name; } /** - * Getter for type + * Getter for type. * * @return int - * @access public */ - function getType() { + public function getType() { return $this->_type; } -} +}