public static isPrimaryKey ( array $keys ) : boolean | ||
$keys | array | the set of attributes to check |
Результат | boolean | whether the given set of attributes represents the primary key for this model |
public static function isPrimaryKey($keys)
{
$pks = static::primaryKey();
if (count($keys) === count($pks)) {
return count(array_intersect($keys, $pks)) === count($pks);
} else {
return false;
}
}