westdc-zf1/application/module/Westdc/Visual/Handle/VisualHandle.php

73 lines
1.3 KiB
PHP

<?php
namespace Westdc\Visual\Handle;
use \Helpers\View as view;
use \Helpers\Table;
//事件中存在的操作
class VisualHandle extends \Westdc\Visual\VariableEncoder
{
private $db; //传入PDO对象误
private $config; //全局配置
function __construct()
{
$this->db = \Zend_Registry::get('db');
$this->config = \Zend_Registry::get('config');
}
public function checkParam(\Zend_EventManager_Event $e)
{
$data = $e->getParam('data');
if(empty($data['uuid']))
{
return "请填写数据UUID";
}
if(!is_array($data['variable']) || count($data['variable']) < 1)
{
return "参数错误";
}
return true;
}
public function processData(\Zend_EventManager_Event $e)
{
$data = $e->getParam('data');
foreach($data['variable'] as $k=>$v)
{
if(isset($v['condition']))
{
if(preg_match("/;/",$v['condition']))
$data['variable'][$k]['condition'] = explode(";",$v['condition']);
}
}
$data['variable'] = $this->encode($data['variable']);
if(!isset($data['status']))
{
$data['status'] = 1;
}
return $data;
}
public function recordPosted(\Zend_EventManager_Event $e)
{
$id = $e->getParam('id');
}
public function recordChanged(\Zend_EventManager_Event $e)
{
$id = $e->getParam('id');
}
}