Grid/Row.php
public function getPrimaryFieldValue()
    {
        if (null === $this->primaryField) {
            throw new \InvalidArgumentException('Primary column must be defined');
        }

        if (is_array($this->primaryField)) {
            return array_intersect_key($this->fields, array_flip($this->primaryField));
        }

        if (!isset($this->fields[$this->primaryField])) {
            throw new \InvalidArgumentException('Primary field not added to fields');
        }

        return $this->fields[$this->primaryField];
    }
public function getPrimaryFieldValue()
    {
        if (null === $this->primaryField) {
            throw new \InvalidArgumentException('Primary column must be defined');
        }

        if (is_array($this->primaryField)) {
            return array_intersect_key($this->fields, array_flip($this->primaryField));
        }

        if (!isset($this->fields[$this->primaryField])) {
            throw new \InvalidArgumentException('Primary field not added to fields');
        }

        return $this->fields[$this->primaryField];
    }
@throws \InvalidArgumentException

@return array|mixed