Loads contact from the $data array.
Sets $pincode to each model.

@param array $data
@param string $pincode
@return bool whether data was loaded successfully
345748
protected function loadContacts($data, $pincode)
    {
        $success = true;

        foreach ($data as $datum) {
            if (!isset($datum['localization'])) {
                continue;
            }

            $localization = $datum['localization'];
            $contact = $this->getContact($localization);
            if ($contact === null) {
                continue;
            }

            if (!$contact->load($datum, '')) {
                $success = false;
                continue;
            }

            $contact->pincode = $pincode;
        }

        return $success;
    }
269426
public function error( $message, $code = null, $data = null )
    {
        if ( null === $code && isset( $this->errorCodes[$message] ) )
        {
            $code = $this->errorCodes[$message];
        }

        return $this->getResponse( 'error', (object) array(
            'code'      => $code,
            'message'   => $message,
            'data'      => $data,
        ) );
    }
1052078
public function load($data)
    {
        foreach ($data as $index => $value) {
            if (property_exists($this, $index)) {
                $this->$index = trim($value);
            }
        }
        return true;
    }
1101004
public function getMePins(array $data = [])
    {
        $response = $this->request->get("me/pins", $data);
        return new Collection($this->master, $response, "Pin");
    }
1005499
public function edit($pin_id, array $data, $fields = null)
    {
        $query = (!$fields) ? array() : array("fields" => $fields);

        $response = $this->request->update(sprintf("pins/%s/", $pin_id), $data, $query);
        return new Pin($this->master, $response);
    }
784938
public function updateBillingInfo($code = null, $data = [])
    {
        $payload = [];

        if (! $code) {
            $code = $this->data->code;
        }

        if (! empty($data)) {
            $payload['credit_card'] = $data;
        } elseif (isset($this->data->billing_info)) {
            $payload = $this->data->billing_info;
        }

        $this->client->put('/{code}/billing_infos', [$code], $payload);

        return $this;
    }
572861
public function api($code, $msg = '', $data = '', $header = [], $options = [])
    {
        $this->json([
            'code' => $code,
            'msg' => $msg,
            'data' => $data
        ], $header, $options);
    }
270433
public function getData($data)
    {
        if ($this->hasData($data)) {
            return $this->getAttribute(sprintf('data-%s', $data));
        } else {
            return false;
        }
    }
669370
public static function has(array $data, $key)
	{
		if (!is_array($data)) {
			return false;
		}

		if (!array_key_exists($key,$data)) {
			return false;
		}

		return true;
	}
404855
public function sendData($data)
    {
        if (is_array($data) && count($data)) {
            $class = $this->getResponseClass();

            return $this->response = new $class($this, $data);
        }

        return false;
    }
499185
public function load($data, $formName = null)
    {
        return $this->_isDataLoaded ?: $this->_isDataLoaded=true && parent::load($data, $formName);
    }
233387
public function import(array $data)
    {
        $this->clearErrors();
        $result = true;

        foreach ($data as $section) {
            if ($this->importItem($section) === false) {
                $result = false;
            }
        }

        return $result;
    }
183322
public function populate($data = array())
    {
        $this->appId = (isset($data['appId'])) ? $data['appId'] : null;
        $this->appSecret = (isset($data['appSecret'])) ? $data['appSecret'] : null;

    }
172679
public function decode($data)
    {
        $decoded = parent::decode($data);

        return 1 === count($decoded) ? reset($decoded) : 0;
    }
792810
protected function setDataFromArray($data)
    {
        if (is_array($data) && count($data)) {
            $this->upaID = $data['upaID'];
            $this->upaHandle = $data['upaHandle'];
            $this->upaName = $data['upaName'];
            $this->upaDefaultPoints = $data['upaDefaultPoints'];
            $this->upaHasCustomClass = $data['upaHasCustomClass'];
            $this->gBadgeID = $data['gBadgeID'];
            $this->upaIsActive = $data['upaIsActive'];

            return true;
        } else {
            return false;
        }
    }
1136083
public function sync($data = null)
    {
        $this->insertToFlexiBee($data);
        $insertResult = $this->lastResponseCode;
        if ($insertResult == 201) {
            $this->reload();
        }
        $loadResult = $this->lastResponseCode;
        return ($insertResult + $loadResult) == 401;
    }
1198982
public static function loadSerializedJsonJWE(array $data)
    {
        $jwe = new JWE();
        $jwe = $jwe->withCiphertext(Base64Url::decode($data['ciphertext']));

        self::populateIV($jwe, $data);
        self::populateAAD($jwe, $data);
        self::populateTag($jwe, $data);
        self::populateSharedProtectedHeaders($jwe, $data);
        self::populateSharedHeaders($jwe, $data);

        foreach ($data['recipients'] as $recipient) {
            $encrypted_key = self::getRecipientEncryptedKey($recipient);
            $recipient_headers = self::getRecipientHeaders($recipient);

            $jwe = $jwe->addRecipientWithEncryptedKey($encrypted_key, $recipient_headers);
        }

        return $jwe;
    }