code: public static function toModel(stdClass $object)
      {
          if (null === static::MODEL) {
              throw new LogicException('Model class is not defined.');
          }
  
          $class = static::MODEL;
          $model = new $class;
  
          foreach (static::$map as $local => $remote) {
              if (is_int($local)) {
                  $local = $remote;
              }
  
              if (property_exists($object, $remote)) {
                  switch ($local) {
                      case 'created':
                      case 'updated':
                      case 'due':
                      case 'followUp':
                      case 'deploymentTime':
                          if (null !== $object->$remote) {
                              $model->{'set' . ucfirst($local)}(new DateTime($object->$remote));
                          }
  
                          break;
  
                      case 'variables':
                          foreach ($object->$remote as $name => $variable) {
                              if (Variable::TYPE_JSON === $variable->type) {
                                  $variable->value = json_decode($variable->value);
                              }
  
                              $model->addVariable(new Variable($name, $variable->value, $variable->type, $variable->valueInfo));
                          }
  
                          break;
  
                      default:
                          $model->{'set'.ucfirst($local)}($object->$remote);
                  }
              }
          }
  
          return $model;
      }
docs: Cast object to model
  
  @param \stdClass $object
  @return \Ds\Component\Camunda\Model\Model
  @throws \LogicException