Adicion de documentacio y arreglo seteando array para evitar warning

This commit is contained in:
Brayan Osmar Pereyra Suxo
2013-12-13 11:21:11 -04:00
parent 2e846d1474
commit 29ce12eb32
2 changed files with 57 additions and 8 deletions

View File

@@ -82,10 +82,14 @@ class Trigger
/** /**
* List of Triggers in process * List of Triggers in process
* @var string $sProcessUID. Uid for Process
* *
* return array * @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
* @copyright Colosa - Bolivia
*
* @return array
*/ */
public function getTriggersCriteria($sProcessUID = '') public function getTriggers($sProcessUID = '')
{ {
$criteria = $this->getTriggerCriteria(); $criteria = $this->getTriggerCriteria();
@@ -96,7 +100,7 @@ class Trigger
$oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC); $oDataset->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
$oDataset->next(); $oDataset->next();
$triggersArray = ""; $triggersArray = array();
//$triggersArray[] = array('TRI_UID' => 'char', 'PRO_UID' => 'char', 'TRI_TITLE' => 'char', 'TRI_DESCRIPTION' => 'char'); //$triggersArray[] = array('TRI_UID' => 'char', 'PRO_UID' => 'char', 'TRI_TITLE' => 'char', 'TRI_DESCRIPTION' => 'char');
while ($aRow = $oDataset->getRow()) { while ($aRow = $oDataset->getRow()) {
if (($aRow['TRI_TITLE'] == null) || ($aRow['TRI_TITLE'] == "")) { if (($aRow['TRI_TITLE'] == null) || ($aRow['TRI_TITLE'] == "")) {
@@ -114,8 +118,12 @@ class Trigger
/** /**
* Get data for TriggerUid * Get data for TriggerUid
* @var string $sTriggerUID. Uid for Trigger
* *
* return array * @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
* @copyright Colosa - Bolivia
*
* @return array
*/ */
public function getDataTrigger($sTriggerUID = '') public function getDataTrigger($sTriggerUID = '')
{ {
@@ -131,7 +139,12 @@ class Trigger
/** /**
* Delete Trigger * Delete Trigger
* @var string $sTriggerUID. Uid for Trigger
* *
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
* @copyright Colosa - Bolivia
*
* @return void
*/ */
public function deleteTrigger($sTriggerUID = '') public function deleteTrigger($sTriggerUID = '')
{ {
@@ -145,7 +158,15 @@ class Trigger
/** /**
* Save Data for Trigger * Save Data for Trigger
* @var string $sProcessUID. Uid for Process
* @var string $dataTrigger. Data for Trigger
* @var string $create. Create o Update Trigger
* @var string $sTriggerUid. Uid for Trigger
* *
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
* @copyright Colosa - Bolivia
*
* @return array
*/ */
public function saveTrigger($sProcessUID = '', $dataTrigger = array(), $create = false, $sTriggerUid = '') public function saveTrigger($sProcessUID = '', $dataTrigger = array(), $create = false, $sTriggerUid = '')
{ {
@@ -185,12 +206,19 @@ class Trigger
} }
return $dataResp; return $dataResp;
} }
return array();
} }
/** /**
* Verify name for trigger in process * Verify name for trigger in process
* @var string $sProcessUID. Uid for Process
* @var string $sTriggerName. Name for Trigger
* @var string $sTriggerUid. Uid for Trigger
* *
* return boolean * @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
* @copyright Colosa - Bolivia
*
* @return boolean
*/ */
public function verifyNameTrigger($sProcessUID, $sTriggerName, $sTriggerUid = '') public function verifyNameTrigger($sProcessUID, $sTriggerName, $sTriggerUid = '')
{ {

View File

@@ -7,6 +7,9 @@ use \Luracast\Restler\RestException;
/** /**
* Project\Activity\Step\Trigger Api Controller * Project\Activity\Step\Trigger Api Controller
* *
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
* @copyright Colosa - Bolivia
*
* @protected * @protected
*/ */
class Trigger extends Api class Trigger extends Api
@@ -14,13 +17,17 @@ class Trigger extends Api
/** /**
* @param string $projectUid {@min 1} {@max 32} * @param string $projectUid {@min 1} {@max 32}
* *
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
* @copyright Colosa - Bolivia
* @return array
*
* @url GET /:projectUid/triggers * @url GET /:projectUid/triggers
*/ */
public function doGetTriggers($projectUid) public function doGetTriggers($projectUid)
{ {
try { try {
$trigger = new \BusinessModel\Trigger(); $trigger = new \BusinessModel\Trigger();
$response = $trigger->getTriggersCriteria($projectUid); $response = $trigger->getTriggers($projectUid);
return $response; return $response;
} catch (\Exception $e) { } catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
@@ -30,6 +37,9 @@ class Trigger extends Api
/** /**
* @param string $projectUid {@min 1} {@max 32} * @param string $projectUid {@min 1} {@max 32}
* @param string $triggerUid {@min 1} {@max 32} * @param string $triggerUid {@min 1} {@max 32}
* @return array
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
* @copyright Colosa - Bolivia
* *
* @url GET /:projectUid/trigger/:triggerUid * @url GET /:projectUid/trigger/:triggerUid
*/ */
@@ -52,6 +62,10 @@ class Trigger extends Api
* @param string $tri_type {@from body} {@choice SCRIPT} * @param string $tri_type {@from body} {@choice SCRIPT}
* @param string $tri_webbot {@from body} * @param string $tri_webbot {@from body}
* @param string $tri_param {@from body} * @param string $tri_param {@from body}
* @return array
*
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
* @copyright Colosa - Bolivia
* *
* @url POST /:projectUid/trigger * @url POST /:projectUid/trigger
*/ */
@@ -75,6 +89,10 @@ class Trigger extends Api
* @param string $tri_type {@from body} {@choice SCRIPT} * @param string $tri_type {@from body} {@choice SCRIPT}
* @param string $tri_webbot {@from body} * @param string $tri_webbot {@from body}
* @param string $tri_param {@from body} * @param string $tri_param {@from body}
* @return void
*
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
* @copyright Colosa - Bolivia
* *
* @url PUT /:projectUid/trigger/:triggerUid * @url PUT /:projectUid/trigger/:triggerUid
*/ */
@@ -92,7 +110,11 @@ class Trigger extends Api
/** /**
* @param string $projectUid {@min 1} {@max 32} * @param string $projectUid {@min 1} {@max 32}
* @param string $triggerUid {@min 1} {@max 32} * @param string $triggerUid {@min 1} {@max 32}
* * @return void
*
* @author Brayan Pereyra (Cochalo) <brayan@colosa.com>
* @copyright Colosa - Bolivia
*
* @url DELETE /:projectUid/trigger/:triggerUid * @url DELETE /:projectUid/trigger/:triggerUid
*/ */
public function doDeleteTrigger($projectUid, $triggerUid) public function doDeleteTrigger($projectUid, $triggerUid)
@@ -100,7 +122,6 @@ class Trigger extends Api
try { try {
$trigger = new \BusinessModel\Trigger(); $trigger = new \BusinessModel\Trigger();
$response = $trigger->deleteTrigger($triggerUid); $response = $trigger->deleteTrigger($triggerUid);
return $response;
} catch (\Exception $e) { } catch (\Exception $e) {
throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage()));
} }