Add a suffix to each key.

@param mixed $prefix

@return static
<p>(Immutable) Return an Arrayy object, with the prefixed keys.</p>
496325
public function appendToEachKey($prefix): self
    {
        // init
        $result = [];

        foreach ($this->getGenerator() as $key => $item) {
            if ($item instanceof self) {
                $result[$prefix . $key] = $item->appendToEachKey($prefix);
            } elseif (\is_array($item)) {
                $result[$prefix . $key] = self::create($item, $this->iteratorClass, false)
                    ->appendToEachKey($prefix)
                    ->toArray();
            } else {
                $result[$prefix . $key] = $item;
            }
        }

        return self::create($result, $this->iteratorClass, false);
    }
896126
public function prefix($prefix)
    {
        $this->uri = trim($prefix, '/') .'/' .trim($this->uri, '/');

        return $this;
    }
634895
public static function addEachKey(array $array, $prefix): array
    {
        $result = [];

        foreach ($array as $key => $item) {
            $result[$prefix . $key] = $item;
        }

        return $result;
    }
957087
public function addResource($resource, $prefix = null)
    {
        $this->resources[] = [$resource, $prefix, true];

        return $this;
    }
427374
public function setPattern(
        $prefix    = self::PATTERN_PREFIX,
        $date      = self::PATTERN_DATE,
        $extension = self::PATTERN_EXTENSION
    ) {
        $this->setPrefixPattern($prefix);
        $this->setDatePattern($date);
        $this->setExtension($extension);

        return $this;
    }
433168
public function prefix(string $prefix): Route
	{
		if(!empty($prefix))
		{
			$this->prefix .= '/' . trim($prefix, '/');
		}

		return $this;
	}
856398
public function find_by_prefix($prefix) {
        $return = [];
        foreach ($this->find_all() as $key) {
            if (strpos($key, $prefix) === 0) {
                $return[] = $key;
            }
        }
        return $return;
    }
978687
public static function prefix($prefix = null)
	{
		if(null !== $prefix)
		{
			self::$prefix = $prefix;
		}
		return self::$prefix;
	}
840165
public function setCachePrefix($prefix) {
		if (empty($prefix)) {
			$this->prefix = null;
			return;
		}
		
		$prefix = strtolower($prefix);
		
		if (preg_match('/[^0-9a-z_]+/', $prefix)) {
			throw new NoPath('Forbidden symbols used in the prefix');
		}
		
		$this->prefix = $prefix;
	}
629885
public function startsWith($prefix)
    {
        if (\is_array($prefix)) {
            /** @noinspection ForeachSourceInspection */
            foreach ($prefix as $item) {
                $this->startsWith($item);
            }
        } else {
            $this->assertNotBlanks($prefix);
            $this->predicates[] = $this->processValue($prefix) . '*';
        }

        return $this;
    }
257325
public function setSuffix($suffix)
    {
        $suffix = ltrim((string) $suffix, '.');
        $this->suffix = '.' . $suffix;
        return $this;
    }
763690
public function withColumnsPrefixedBy(string $prefix) : Table
    {
        $columns = [];
        foreach ($this->columns as $column) {
            $columns[] = $column->withPrefix($prefix);
        }

        $indexes = [];
        foreach ($this->indexes as $index) {
            $indexes[] = $index->withColumnsPrefixedBy($prefix);
        }

        $foreignKeys = [];
        foreach ($this->foreignKeys as $foreignKey) {
            $foreignKeys[] = $foreignKey->withLocalColumnsPrefixedBy($prefix);
        }


        return new self(
            $this->name,
            $columns,
            $indexes,
            $foreignKeys
        );
    }
1086403
public function setPrefix($prefix)
    {
        foreach ($this->storage as &$path) {
            $path->setPrefix((string) $prefix);
        }

        return $this;
    }
20894
private function applyPrefix(array $array, $prefix = null)
    {
        if ($prefix === null) {
            return $array;
        }

        $result = [];
        foreach ($array as $key => $value) {
            $result[$prefix . self::PREFIX_GLUE . $key] = $value;
        }

        return $result;
    }
637609
public function prependPrefix($prefix)
  {
    $this->deletePrefix($prefix);
    
    $prepend = array($prefix => $prefix);
    $this->_prefixes = array_merge($prepend, $this->_prefixes);
  }
944674
public function getByPrefix($prefix)
    {
        if (!array_key_exists($prefix, $this->prefixed)) {
            return array();
        }

        $services = array();
        foreach ($this->prefixed[$prefix] as $id) {
            $services[] = $this->get($id);
        }

        return $services;
    }
458503
public function prefix($prefix = null)
	{
		if (null !== $prefix)
		{
			$this->prefix = $prefix;
		}
		return $this->prefix;
	}