public function put($key, $value) { $attribute = $this->load(array('key' => $key)); if (!$attribute) { $attribute = new Personality(); } $attribute->key = $key; $attribute->value = $value; $attribute->save(); }