/** * Checks if record primary key value is set * * @return bool */ public function hasID() { if ($this->isDeleted) { return false; } $PKFieldList = $this->schema->getPrimaryKeyList(); foreach ($PKFieldList as $field) { if (!$this->data[$field->getName()]->hasValue()) { return false; } } return true; }