activate ( )
inherited

Activates a newly created exchange, with new structures required.

Creates all the additional structures an exchange needs in order to be operative. This includes:

  • default limit chain And sets up the active flag to this exchange. Exchange needs to be saved after this call so the state flag persists.
1643  {
1644  $es = new IcesSerializer('CesBankExchange');
1645  // Setup default limit chain.
1646  if (empty($this->limitchain)) {
1647  // Create default limit chain.
1648  $record = array(
1649  'exchange' => $this->id,
1650  'name' => 'default',
1651  );
1652  $ls = new IcesSerializer('CesBankLimitChain');
1653  $def_limit_chain = $ls->loadFromRecord($record);
1654  $ls->save($def_limit_chain);
1655  // Update this exchange with the default limit chain.
1656  $this->limitchain = $def_limit_chain->id;
1657  $es->updateField($this, 'limitchain');
1658  }
1659  $this->state = CesBankExchange::STATE_ACTIVE;
1660  }
Loads and saves to db objects of class IcesDBObject.
Definition: common.db.logic.inc:17