public function getPrimaryKey() { if (is_null($this->primary)) { $primary = $this->getCrud()->getPrimaryKey(); $this->primary = array_intersect_key($this->data, array_flip($primary)); } return $this->primary; }