[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [14978]
From: |
Nelson Guerra |
Subject: |
[Fmsystem-commits] [14978] |
Date: |
Thu, 05 May 2016 23:32:23 +0000 |
Revision: 14978
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=14978
Author: nelson224
Date: 2016-05-05 23:32:23 +0000 (Thu, 05 May 2016)
Log Message:
-----------
Modified Paths:
--------------
branches/dev-syncromind-2/property/inc/class.sogeneric_document.inc.php
Modified:
branches/dev-syncromind-2/property/inc/class.sogeneric_document.inc.php
===================================================================
--- branches/dev-syncromind-2/property/inc/class.sogeneric_document.inc.php
2016-05-05 23:31:59 UTC (rev 14977)
+++ branches/dev-syncromind-2/property/inc/class.sogeneric_document.inc.php
2016-05-05 23:32:23 UTC (rev 14978)
@@ -160,4 +160,48 @@
return $values;
}
+
+ public function add( $data = array(), $file_id )
+ {
+ $values_insert = array
+ (
+ 'file_id' => $file_id,
+ 'metadata' => json_encode($data)
+ );
+
+ $resutl = $this->db->query("INSERT INTO
phpgw_vfs_filedata (" . implode(',', array_keys($values_insert)) . ') VALUES ('
+ .
$this->db->validate_insert(array_values($values_insert)) . ')', __LINE__,
__FILE__);
+
+ return $resutl;
+ }
+
+ public function update( $data = array(), $file_id)
+ {
+ $value_set = array
+ (
+ 'metadata' => json_encode($data)
+ );
+
+ $value_set = $this->db->validate_update($value_set);
+
+ return $this->db->query("UPDATE phpgw_vfs_filedata SET
$value_set WHERE file_id = {$file_id}", __LINE__, __FILE__);
+ }
+
+ public function read_single( $id )
+ {
+ $id = (int)$id;
+
+ $this->db->query("SELECT * FROM phpgw_vfs_filedata
WHERE file_id = {$id}");
+
+ $values = array();
+ if ($this->db->next_record())
+ {
+ $values['id'] = $id;
+ $values['metadata'] = $this->db->f('metadata');
+ }
+
+ return $values['metadata'];
+
+ }
+
}
\ No newline at end of file
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [14978],
Nelson Guerra <=