Skip to content

Instantly share code, notes, and snippets.

@Charlie-Lucas
Created January 11, 2016 08:53
Show Gist options
  • Save Charlie-Lucas/814e99503aba59dab7cb to your computer and use it in GitHub Desktop.
Save Charlie-Lucas/814e99503aba59dab7cb to your computer and use it in GitHub Desktop.
<?php
public function create(MonObjet $object)
{
$hash = "reference:" . $object->getId();
if($this->redis->exists($hash))
{
throw new \Exception('An redis hash "' . $hash . ' already exist');
}
$values = $this->transformObjectToArray($object);
$valuesReadyToRedis = $this->redislizeArray($array);
$this->redis->hmset($hash, $valuesReadytoRedy);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment