Skip to content
Snippets Groups Projects
Commit 65c3289c authored by Tim Steiner's avatar Tim Steiner
Browse files

Implement the Restart ApprovalAction

parent b2516968
No related branches found
No related tags found
No related merge requests found
<?php
class Requests_ApprovalActionRestartModel extends Requests_ApprovalActionModel
{
static public function find($id)
{
$db = Zend_Registry::get('db');
$select = new Zend_Db_Select($db);
$select->from(array('a' => 'creqApprovalActions'));
$select->join(array('r' => 'creqApprovalActionsRestart'), 'a.approvalActionId = r.approvalActionId');
if (Unl_Util::isArray($id)) {
$select->where('a.approvalActionId IN(?)', $id);
} else {
$select->where('a.approvalActionId = ?', $id);
}
$records = $db->query($select)->fetchAll();
$objects = new Unl_Model_Collection(__CLASS__);
foreach ($records as $record) {
$object = Unl_Model_Registry::getInstance()->getOrAdd(new self($record));
$objectId = $object->getId();
$objects[$objectId] = $object;
}
if (Unl_Util::isArray($objects)) {
return $objects;
} else {
return array_pop($objects);
}
}
public function consider($requests)
{
foreach ($requests as $request) {
$request->clearStackPointer();
}
Requests_RequestModel::save($requests);
return $requests;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment