public function getPK($require = true)
    {
        foreach ($this->fields as $field) {
            if ($field->pk()) {
                return $field;
            }
        }

        if ($require) {
            throw new NoPKException();
        }
    }