@param array $array

@return Page
499447
private function newPageFromResult( $array ) {
		if ( array_key_exists( 'pageid', $array ) ) {
			$pageid = $array['pageid'];
			$revisions = $this->getRevisionsFromResult( $array );
		} else {
			$pageid = 0;
			$revisions = new Revisions();
		}

		return new Page(
			new PageIdentifier(
				new Title(
					$array['title'],
					$array['ns']
				),
				$pageid
			),
			$revisions
		);
	}
1300763
protected function doCreateObject(array $array)
    {
        $this->data = $array;
        $this->document = new Document($this->data);
        $this->setFunctionalNames()
             ->setAttributes()
             ->setMedia();

        return $this->document;
    }
409524
public function packMap(array $array)
    {
        $size = count($array);
        $b = '';
        $b .= $this->getMapSizeMarker($size);

        foreach ($array as $k => $v) {
            $b .= $this->pack($k);
            $b .= $this->pack($v);
        }

        return $b;
    }
656206
protected function fromArray(array $array)
    {
        if (is_array($array)) {
            foreach ($array as $index => $element) {
                if (is_array($element)) {
                    $this->xmlWriter->startElement($index);
                    $this->fromArray($element);
                    $this->xmlWriter->endElement();
                } else {
                    $this->xmlWriter->startElement($index);
                    $this->xmlWriter->text($element);
                    $this->xmlWriter->endElement();
                }
            }
        }
    }
15521
public function withHeaders(array $array, int $code = null)
  {
    foreach($array as $field => $i) {
      array_push($this->headers, $field .': '. $i);
    }

    if ($code != null) {
      $this->code = $code;
      header('HTTP/1.1 '.$this->code);
      return $this->send();
    }

    return $this;
  }
838832
public function loadFromArray(array $array)
    {
        if (isset($array['filename'])) {
            $this->filename = $array['filename'];
        }

        if (isset($array['size'])) {
            $this->size = $array['size'];
        }

        if (isset($array['type'])) {
            $this->type = $array['type'];
        }

        if (isset($array['cid'])) {
            $this->cid = $array['cid'];
        }

        if (isset($array['href'])) {
            $this->href = $array['href'];
        }

        return $this;
    }
722743
public function doRefund($array)
    {
        $WSRequest = array(
            'transactionID'   => $array['transactionID'],
            'payment'         => $this->payment($array['payment']),
            'comment'         => $array['comment'],
            'privateDataList' => $this->privateData,
            'details'         => $this->orderDetails,
            'sequenceNumber'  => $array['sequenceNumber']
        );
        return $this->webServiceRequest($array, $WSRequest, self::DIRECT_API, 'doRefund');
    }
1059742
public function toMappedArray(array $array)
    {
        $mappedArray = [];
        foreach ($this->getMapper() as $from => $to) {
            $mappedArray[$to] = $array[$from];
        }
        return $mappedArray;
    }
1123608
public function doRecurrentWalletPayment(array $array)
    {
        $this->formatRequest($array);
        $WSRequest = array(
            'payment'         => $this->payment($array['payment']),
            'orderRef'        => $array['orderRef'],
            'orderDate'       => $array['orderDate'],
            'scheduledDate'   => $array['scheduledDate'],
            'walletId'        => $array['walletId'],
            'cardInd'         => $array['cardInd'],
            'recurring'       => $this->recurring($array['recurring']),
            'privateDataList' => $this->privateData,
            'order'           => $this->order($array['order'])
        );
        return $this->webServiceRequest($array, $WSRequest, self::DIRECT_API, 'doRecurrentWalletPayment');
    }
749329
public function arrayToObject(array $array): \stdClass
    {
        $objResult = new \stdClass();

        foreach ($array as $varKey => $varValue) {
            $objResult->{$varKey} = $varValue;
        }

        return $objResult;
    }
914386
public function copyToArray(array &$array)
    {
        parent::copyToArray($array);

        $array['action']               = LanguageUtility::toString($this->action);
        $array['accessToken']          = $this->accessToken;
        $array['accessTokenExpiresAt'] = LanguageUtility::orZero($this->accessTokenExpiresAt);
        $array['scopes']               = $this->scopes;
        $array['properties']           = LanguageUtility::convertArrayOfArrayCopyableToArray($this->properties);
    }
49997
public static function createFromArray(array $array)
    {
        self::$instance = new Collector;

        self::$instance->buffer = null;

        $spreadsheet = new Spreadsheet();
        $spreadsheet->getActiveSheet()
            ->fromArray(
                $array,  // os dados a adicionar
                NULL     // itens com este valor não serão setados
            );

        self::$instance->buffer = $spreadsheet;

        self::$instance->debug_info = ['created_with' => __METHOD__];

        return self::$instance;
    }
796388
protected function createFromArray($array)
    {
        $this->id = $array['id'];
        $this->modelType = $array['modelType'];
        $this->modelId = $array['modelId'];
        $this->name = $array['name'];
        $this->price = $array['price'];
        $this->image = $array['image'];
        $this->quantity = $array['quantity'];

        return $this;
    }
663573
protected function doCreateObject(array $array)
    {
        $consumerFactor          = new ConsumerFactorHistory($array);
        $consumerFactor->context = json_decode($consumerFactor->context);
        $consumerFactor->factors = json_decode($consumerFactor->factors);

        return $consumerFactor;
    }
948047
protected function serializeArray(array $array) {
        $data = [];

        foreach ($array as $key => $value) {
            if (is_array($value)) {
                $data[$key] = $this->serializeArray($value);
            } else {
                $data[$key] = $this->serializeItem($value);
            }
        }

        return $data;
    }
539626
public static function listToMultiArray($array)
    {
        $nested = [];
        $depths = [];

        foreach ($array as $key => $arr) {

            if ($arr['depth'] == 0) {
                $nested[$key] = $arr;
            } else {
                $parent =& $nested;

                for ($i = 1; $i <= ($arr['depth']); $i++) {
                    $parent =& $parent[$depths[$i]];
                }

                $parent['pages'][$key] = $arr;
            }

            $depths[$arr['depth'] + 1] = $key;
        }

        return $nested;
    }
1012481
static public function sortByKeyRecursive(array $array)
    {
        ksort($array);
        foreach ($array as $key => $value) {
            if (is_array($value) && !empty($value)) {
                $array[$key] = self::sortByKeyRecursive($value);
            }
        }

        return $array;
    }