public function getPrimary() {
        foreach ($this->_fields as $key => $field) {
            if ($field->primary == true) {
                $this->_primary = $key;
                break;
            }
        }
    }