@param array $data

@return Instruction
552260
public static function createFromData(array $data): self
    {
        if (!isset($data['method'])) {
            throw new DomainException(self::REQUIRED_METHOD);
        }

        switch ($data['method']) {
            case self::METHOD_ACCOUNT_WEIGHTS:
                $instruction = new AccountWeights($data);

                break;
            case self::METHOD_ACQUIRER_WEIGHTS:
                $instruction = new AcquirerWeights($data);

                break;
            default:
                throw new DomainException(
                    sprintf(self::UNEXPECTED_METHOD, implode(', ', self::methods()))
                );
        }

        return $instruction;
    }
469763
public function create(array $data)
    {
        $url = $this->getUrl('create');
        $request = urldecode(json_encode($data, JSON_UNESCAPED_UNICODE));
        $json = $this->curl->post($url, $request);

        return $json;
    }
800439
public function register(array $data): PodiumResponse
    {
        $registration = $this->getRegisterer();

        if (!$registration->loadData($data)) {
            return PodiumResponse::error();
        }

        return $registration->register();
    }
928442
public function fromData(array $data): ModuleConfiguration
    {
        $moduleConfiguration = new ModuleConfiguration();
        $moduleConfiguration
            ->setId($data['id'])
            ->setAutoActive($data['autoActive'])
            ->setTitle($data['title'])
            ->setDescription($data['description'])
            ->setLang($data['lang'])
            ->setThumbnail($data['thumbnail'])
            ->setAuthor($data['author'])
            ->setUrl($data['url'])
            ->setEmail($data['email'])
        ;

        if (isset($data['settings'])) {
            $this->setSettings($moduleConfiguration, $data['settings']);
        }

        return $moduleConfiguration;
    }
199779
protected function prepareFooter(array $data)
    {
        $footer = [];

        foreach ($data as $date => $levels) {
            foreach ($levels as $level => $count) {
                if ( ! isset($footer[$level])) {
                    $footer[$level] = 0;
                }

                $footer[$level] += $count;
            }
        }

        return $footer;
    }
1036680
public function setData(array $data)
    {
        foreach ($data as $key => $val) {
            $setter = $this->setter($key);
            if (is_callable([ $this, $setter ])) {
                $this->{$setter}($val);
            } else {
                $this->{$key} = $val;
            }
        }

        return $this;
    }
564136
public function set(array $data)
    {
        foreach ($data as $key => $value) {
            if (method_exists($this, 'set' . $key)) {
                $this->{'set' . $key}($value);
            } else if ($this->customParamsPrefix . $this->shopCommissionCustomParamKey === $key) {
                $this->setShopCommission($value);
            } else if (0 === strpos($key, $this->customParamsPrefix)) {
                $this->setCustomParam(substr($key, 4), $value);
            }
        }

        $this->auth->set($data);
        $this->client->set($data);

        return $this;
    }
194987
public function updateTranslation(array $data)
    {
        $translation = $this->translations()->where([
            'record_id' => $this->id,
            'language_code' => Arr::get($data, 'language_code'),
        ])->first();

        if (is_null($translation)) {
            $translation = $this->translations()->create($data);
        } else {
            $translation->update($data);
        }

        return $translation;
    }
540251
public static function buildDeEmojiData(array $data)
    {
        foreach ($data as $key => $value) {
            if (is_array($value)) {
                $data[$key] = self::buildDeEmojiData($value);
            } elseif (is_string($value)) {
                $data[$key] = self::emojiDecode($value);
            } else {
                $data[$key] = $value;
            }
        }
        return $data;
    }
1294887
public function setData(array $data)
    {
        foreach ($data as $name => $value) {
            if (is_string($name)) {
                $this->__set($name, $value);
            }
        }

        return $this;
    }
206343
public function initFromArray(array $data) {

        $this->traitInitFromArray($data);

        if (!empty($data['details'])) {
            $this->setDetails((new LedgerDetailsPart())->initFromArray($data['details']));
        }

        return $this;

    }
1361758
protected function fromArray( array $data )
	{
		$manager = \Aimeos\MShop::create( $this->getContext(), 'supplier' );

		if( isset( $data['supplier.id'] ) && $data['supplier.id'] != '' ) {
			$item = $manager->getItem( $data['supplier.id'], $this->getDomains() );
		} else {
			$item = $manager->createItem();
		}

		$item->fromArray( $data, true );

		return $item;
	}
369268
public function factory(array $data = [])
    {
        $model = $this->newQuery()->getModel()->newInstance();

        $this->setModelData($model, $data);

        return $model;
    }
118236
public function setData(array $data)
    {
        $data = $this->setIdFromData($data);

        parent::setData($data);
        return $this;
    }
1151601
public static function fromArray(array $data)
    {
        return new PhpCsFixer(
            new Undefined(false),
            new Enabled($data['enabled']),
            PhpCsFixerLevelsFactory::fromArray($data['levels']),
            new PhpCsFixerOptions(isset($data['options']) ? $data['options'] : null)
        );
    }
1247915
public static function createFromArray(array $data)
    {
        $self = new self();

        if (isset($data['id'])) {
            $self->setId($data['id']);
        }
        if (isset($data['name'])) {
            $self->setName($data['name']);
        }
        if (isset($data['code'])) {
            $self->setCode($data['code']);
        }

        return $self;
    }
140406
private function createClassItem(array $data) {
    $classItem = [
      'class_id' => $data['id'],
      'category' => $data['category'],
      'location' => $data['location'],
      'title' => $data['title'],
      'description' => $this->getDescription($data),
      'start_date' => $this->getStartDate($data),
      'end_date' => $this->getEndDate($data),
      'recurring' => 'weekly',
      'studio' => $data['studio'],
      'instructor' => strip_tags($data['instructor']),
      'patterns' => [
        'day' => $this->getDay($data),
        'start_time' => $this->getStartTime($data),
        'end_time' => $this->getEndTime($data),
      ],
    ];

    return $classItem;
  }