Initialize and add a resource to the collection

@param integer $i
@param array $data
424143
protected function setResource($i, $data) {
    $this->resources[$i] = new static::$resourceClass($this->client, $this->parent, $data);
  }
1287465
protected function addData($key, $data = null)
    {
        $this->data[self::RS_KEY_DATA]->{$key} = $data;
    }
224710
public void put(int[] data) {
    final int l = data.length;
    for(int i = 0; i < l; i++) {
      put(data[i]);
    }
  }
676903
public function initializeDataSourceManager()
    {
        $dataSources = $this->dataSourceObjectBackend->loadObject();
        if (!is_array($dataSources)) {
            $dataSources = array();
        }
    
        $this->dataSources = $dataSources;
    }
307476
public function initialize(array $initialData = []) : void
    {
        if ($this instanceof PropertyLimitable) {
            $initialData = array_intersect_key($initialData, array_fill_keys($this->concreteAttributes(), true));
        }
        $this->entityInitialize($initialData);
    }
378536
private function setData(array $data)
    {
        $_documentClass = $this->_documentClass;
        $_edgeClass = $this->_edgeClass;

        if (isset($this->_options[self::ENTRY_FLAT]) && $this->_options[self::ENTRY_FLAT]) {
            $this->_result = $data;
        } else {
            $this->_result = [];

            if ($this->_options[self::ENTRY_TYPE] === Collection::TYPE_EDGE) {
                foreach ($data as $row) {
                    $this->_result[] = $_edgeClass::createFromArray($row, $this->_options);
                }
            } else {
                foreach ($data as $row) {
                    $this->_result[] = $_documentClass::createFromArray($row, $this->_options);
                }
            }
        }
    }
778852
public function update(array $data, array $identifiers)
    {
        $this->getConnection()->update(
            $this->getTableName(),
            $data,
            $identifiers
        );
    }
427723
public function initialize(array $data = array())
    {
        if($this->exe->flash->has('form_data'))
            $this->set($this->exe->flash->get('form_data'));

        parent::initialize($data);
    }
1214328
private void add(Iterable<?> data) {

    for (Object el : data) {
      try {
        add(SoyData.createFromExistingData(el));

      } catch (SoyDataException sde) {
        sde.prependIndexToDataPath(list.size());
        throw sde;
      }
    }
  }
911039
public function setData($data = [])
    {
        if (!is_array($data) && is_string($data)) {
            $data = parse_str($data);
        }
        if (count($data) == 0) {
            $this->data = [];
        } else {
            $this->data = $data;
        }
        $this->debug->debug(__FUNCTION__, 'Data into Request: ', $this->data);
    }
350863
public function initFromArray(array $data) {

        $this->traitInitFromArray($data);

        if (!empty($data['funding'])) {
            $this->setFunding((new FundingPart())->initFromArray($data['funding']));
        }

        if (!empty($data['margin_call'])) {
            $this->setMarginCall((new MarginCallPart())->initFromArray($data['margin_call']));
        }

        if (!empty($data['accounts'])) {

            $this->setAccounts([]);

            foreach ($data['accounts'] as $currency => $details) {
                $details['currency'] = $currency;
                $this->accounts[] = (new AccountPart())->initFromArray($details);
            }

        }

        if (!empty($data['position'])) {
            $this->setPosition((new PositionPart())->initFromArray($data['position']));
        }

        return $this;

    }
233030
public function set(array $data)
    {
        $this->data = [];
        $this->replace = false;

        foreach ($data as $key => $value) {
            $this->add($key, $value);
        }
    }
14844
public function prepend($data, $whence = null, $whence_index = null)
    {
        $this->data = $this->prependSegment(
            $this->data,
            $this->validate($data),
            $whence,
            $whence_index
        );
    }
138067
public function initFromArray(array $data) {

        $this->traitInitFromArray($data);

        if (!empty($data['total'])) {
            $this->setTotal((new LimitAmount())->initFromArray($data['total']));
        }

        if (!empty($data['remaining'])) {
            $this->setRemaining((new LimitAmount())->initFromArray($data['remaining']));
        }

        return $this;

    }
1221185
public function init($data = null)
    {
        if ($this->initialized) {
            return $this;
        }

        if (is_null($data)) {
            $data = $this->fetchData();
        }

        if ($this->isInitialized($data)) {
            $this->initialized = true;
        }

        $this->data = $data;
        if ($this->initialized) {
            $this->onData($data);
        }

        return $this;
    }
787282
public function setFromArray(array $data): void
    {
        foreach ($data as $key => $value) {
            $this->container[$key] = $value;
        }
    }
548375
public function __SET($name, $data){
		if (is_array($data)) {
			foreach ($data as $name => $value) {
				$this->_data[$name] = $this->clearData($value);
			}
		} else {
			$this->_data[$name] = $this->clearData($data);
		}
	}