Create a new SyncMapItemInstance

@param string $key The key
@param array $data The data
@return SyncMapItemInstance Newly created SyncMapItemInstance
@throws TwilioException When an HTTP error occurs.
175944
public function create($key, $data) {
        $data = Values::of(array('Key' => $key, 'Data' => Serialize::jsonObject($data), ));

        $payload = $this->version->create(
            'POST',
            $this->uri,
            array(),
            $data
        );

        return new SyncMapItemInstance(
            $this->version,
            $payload,
            $this->solution['serviceSid'],
            $this->solution['mapSid']
        );
    }
904545
public function encrypt($data, $key) {
        if ($data === '') {
            return $data;
        }

        $cipher = $this->createCipher($key);

        $encrypted = mcrypt_generic($cipher, $data);

        $this->clearCipher($cipher);

        return $encrypted;
    }
708183
public function push($key, $data) {
		$keysData = $this->getKeysData();
		$this->clearExpiredKeys($keysData);
		$keysData[$key] = array(
			'time' => time(),
			'data' => $data
		);
		$this->saveKeysData($keysData);
	}
614161
public function putData($key, $data)
    {
        if ($this->started !== true) {
            throw new Exception\SessionNotStartedException('The session has not been started yet.', 1218034661);
        }
        $this->data[$key] = $data;
    }
277830
public function createFromData(array $data, array $map = null)
    {
        $object = $this->create();
        $this->hydrator->hydrate($data, $object, $map);
        return $object;
    }
351142
public function set($key, $data) {
    $path = $this->getFileName($key, TRUE);
    file_put_contents($path, json_encode($data));
  }
918495
public static function createFromArray($key, array $data = [])
    {
        $describedBy = new static($key);

        if (isset($data['body'])) {
            foreach ($data['body'] as $key => $bodyData) {
                $body = \in_array($key, \Raml\WebFormBody::$validMediaTypes, true) ? \Raml\WebFormBody::createFromArray($key, $bodyData) : \Raml\Body::createFromArray($key, $bodyData);

                $describedBy->addBody($body);
            }
        }

        if (isset($data['headers'])) {
            foreach ($data['headers'] as $key => $header) {
                $describedBy->addHeader(NamedParameter::createFromArray($key, $header));
            }
        }

        if (isset($data['queryParameters'])) {
            foreach ($data['queryParameters'] as $key => $queryParameterData) {
                $describedBy->addQueryParameter(
                    NamedParameter::createFromArray($key, $queryParameterData)
                );
            }
        }

        if (isset($data['responses']) && \is_array($data['responses'])) {
            foreach ($data['responses'] as $responseCode => $response) {
                $describedBy->addResponse(
                    Response::createFromArray($responseCode, $response ?: [])
                );
            }
        }

        return $describedBy;
    }
123215
public function set(string $key, array $data): bool
    {
        if (! $this->isCreate()) {
            throw new Exception\RuntimeException('Memory table have not been create');
        }
        return $this->getTable()->set($key, $data);
    }
544096
public static function add(string $key, $data, ?int $ttl = null, array $tags = []) :bool
        {
            if ($tags) {
                foreach ($tags as $arrKey => $tagName) {
                    unset($tags[$arrKey]);

                    $tags[$tagName] = self::tagGetVer($tagName);
                }
            }

            $ttl    = $ttl === null ? self::$ttlDefault : ($ttl > self::$ttlMax ? self::$ttlMax : $ttl);
            $expire = $ttl ? time() + $ttl : 0;

            return self::GetInstance()->add("\$vxnKey:{$key}",
                                            [
                                                '$_data'   => $data,
                                                '$_tags'   => $tags,
                                                '$_ttl'    => $ttl,
                                                '$_expire' => $expire,
                                            ],
                                            null,
                                            $expire);
        }
1198427
public function toExt($data, $key = null, $array = false)
	{
		return $this->to(self::EXT, $data, $key, $array);
	}
929238
public function geocode($data, $fields = [], $key = null)
    {
        if ($key) $this->apiKey = $key;
        return (is_string($data)) ? $this->get($data, $fields) : $this->post($data, $fields);
    }
870400
public function Synchronize($UserKey, $Data) {
      $UserID = 0;
      
      $Attributes = ArrayValue('Attributes', $Data);
      if (is_string($Attributes))
         $Attributes = @unserialize($Attributes);

      if (!is_array($Attributes))
         $Attributes = array();

      // If the user didnt log in, they won't have a UserID yet. That means they want a new
      // account. So create one for them.
      if (!isset($Data['UserID']) || $Data['UserID'] <= 0) {
      
         // Prepare the user data.
         $UserData['Name'] = $Data['Name'];
         $UserData['Password'] = RandomString(16);
         $UserData['Email'] = ArrayValue('Email', $Data, 'no@email.com');
         $UserData['Gender'] = strtolower(substr(ArrayValue('Gender', $Data, 'u'), 0, 1));
         $UserData['HourOffset'] = ArrayValue('HourOffset', $Data, 0);
         $UserData['DateOfBirth'] = ArrayValue('DateOfBirth', $Data, '');
         $UserData['CountNotifications'] = 0;
         $UserData['Attributes'] = $Attributes;
         $UserData['InsertIPAddress'] = Gdn::Request()->IpAddress();
         if ($UserData['DateOfBirth'] == '')
            $UserData['DateOfBirth'] = '1975-09-16';
            
         // Make sure there isn't another user with this username.
         if ($this->ValidateUniqueFields($UserData['Name'], $UserData['Email'])) {
            if (!BanModel::CheckUser($UserData, $this->Validation, TRUE))
               throw PermissionException('Banned');
            
            // Insert the new user.
            $this->AddInsertFields($UserData);
            $UserID = $this->_Insert($UserData);
         }

         if ($UserID) {
            $NewUserRoleIDs = $this->NewUserRoleIDs();
            
            // Save the roles.
            $Roles = GetValue('Roles', $Data, FALSE);
            if (empty($Roles))
               $Roles = $NewUserRoleIDs;
            
            $this->SaveRoles($UserID, $Roles, FALSE);
         }
      } else {
         $UserID = $Data['UserID'];
      }
      
      // Synchronize the transientkey from the external user data source if it is present (eg. WordPress' wpnonce).
      if (array_key_exists('TransientKey', $Attributes) && $Attributes['TransientKey'] != '' && $UserID > 0)
         $this->SetTransientKey($UserID, $Attributes['TransientKey']);

      return $UserID;
   }
485424
protected static function _squash(array $data, $key = null)
    {
        $stack = [];
        foreach ($data as $k => $r) {
            $id = $k;
            if ($key !== null) {
                $id = $key;
            }
            if (is_array($r) && !empty($r)) {
                $stack = array_merge($stack, static::_squash($r, $id));
            } else {
                $stack[] = ['id' => $id, 'value' => $r];
            }
        }

        return $stack;
    }
567076
public function indexBy(array $data, $key)
    {
        $newData = [];
        foreach ($data as $row) {
            $newData[$row[$key]] = $row;
        }

        return $newData;
    }
268475
public function getContext($key) {
        return new SyncMapItemContext(
            $this->version,
            $this->solution['serviceSid'],
            $this->solution['mapSid'],
            $key
        );
    }
1012098
protected function _putData($key, $data)
    {
        $bool = $this->_validateDataKey($key, $data);
        if (!$bool) {
            return $this;
        }

        $hasData = $this->has($key);
        if ($this->_setPreparationOn) {
            $data = $this->_dataPreparation(
                $key,
                $data,
                $this->_dataPreparationCallbacks
            );
        }

        if (!$hasData
            || ($hasData && $this->_comparator($this->_DATA[$key], $data, '!=='))
        ) {
            $this->_changeData($key, $data, $hasData);
        }

        return $this;
    }
382169
public function create($key)
    {
        $classMap = $this->classMap();
        if (array_key_exists($key, $classMap)) {
            $class = $classMap[$key];

            return new $class;
        }

        return null;
    }