Share objects need to be able to call this method.
}
/**
+ * Convert TO the storage driver's charset. Individual share objects should
+ * implement this method if needed.
+ *
+ * @param array $data Data to be converted.
+ */
+ public function toDriverCharset($data)
+ {
+ // noop
+ }
+
+ /**
* Utility function to be used with uasort() for sorting arrays of
* Horde_Share objects.
*
$fields = array();
$params = array();
- foreach ($this->_shareOb->_toDriverCharset($this->data) as $key => $value) {
+ foreach ($this->_shareOb->toDriverCharset($this->data) as $key => $value) {
if ($key != 'share_id' && $key != 'perm' && $key != 'share_flags') {
$fields[] = $key;
$params[] = $value;
}
$attributes = $this->_toDriverKeys($attributes);
- $attributes = $this->_toDriverCharset($attributes);
+ $attributes = $this->toDriverCharset($attributes);
if (is_array($attributes)) {
// Build attribute/key filter.
/**
* Utility function to convert TO the SQL server's charset.
*
- * @TODO: This needs to be public since it's called by the share object.
- * Look at making this outright public or maybe moving it to the object.
+ * @see Horde_Share#toDriverCharset
*/
- public function _toDriverCharset($data)
+ public function toDriverCharset($data)
{
if (!is_array($data)) {
return $data;
$attributes = $this->_toDriverKeys($attributes);
/* ...and to driver charset */
- $attributes = $this->_toDriverCharset($attributes);
+ $attributes = $this->toDriverCharset($attributes);
if (is_array($attributes)) {
// Build attribute/key filter.