fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [8011]


From: Torstein
Subject: [Fmsystem-commits] [8011]
Date: Fri, 04 Nov 2011 07:36:25 +0000

Revision: 8011
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=8011
Author:   vator
Date:     2011-11-04 07:36:21 +0000 (Fri, 04 Nov 2011)
Log Message:
-----------


Added Paths:
-----------
    trunk/controller/inc/class.socheck_item.inc.php

Added: trunk/controller/inc/class.socheck_item.inc.php
===================================================================
--- trunk/controller/inc/class.socheck_item.inc.php                             
(rev 0)
+++ trunk/controller/inc/class.socheck_item.inc.php     2011-11-04 07:36:21 UTC 
(rev 8011)
@@ -0,0 +1,67 @@
+<?php
+phpgw::import_class('controller.socommon');
+
+include_class('controller', 'check_item', 'inc/model/');
+
+class controller_socheck_item extends controller_socommon
+{
+       protected static $so;
+
+       /**
+        * Get a static reference to the storage object associated with this 
model object
+        *
+        * @return controller_socontrol_group the storage object
+        */
+       public static function get_instance()
+       {
+               if (self::$so == null) {
+                       self::$so = CreateObject('controller.socheck_item');
+               }
+               return self::$so;
+       }
+       
+       function get_query(string $sort_field, boolean $ascending, string 
$search_for, string $search_type, array $filters, boolean $return_count){}
+
+       function populate(int $object_id, &$object){}
+       
+       function add(&$check_item)
+       {
+               $cols = array(
+                               'control_item_id',
+                               'status',
+                               'comment',
+                               'check_list_id'
+               );
+               
+               $values = array(
+                       $this->marshal($check_item->get_control_item_id(), 
'int'),
+                       $this->marshal($check_item->get_status(), 'bool'),
+                       $this->marshal($check_item->get_comment(), 'string'),
+                       $this->marshal($check_item->get_check_list_id(), 'int')
+               );
+               
+               $result = $this->db->query('INSERT INTO controller_check_item 
(' . join(',', $cols) . ') VALUES (' . join(',', $values) . ')', 
__LINE__,__FILE__);
+
+               return isset($result) ? 
$this->db->get_last_insert_id('controller_check_item', 'id') : 0;
+       }
+       
+       
+       function update($object){
+               $values = array(
+                       'control_item_id = ' . 
$this->marshal($check_item->set_control_item_id(), 'int'),
+                       'status = ' . $this->marshal($check_item->set_status(), 
'string'),
+                       'comment = ' . 
$this->marshal($check_item->set_comment(), 'string'),
+                       'check_list_id = ' . 
$this->marshal($check_item->set_check_list_id(), 'int')
+               );
+               
+               $result = $this->db->query('UPDATE controller_check_item SET ' 
. join(',', $values) . " WHERE id=$id", __LINE__,__FILE__);
+               
+               if( isset($result) ){
+                       return $id;     
+               }else{
+                       return 0;
+               }
+       }
+       
+       function get_id_field_name(){}  
+}




reply via email to

[Prev in Thread] Current Thread [Next in Thread]