summaryrefslogtreecommitdiff
path: root/idiorm.php
diff options
context:
space:
mode:
Diffstat (limited to 'idiorm.php')
-rw-r--r--idiorm.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/idiorm.php b/idiorm.php
index 3795032..4e56569 100644
--- a/idiorm.php
+++ b/idiorm.php
@@ -1058,6 +1058,21 @@
return implode(', ', $db_fields);
}
}
+
+ /**
+ * Helper method that filters a column/value array returning only those
+ * columns that belong to a compound primary key.
+ *
+ * If the key contains a column that does not exist in the given array,
+ * a null value will be returned for it.
+ */
+ protected function _get_compound_id_column_values($value) {
+ $filtered = array();
+ foreach($this->_get_id_column_name() as $key) {
+ $filtered[$key] = isset($value[$key]) ? $value[$key] : null;
+ }
+ return $filtered;
+ }
/**
* Add a WHERE column = value clause to your query. Each time