From 77a3eec34336d6d6cd20e68ed8346eb457abda4e Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Tue, 24 Sep 2013 19:02:14 +0200 Subject: [PATCH] ActiveRecord::isPrimaryKey() made public --- framework/yii/db/ActiveRecord.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/framework/yii/db/ActiveRecord.php b/framework/yii/db/ActiveRecord.php index e1c4b4f..c3d086b 100644 --- a/framework/yii/db/ActiveRecord.php +++ b/framework/yii/db/ActiveRecord.php @@ -1477,12 +1477,13 @@ class ActiveRecord extends Model } /** - * @param array $keys - * @return boolean + * Returns a value indicating whether the given set of attributes represents the primary key for this model + * @param array $keys the set of attributes to check + * @return boolean whether the given set of attributes represents the primary key for this model */ - private function isPrimaryKey($keys) + public static function isPrimaryKey($keys) { - $pks = $this->primaryKey(); + $pks = static::primaryKey(); foreach ($keys as $key) { if (!in_array($key, $pks, true)) { return false;