function setPrimary($table, $key) { $this->primary[$table] = $key; // compound keys are never auto-generated, // so we can assume they are required if (is_array($key)) { foreach ($key as $k) { $this->setRequired($table, $k); } } return $this; }