Convert lazy-set format to zend-form compatible array format

@param string $id
@return array
320613
public function lazySet(array $sets)
    {
        $config = $this->config();

        if (!array_key_exists('lazy-set', $config) || !is_array($config['lazy-set'])) {
            throw new \Exception('Config with key "lazy-set" does not exist or incorrect data type given in '.__NAMESPACE__);
        }
        $lazySetConfig = $config['lazy-set'];
        foreach ($sets as $set) {
            if (!array_key_exists($set, $lazySetConfig)) {
                throw new \Exception('"lazy-set" with name "'.$set.'" does not exist in '.__NAMESPACE__);
            }
        }
        $lazySets = array();
        foreach ($sets as $setIdentifier) {
            $lazySet = $lazySetConfig[$setIdentifier];
            foreach ($lazySet as $type => $set) {
                if (!is_array($set)) {
                    $lazySet[$type] = $set;
                    continue;
                }
                foreach ($set as $index => $attribute) {
                    $deepArray = !in_array($type, $this->deepArrayFalse);
                    $value = $this->configParser($type, $attribute);
                    if (empty($value)) {
                        $value = array();
                    }
                    if ($deepArray) {
                        $lazySet[$type][$index] = $value;
                    } else {
                        $lazySet[$type] = $value;
                    }
                }
            }
            $lazySets = array_merge_recursive($lazySet, $lazySets);
        }
        return $lazySets;
    }
1370685
public function get($id = null) {
		if (empty($id)) {
			return false;
		}

		$fields = [
			$this->alias . '.id',
			$this->alias . '.value',
		];
		$blockExists = $this->hasField('block');
		if ($blockExists) {
			$fields[] = $this->alias . '.block';
		}
		$conditions = [$this->alias . '.id' => $id];
		$this->recursive = -1;

		return $this->find('first', compact('fields', 'conditions'));
	}
997155
public function getTree($id = null) {
        $parent = $this->getConfig('parentField');
        $left = $this->getConfig('leftField');
        $right = $this->getConfig('rightField');

        $query = $this->getRepository()->select()->orderBy($left, 'asc');

        if ($id) {
            if ($parentNode = $this->getNode($id)) {
                $query->where($left, 'between', [$parentNode[$left], $parentNode[$right]]);
            } else {
                return [];
            }
        }

        $nodes = $query->all();

        if ($nodes->isEmpty()) {
            return [];
        }

        $map = [];
        $stack = [];
        $pk = $this->getRepository()->getPrimaryKey();

        foreach ($nodes as $node) {
            if ($node[$parent] && $node[$pk] != $id) {
                $map[$node[$parent]][] = $node;
            } else {
                $stack[] = $node;
            }
        }

        $results = $this->mapTree($stack, $map);

        if ($id) {
            return $results[0];
        }

        return $results;
    }
946788
public function getMany(array $id) {
		if (! $this->connectionCheckStatus) {
			$this->addServer();
		}
		
		$preparedIds = array_map([$this, 'prepareId'], $id);
		$result      = $this->getClient()->get($preparedIds);
		
		if ($this->namespace === null) {
			return $result;
		}
		
		$ids = array_intersect_key(array_combine($preparedIds, $id), $result);
		return array_combine(array_values($ids), array_values($result));
	}
1247243
public static function read_template($id) {
        global $PAGE;

        $params = self::validate_parameters(self::read_template_parameters(), array('id' => $id));
        $template = api::read_template($params['id']);
        self::validate_context($template->get_context());
        $output = $PAGE->get_renderer('core');

        $exporter = new template_exporter($template);
        $record = $exporter->export($output);
        return $record;
    }
213059
public function getChildren($id): array
    {
        $result = [];
        $childrenIds = (array)($this->childrenIds[$id] ?? []);
        foreach ($childrenIds as $childId) {
            if ($child = $this->getItem($childId)) {
                $result[$childId] = $child;
            }
        }
        return $result;
    }
1333462
protected function prepareUniqueId($id)
    {
        if (preg_match('/\[(.*)\]/', $id, $matches)) {
            $id = $this->getValue($matches[1]);
        }

        if (strtolower($id) === 'null') {
            $id = null;
        }

        if (filter_var($id, FILTER_VALIDATE_INT) !== false) {
            $id = (int) $id;
        }

        return $id;
    }
173052
public function read( $id ) {

		$id = $this->getKey( $id );

		// If possible use the raw data from the internal cache
		// without unserialization
		if ( $this->internalCache->contains( $id ) ) {
			$data = $this->internalCache->fetch( $id );
		} elseif ( $this->cache->contains( $id ) ) {
			$data = unserialize( $this->cache->fetch( $id ) );
			$this->internalCache->save( $id, $data );
		} else {
			$data = array();
		}

		$container = new Container( $id, (array)$data );
		$container->setExpiryInSeconds( $this->expiry );

		return $container;
	}
1144126
public static function getIdValue(array $id) 
    {
        self::formatScalarValues($id);
        if (\is_array($id)) {
            RecursiveDeleteHelper::deleteKeys($id, [Serializer::CLASS_IDENTIFIER_KEY]);
        }

        return $id;
    }
471455
protected function prepareId($id) {
		if (! is_scalar($id)) {
			$id = json_encode($id);
			
			if (isset($id[33])) {
				$id = md5($id);
			}
		}
		
		if ($this->namespace === null) {
			return $id;
		}
		
		return $this->namespace . '_' . $id;
	}
1075579
protected function scopedInfo(/*# string */ $id)/*# : array */
    {
        // split into raw id and scope (if any)
        list($rawId, $scope) = $this->splitId($id);

        // use the default scope if no scope given
        if (empty($scope)) {
            // use the default
            $scope = $this->default_scope;

            // honor predefined scope over the default
            $def = $this->getResolver()->getService($rawId);
            if (is_array($def) && isset($def['scope'])) {
                $scope = $def['scope'];
            }
        }

        return [$rawId, $scope];
    }
505628
public function read( $id )
	{
		$this->inital_session_id = $id;
		
		if ( $data = \DB::select( $this->table )->where( 'id', $id )->one( $this->database ) )
		{
			$session_data = unserialize( $data->content );
			
			foreach( $this->index_fields as $field ) 
			{
				$session_data[$field] = $data->$field;
			}
			
			return $session_data;
		}
		
		return array();
	}
1133444
public static function getFormatById($id)
    {
        // Note: The format() method does not localize results, so these
        // format codes are _not_ wrapped in gettext calls.

        switch ($id) {
            case self::DF_MDY:
                return 'm/d/y';
            case self::DF_MDY_SHORT:
                return 'mdy';
            case self::DF_DATE:
                return 'F j, Y';
            case self::DF_DATE_LONG:
                return 'l, F j, Y';
            case self::DF_DATE_TIME:
                return 'F j, Y g:i a';
            case self::DF_DATE_TIME_LONG:
                return 'l, F j, Y g:i a';
            case self::DF_TIME:
                return 'g:i a';
            case self::DF_DATE_SHORT:
                return 'M j, Y';
            case self::DF_DATE_SHORT_NOYEAR:
                return 'M j';
            case self::DF_DATE_TIME_SHORT:
                return 'M j, Y g:i a';
            case self::DF_DATE_TIME_SHORT_NOYEAR:
                return 'M j, g:i a';
            case self::DF_MY:
                return 'F Y';
            case self::DF_CC_MY:
                return 'm / Y';
            case self::DF_Y:
                return 'Y';
            case self::DF_ISO_8601_BASIC:
                return 'Ymd\THis';
            case self::DF_ISO_8601_EXTENDED:
                return 'Y-m-d\TH:i:s';
            case self::DF_RFC_2822:
                return 'r';
            default:
                throw new Exception("Unknown date format id '$id'.");
        }
    }
92202
public function result($id): array
    {
        $options = ['query' => ['id' => $id]];

        /** @var JsonStream $stream */
        $stream = $this->client
            ->get(UserApi::generateUrl('csv/result.json'), $options)
            ->getBody();

        return $stream->jsonSerialize();
    }
1131576
public function normalizeID($id)
    {
        $primary_keys = $this->getPrimaryKey();

        if (!is_array($id)) {
            $key = $primary_keys[0];
            $id = [$key => $id];
        }

        $result = [];
        foreach ($primary_keys as $key) {
            if (!isset($id[$key])) {
                throw new Exception\UnexpectedPropertyValueException('Illegal id value');
            }

            $result[$key] = $id[$key];
        }

        return $result;
    }
103950
public function read($id)
    {
        $return = '';

        $rows = call_user_func_array(array(&$this, 'find'), $this->_getPrimary($id));

        if (count($rows)) {
            if ($this->_getExpirationTime($row = $rows->current()) > time()) {
                $return = $row->{$this->_dataColumn};
            } else {
                $this->destroy($id);
            }
        }

        return $return;
    }
1232178
public function convertToRconData($id)
    {
        $idAndTypePacked = pack('VV', $id, $this->type);
        $endOfMessage    = chr(0) . chr(0);

        $message = $idAndTypePacked . $this->body . $endOfMessage;

        $data = pack("V", strlen($message)) . $message;

        return $data;
    }