/**
  * @param ModelInterface $model
  * @param mixed $references
  * @param DatabaseInterface $database
  */
 public function setValue(ModelInterface $model, $references, DatabaseInterface $database)
 {
     $result = array();
     foreach ($references as $key => $reference) {
         $result[$key] = $database->fetchProxy($reference['hash'], $reference['class']);
     }
     parent::setValue($model, $result, $database);
 }
 /**
  * @param ModelInterface $model
  * @param mixed $value
  * @param DatabaseInterface $database
  */
 public function setValue(ModelInterface $model, $value, DatabaseInterface $database)
 {
     if (!$value) {
         parent::setValue($model, $value, $database);
         return;
     }
     $reference = $database->fetchProxy($value, $this->className);
     parent::setValue($model, $reference, $database);
 }
 /**
  * @param ModelInterface $model
  * @param mixed $value
  * @param DatabaseInterface $database
  */
 public function setValue(ModelInterface $model, $value, DatabaseInterface $database)
 {
     parent::setValue($model, $this->userProvider->loadUserByUsername($value), $database);
 }