Esempio n. 1
0
 function save($check_notify = FALSE)
 {
     if (empty($this->id)) {
         unset($_POST['aow_conditions_id']);
         unset($_POST['aow_actions_id']);
     }
     parent::save($check_notify);
     require_once 'modules/AOW_Conditions/AOW_Condition.php';
     $condition = new AOW_Condition();
     $condition->save_lines($_POST, $this, 'aow_conditions_');
     require_once 'modules/AOW_Actions/AOW_Action.php';
     $action = new AOW_Action();
     $action->save_lines($_POST, $this, 'aow_actions_');
 }
Esempio n. 2
0
 public function testsave_lines()
 {
     error_reporting(E_ERROR | E_PARSE);
     $aowAction = new AOW_Action();
     //populate required values
     $post_data = array();
     $post_data['name'] = array('test1', 'test2');
     $post_data['action'] = array('action1', 'action2');
     $post_data['param'] = array(array('param1' => 'value'), array('value' => array('param2' => 'value')));
     //create parent bean
     $aowWorkFlow = new AOW_WorkFlow();
     $aowWorkFlow->id = 1;
     $aowAction->save_lines($post_data, $aowWorkFlow);
     //get the linked beans and verify if records created
     $aow_actions = $aowWorkFlow->get_linked_beans('aow_actions', $aowWorkFlow->object_name);
     $this->assertEquals(count($post_data['action']), count($aow_actions));
     //cleanup afterwards
     foreach ($aow_actions as $lineItem) {
         $lineItem->mark_deleted($lineItem->id);
     }
 }