"id", "sName" => "name", "sHumanName" => "human_name", "iStartStateId" => "start_state_id", 'bEnabled' => 'enabled', ); var $_bUsePearError = true; function getID() { return $this->iId; } function getName() { return sanitizeForSQLtoHTML($this->sName); } function getHumanName() { return sanitizeForSQLtoHTML($this->sHumanName); } function getStartStateId() { return $this->iStartStateId; } function getIsEnabled() { return ($this->bEnabled == true); } function setID($iId) { $this->iId = $iId; } function setName($sName) { $this->sName = sanitizeForSQL($sName); } function setHumanName($sHumanName) { $this->sHumanName = sanitizeForSQL($sHumanName); } function setStartStateId($iStartStateId) { $this->iStartStateId = $iStartStateId; } function setIsEnabled($mValue) { $this->bEnabled = ($mValue == true); } function _table () { return KTUtil::getTableName('workflows'); } function _ktentityOptions() { return array( 'orderby' => 'human_name', ); } // STATIC function &get($iId) { return KTEntityUtil::get('KTWorkflow', $iId); } // STATIC function &createFromArray($aOptions) { return KTEntityUtil::createFromArray('KTWorkflow', $aOptions); } // STATIC function &getList($sWhereClause = null) { return KTEntityUtil::getList2('KTWorkflow', $sWhereClause); } // STATIC function &getByName($sName) { return KTEntityUtil::getBy('KTWorkflow', 'name', $sName); } function getIsFunctional() { return (($this->getStartStateId() != false) && ($this->getIsEnabled())); } // STATIC function &getFunctional() { return KTEntityUtil::getList2('KTWorkflow', 'start_state_id IS NOT NULL AND enabled = 1'); } function &getByDocument($oDocument) { $oDocument = KTUtil::getObject('Document', $oDocument); $iWorkflowId = $oDocument->getWorkflowId(); if (PEAR::isError($iWorkflowId)) { return $iWorkflowId; } if (is_null($iWorkflowId)) { return $iWorkflowId; } return KTWorkflow::get($iWorkflowId); } } ?>