@param array $priceData
@param string $key
@param string $value

@return array
496679
protected function addPriceDataValue(array $priceData, string $key, string $value): array
    {
        if (empty($value)) {
            return $priceData;
        }

        $priceData[$key] = $this->utilEncodingService->decodeJson($value, true);

        return $priceData;
    }
55375
protected function getRegularValues($data, $key, array $keys) {
        $values = [];

        if (count($keys) === 0) {
            $values[$key] = $this->propertyReader->getProperty($data, $key);
        }

        if (count($keys) > 0) {
            $value = $this->propertyReader->getProperty($data, $key);
            $nestedValues = $this->getValues($value, $keys);

            foreach ($nestedValues as $nestedKey => $nestedValue) {
                $values[$this->buildKey($key, $nestedKey)] = $nestedValue;
            }
        }

        return $values;
    }
132641
public static function addSharedToArgs($arguments = [], $value, $key = null) {
        /** @var SharedDataInterface $instance */
        if (($instance = static::instanceFromArguments($arguments)) === null) {
            return null;
        }
        return $instance->addData($value, $key);
    }
184061
protected function makeRows($group, $key, $value): array
    {
        $rows = [];

        if (is_array($value)) {
            foreach ($value as $subKey => $subValue) {
                $rows[] = [
                    'key'   => $group . '.' . $key . '.' . $subKey,
                    'value' => $subValue,
                ];
            }
        } else {
            $rows[] = [
                'key'   => $group . '.' . $key,
                'value' => $value,
            ];
        }

        return $rows;
    }
782585
public static function gets(array &$data, array $needKeys = [], $unsetKey = false): array
    {
        $needed = [];

        foreach ($needKeys as $key => $default) {
            if (\is_int($key)) {
                $key = $default;
                $default = null;
            }

            if (isset($data[$key])) {
                $value = $data[$key];

                if (\is_int($default)) {
                    $value = (int)$value;
                } elseif (\is_string($default)) {
                    $value = \trim($value);
                } elseif (\is_array($default)) {
                    $value = (array)$value;
                }

                $needed[$key] = $value;

                if ($unsetKey) {
                    unset($data[$key]);
                }
            } else {
                $needed[$key] = $default;
            }
        }

        return $needed;
    }
432836
public function pairs($key, $value)
	{
		$this->select([$key, $value]);

		$query = $this->compiler->select();

		return $this->connection->pairs($query['sql'], $query['params']);
	}
507124
public function setData($key, $value = null)
    {
        if (is_array($key)) {
            foreach ($key as $key => $value) {
                if (!is_array($value) && !is_object($value)) {
                    $this->$key = $value;
                }
            }
        } else {
            $this->$key = $value;
        }

        return $this;
    }
279261
public function loadChoicesForValues(array $values, $value = null)
    {
        @trigger_error(sprintf('The "%s()" method is deprecated since Symfony 4.1, use the "choice_loader" option instead.', __METHOD__), E_USER_DEPRECATED);

        // Optimize
        $values = array_filter($values);
        if (empty($values)) {
            return [];
        }

        return $this->loadChoiceList($value)->getChoicesForValues($values);
    }
532983
public static function getValueFromArray(array $sourceData, $key, $isRequired, $defaultValue)
    {
        if (\array_key_exists($key, $sourceData)) {
            return $sourceData[$key];
        }

        if ($isRequired) {
            throw new HttpException(
                sprintf('missing required field "%s"', $key),
                400
            );
        }

        return $defaultValue;
    }
848846
private function handleNestedValue($key, $value, $setOnlyIfNotExists)
    {
        $array = $this->val();
        if (strpos($key, '.') !== false) {
            $keys = explode('.', trim($key, '.'), 2);
            if (!isset($array[$keys[0]])) {
                $array[$keys[0]] = [];
            }
            $targetArray = new ArrayObject($array[$keys[0]]);
            $targetArray->keyNested($keys[1], $value, $setOnlyIfNotExists);
            $this->keyNested($keys[0], $targetArray->val());
        } else {
            $array[$key] = $value;
            $this->val($array);
        }
    }
321472
public function fetchPairs($key, $value = NULL) {
		$return = array();
		foreach ($this as $row) {
			$return[$row->$key] = $value ? $row->$value : $row->$key;
		}
		return $return;
	}
1075304
public static function getBy($key, $val, $compare = '=', $args = array(), $load_terms = true)
    {
        $instance = Post\Factory::create(get_called_class());

        // Hack to handle fields like post_date, post_title, etc.
        if (!in_array($key, static::getCoreFieldKeys())) {
            $args = array_merge($args, array(
                'meta_query'=>array(
                    array(
                        'key'=>$key,
                        'compare'=>$compare,
                        'value'=>$val
                    )
                ),
            ));
            return static::getWhere($args, $load_terms);
        }

        $orderby = (array_key_exists('orderby', $args) && in_array($args['orderby'], static::getCoreFieldKeys()))
            ? $args['orderby']
            : 'p.post_date';
        $order = (array_key_exists('order', $args) && in_array(strtoupper($args['order']), array('ASC', 'DESC')))
            ? $args['order']
            : 'DESC';

        // First we are going to get the post IDs for matching records.
        // Then we will append that to our $args so that the remaining filters (if applicable) can be applied
        global $wpdb;
        $sql = sprintf(
            "SELECT p.ID
            FROM $wpdb->posts p
            WHERE p.post_type = %s
            AND (p.post_status = %s)
            AND %s %s %s
            ORDER BY %s %s
            %s",
            '%s',
            '%s',
            $key,
            $compare,
            '%s',
            $orderby,
            $order,
            (array_key_exists('numberposts', $args))
                ? sprintf("LIMIT %d", (int) $args['numberposts'])
                : null
        );
        $prepared_sql = $wpdb->prepare(
            $sql,
            $instance->getPostType(),
            (array_key_exists('post_status', $args)) ? $args['post_status'] : 'publish',
            $val
        );
        $results = $wpdb->get_results($prepared_sql);
        if (!Arr::iterable($results)) {
            return $results;
        }

        $post_ids = Collection::pluck($results, 'ID');
        if (!Arr::iterable($args)) {
            return Post\Factory::createMultiple($post_ids, $load_terms);
        }

        if (array_key_exists('post__in', $args)) {
            $args = (is_array($args)) ? $args : array_map('trim', explode(',', $args));
            $args['post__in'] = array_merge($args['post__in'], $post_ids);
        } else {
            $args['post__in'] = $post_ids;
        }

        return static::getWhere($args, $load_terms);
    }
713522
protected function __storeData($key, $value = null)
    {
        if (property_exists($this, $key)) {
            $this->$key = $value;
        }
        else {
            parent::__storeData($key, $value);
        }
    }
699085
protected function arrayValue($key, $arrayKey, $value = null)
    {
        $array = $this[$key];
        $is = is_array($array);
        if (null !== $value) {
            if (!$is) {
                $array = array_key_exists($key, self::DEFAULTS)
                    ?self::DEFAULTS[$key]
                    :$this::DEFAULTS[$key];
            }
            $array[$arrayKey] = $value;
            $this[$key] = $array;
            return null;
        } else {
            return $is && isset($array[$arrayKey])
                ?$array[$arrayKey]
                :null;
        }
    }
268396
public static function remapArrData($data, $key, $value)
    {
        /*
        Array
        (
            [1] => Array
                (
                    [value] => 1
                    [name] => NotSet
                    [label] => N/A
                )

            [2] => Array
                (
                    [value] => 2
                    [name] => Other
                    [label] => Altele
                )
        )
        remapped by (value/name):
        Array
        (
            1 => NotSet,
            2 => Other
        )
        */

        $result = [];
        foreach ($data as $item) {
            $result[$item[$key]] = $item[$value];
        }

        return $result;
    }
804293
public static function &filterArrayByKey( $key, $val, &$array ) {

        $newArray = array();
        foreach ( $array as $value ) {

            if ( $value[$key]  == $val
                || (is_array($val) && in_array($value[$key], $val)) )
                $newArray[] = $value;

        }
        return $newArray;
    }
1319475
protected function getValue( $key, $value = null )
	{
		if( is_null( $value ) && isset( $this->args[$key] )) {
			$value = $this->args[$key];
		}
		return $value;
	}