[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [7844] Added function get_procedures_as_array
From: |
Torstein |
Subject: |
[Fmsystem-commits] [7844] Added function get_procedures_as_array |
Date: |
Fri, 07 Oct 2011 06:40:46 +0000 |
Revision: 7844
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7844
Author: vator
Date: 2011-10-07 06:40:45 +0000 (Fri, 07 Oct 2011)
Log Message:
-----------
Added function get_procedures_as_array
Modified Paths:
--------------
trunk/controller/inc/class.soprocedure.inc.php
Modified: trunk/controller/inc/class.soprocedure.inc.php
===================================================================
--- trunk/controller/inc/class.soprocedure.inc.php 2011-10-07 06:39:41 UTC
(rev 7843)
+++ trunk/controller/inc/class.soprocedure.inc.php 2011-10-07 06:40:45 UTC
(rev 7844)
@@ -109,17 +109,7 @@
return $procedure;
}
- /**
- * Get a list of procedure objects matching the specific filters
- *
- * @param $start search result offset
- * @param $results number of results to return
- * @param $sort field to sort by
- * @param $query LIKE-based query string
- * @param $filters array of custom filters
- * @return list of rental_composite objects
- */
- function get_procedure_array($start = 0, $results = 1000, $sort = null,
$dir = '', $query = null, $search_option = null, $filters = array())
+ function get_procedures($start = 0, $results = 1000, $sort = null, $dir
= '', $query = null, $search_option = null, $filters = array())
{
$results = array();
@@ -143,7 +133,33 @@
}
return $results;
- }
+ }
+
+ function get_procedures_as_array($start = 0, $results = 1000, $sort =
null, $dir = '', $query = null, $search_option = null, $filters = array())
+ {
+ $results = array();
+
+ //$condition = $this->get_conditions($query,
$filters,$search_option);
+ $order = $sort ? "ORDER BY $sort $dir ": '';
+
+ //$sql = "SELECT * FROM controller_procedure WHERE $condition
$order";
+ $sql = "SELECT * FROM controller_procedure $order";
+ $this->db->limit_query($sql, $start, __LINE__, __FILE__,
$limit);
+
+ while ($this->db->next_record()) {
+ $procedure = new
controller_procedure($this->unmarshal($this->db->f('id', true), 'int'));
+
$procedure->set_title($this->unmarshal($this->db->f('title', true), 'string'));
+
$procedure->set_purpose($this->unmarshal($this->db->f('purpose', true),
'string'));
+
$procedure->set_responsibility($this->unmarshal($this->db->f('responsibility',
true), 'string'));
+
$procedure->set_description($this->unmarshal($this->db->f('description', true),
'string'));
+
$procedure->set_reference($this->unmarshal($this->db->f('reference', true),
'string'));
+
$procedure->set_attachment($this->unmarshal($this->db->f('attachment', true),
'string'));
+
+ $results[] = $procedure->toArray();;
+ }
+
+ return $results;
+ }
function get_id_field_name($extended_info = false)
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [7844] Added function get_procedures_as_array,
Torstein <=