Finished up user creation in Redis
This commit is contained in:
parent
9fe9eb7acf
commit
cedc38917a
2 changed files with 26 additions and 13 deletions
|
@ -24,14 +24,24 @@ class RedisModel extends Object
|
|||
return strtolower(implode(':', $parts));
|
||||
}
|
||||
|
||||
public function mappingKey($variable, $value)
|
||||
{
|
||||
return $this->key($variable, $value, 'uid');
|
||||
}
|
||||
|
||||
public function nextUID()
|
||||
{
|
||||
return $this->redis->incr($this->key('uid'));
|
||||
}
|
||||
|
||||
public function getUID($variable, $value)
|
||||
public function setMapping($variable, $value, $uid)
|
||||
{
|
||||
return $this->redis->get($this->key($variable, $value, 'uid'));
|
||||
$this->redis->set($this->mappingKey($variable, $value), $uid);
|
||||
}
|
||||
|
||||
public function getMapping($variable, $value)
|
||||
{
|
||||
return $this->redis->get($this->mappingKey($variable, $value));
|
||||
}
|
||||
|
||||
public function __call($name, $arguments)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue