From: avl Date: Fri, 19 Dec 2008 16:16:10 +0000 (+0200) Subject: Primary Key for composite. X-Git-Tag: 0.6~160 X-Git-Url: https://git.andy128k.dev/?a=commitdiff_plain;h=491eb08bfe0dc6c02499b2508c0078eb1b9a1e55;p=ipf-legacy-orm.git Primary Key for composite. --- diff --git a/ipf/orm/record.php b/ipf/orm/record.php index 639b352..0b7d506 100644 --- a/ipf/orm/record.php +++ b/ipf/orm/record.php @@ -1010,6 +1010,17 @@ abstract class IPF_ORM_Record extends IPF_ORM_Record_Abstract implements Countab return $id; } + public function pk($sep='_') + { + $pk = ''; + while (list($key, $val) = each($this->_id)) { + if ($pk!='') + $pk .= $sep; + $pk .= $val; + } + return $pk; + } + public function getLast() { return $this;