More Update for BpmnWorkflow Adapter class, now start and end tasks are updating successfully on Workflow Layer

This commit is contained in:
Erik Amaru Ortiz
2014-02-12 17:01:19 -04:00
parent 813bfae124
commit 79ee31b761
9 changed files with 143 additions and 91 deletions

View File

@@ -16,6 +16,11 @@ require_once 'classes/model/om/BaseBpmnFlow.php';
*/
class BpmnFlow extends BaseBpmnFlow
{
/**
* @param $field string coming from \BpmnFlowPeer::<FIELD_NAME>
* @param $value string
* @return \BpmnFlow|null
*/
public static function findOneBy($field, $value)
{
$rows = self::findAllBy($field, $value);

View File

@@ -213,5 +213,30 @@ class Route extends BaseRoute
}
return $value;
}
/**
* @param $field
* @param null $value
* @return \Route|null
*/
public static function findOneBy($field, $value = null)
{
$rows = self::findAllBy($field, $value);
return empty($rows) ? null : $rows[0];
}
public static function findAllBy($field, $value = null)
{
$field = is_array($field) ? $field : array($field => $value);
$c = new Criteria('workflow');
foreach ($field as $key => $value) {
$c->add($key, $value, Criteria::EQUAL);
}
return RoutePeer::doSelect($c);
}
}