public function validateModelClass() { $pk = $this->tableSchema->primaryKey; if (empty($pk)) { $this->addError('modelClass', "The table associated with {$this->modelClass} must have primary key(s)."); } }