Get an array of the primary keys of all the objects in the collection

@param  boolean $usePrefix
@return array   The list of the primary keys of the collection
188999
public function getPrimaryKeys($usePrefix = true)
    {
        $ret      = [];
        $callable = [$this->getTableMapClass(), 'getPrimaryKeyFromRow'];

        foreach ($this as $key => $element) {
            $key       = $usePrefix ? ($this->getModel() . '_' . $key) : $key;
            $ret[$key] = call_user_func($callable, array_values($element));
        }

        return $ret;
    }
456220
private static List<String> getVariantKeys(String variantKeyPrefix, Collection<String> variants) {

		List<String> variantKeys = new ArrayList<>();
		for (String variant : variants) {
			if (variant == null) {
				variant = "";
			}
			if (variantKeyPrefix == null) {
				variantKeys.add(variant);
			} else {
				variantKeys.add(variantKeyPrefix + variant);
			}
		}

		return variantKeys;
	}
100102
public function map($callback, $useKeys = true)
    {
        $keys = $this->keys();

        if ($keys instanceof Collection) {
            $keys = $keys->dump();
        }

        if ($useKeys) {
            $result = array_map($callback, $this->convertArray(clone $this), $keys);
        } else {
            $result = array_map($callback, $this->convertArray(clone $this));
        }

        // Keep keys same as origin
        return $this->bindNewInstance(array_combine($keys, $result));
    }
1048078
public function getOptionNames($sPrefix)
    {
        $sPrefix = trim((string)$sPrefix);
        $sPrefix = rtrim($sPrefix, '.') . '.';
        $sPrefixLen = strlen($sPrefix);
        $aOptions = [];
        foreach($this->aOptions as $sName => $xValue)
        {
            if(substr($sName, 0, $sPrefixLen) == $sPrefix)
            {
                $iNextDotPos = strpos($sName, '.', $sPrefixLen);
                $sOptionName = $iNextDotPos === false ? substr($sName, $sPrefixLen) :
                    substr($sName, $sPrefixLen, $iNextDotPos - $sPrefixLen);
                $aOptions[$sOptionName] = $sPrefix . $sOptionName;
            }
        }
        return $aOptions;
    }
1217366
protected function getPrefixKeys()
    {
        $options = $this->pubsub->getClient()->getOptions();

        if (isset($options->prefix)) {
            return $options->prefix->getPrefix();
        }

        return '';
    }
1009170
public function toArray($useIdentifierKeys = null)
    {
        $originalUseIdentifierKeys = $this->useIdentifierKeys;
        $useIdentifierKeys = isset($useIdentifierKeys) ? (boolean) $useIdentifierKeys : $this->useIdentifierKeys;
        $cursor = $this;

        /* Let iterator_to_array() decide to use keys or not. This will avoid
         * superfluous RiakCursor::info() from the key() method until the
         * cursor position is tracked internally.
         */
        $this->useIdentifierKeys = true;

        $results = $this->retry(function() use ($cursor, $useIdentifierKeys) {
            return iterator_to_array($cursor, $useIdentifierKeys);
        }, true);

        $this->useIdentifierKeys = $originalUseIdentifierKeys;

        return $results;
    }
1346639
public static function toKeyIndex($collection, $key, $useDotSyntax = false)
    {
        $keyIndexArray = [];
        foreach ($collection as $item) {
            $itemArray = is_array($item) ? $item : (method_exists($item, 'toArray') ? $item->toArray() : []);
            $keyValue = self::get($itemArray, $key, null, $useDotSyntax);
            $keyIndexArray[$keyValue] = $itemArray;
        }

        return $keyIndexArray;
    }
1076374
protected function _getPrimaryKeyValues($useDirty = true)
    {
        $primary = array_flip($this->_table->getPrimaryKey());
        if ($useDirty) {
            $array = array_intersect_key($this->_data, $primary);
        } else {
            $array = array_intersect_key($this->_cleanData, $primary);
        }
        if (count($primary) != count($array)) {
            throw new Kwf_Exception("The specified Table does not have the same primary key as the Row");
        }
        return $array;
    }
265659
public function getPk($table, $tablePrefix = null)
    {
        $rows = $this->getDbFields($table, $tablePrefix);
        foreach ($rows as $val) {
            if ($val['primary']) {
                return $val['name'];
            }
        }
        return false;
    }
116584
public function getDefaultOwner($usePosix = false)
    {
        $defaultPermissions = $this->getDefaultPermissions();

        $owner = $defaultPermissions['user'];
        if (empty($owner) && $usePosix) {
            $owner = function_exists('posix_getuid') ? posix_getuid() : null;
        }

        if (empty($owner)) {
            return false;
        }

        return $owner;
    }
799000
public static function getAllArrayItemsByKeyPrefix($array, $prefix, $stripPrefix = false) {
        $returnValues = array();
        foreach ($array as $key => $value) {
            $positionOfPrefix = strpos($key, $prefix);
            if (is_numeric($positionOfPrefix) && $positionOfPrefix == 0) {
                if ($stripPrefix) $key = substr($key, strlen($prefix));
                $returnValues [$key] = $value;
            }
        }

        return $returnValues;
    }
1102929
public function getImporterKeys($all = false)
    {
        $keys = [];
        if ($all) {
            $keys = $this->importerKeys;
        } else {
            foreach ($this->importerKeys as $key => $bit) {
                if ($bit) {
                    $keys[] = $key;
                }
            }
        }
        return $keys;
    }
426254
public function getPaths($prefix = null)
    {
        if ((null !== $prefix) && is_string($prefix)) {
            $prefix = $this->_formatPrefix($prefix);
            if ($this->_useStaticRegistry) {
                if (isset(self::$_staticPrefixToPaths[$this->_useStaticRegistry][$prefix])) {
                    return self::$_staticPrefixToPaths[$this->_useStaticRegistry][$prefix];
                }

                return false;
            }

            if (isset($this->_prefixToPaths[$prefix])) {
                return $this->_prefixToPaths[$prefix];
            }

            return false;
        }

        if ($this->_useStaticRegistry) {
            return self::$_staticPrefixToPaths[$this->_useStaticRegistry];
        }

        return $this->_prefixToPaths;
    }
1342885
private function addIdPrefix($fields, $idPrefix)
    {
        $result = array();
        foreach ($fields as $key => $field) {
            $newKey = $idPrefix . $key;
            $result[$newKey] = $field;
            if (isset($field['fields'])) {
                $result[$newKey]['fields'] = $this->addIdPrefix($field['fields'], $newKey . '_');
            }
        }
        return $result;
    }
196454
public static function getConstantValuesByPrefix($className, $prefix)
    {
        $prefixLength = strlen($prefix);
        $result = [];

        $reflection = new \ReflectionClass($className);
        foreach ($reflection->getConstants() as $constKey => $constValue) {
            if ($prefix === substr($constKey, 0, $prefixLength)) {
                $result[] = $constValue;
            }
        }

        return $result;
    }
911613
public function getPrimaryKeyList()
    {
        $ids = [];
        if (count($this) > 0) {
            foreach ($this as $row) {
                $ids[] = $row->getPrimaryKeyValue();
            }
        }
        return $ids;
    }
767575
private function getRoutePrefix($routePrefix)
    {
        $prefixes = $this->getRoutePrefixes();
        
        return in_array($routePrefix, $prefixes) ? $routePrefix : array_shift($prefixes);
    }