?c, ?col

@param array $value
@param array $modifiers
@return string
774764
private function replacementC($value, array $modifiers)
    {
        if (!is_array($value)) {
            return $this->implementation->reprCol($this->connection, $value);
        }
        if (isset($value[0])) {
            if ($this->prefix !== null) {
                $t = count($value) - 2;
                if (isset($value[$t])) {
                    $value[$t] = $this->prefix . $value[$t];
                }
            }
            return $this->implementation->reprChainFields($this->connection, $value);
        }
        if (isset($value['col'])) {
            $chain = array();
            foreach (array('db', 'table', 'col') as $f) {
                if (isset($value[$f])) {
                    if (is_array($value[$f])) {
                        $chain = array_merge($chain, $value[$f]);
                    } else {
                        $chain[] = $value[$f];
                    }
                }
            }
            if ($this->prefix !== null) {
                $t = count($chain) - 2;
                if (isset($chain[$t])) {
                    $chain[$t ] = $this->prefix.$chain[$t];
                }
            }
            $result = $this->implementation->reprChainFields($this->connection, $chain);
        } elseif (isset($value['value'])) {
            if (is_int($value['value'])) {
                $result = $this->implementation->reprInt($this->connection, $value['value']);
            } else {
                $result = $this->implementation->reprString($this->connection, $value['value']);
            }
            if (array_key_exists('col', $value) && isset($value['func'])) {
                $result = '';
            } else {
                $value['value'] = null;
            }
        } elseif (isset($value['func'])) {
            $result = '';
        } else {
            throw new DataInvalidFormat('col', 'required `col`, `value` or `func` field');
        }
        if (isset($value['func'])) {
            $result = $value['func'].'('.$result.')';
        }
        if (isset($value['value'])) {
            $result .= (($value['value'] > 0) ? '+' : '').(int)$value['value'];
        }
        if (isset($value['as'])) {
            $result .= ' AS '.$this->implementation->reprCol($this->connection, $value['as']);
        }
        return $result;
    }
35373
public function itemValuetoStringRepresentation($value)
    {
        if (is_bool($value))
        {
            $castedValue = (true === $value) ? 'true' : 'false';
        }
        elseif (is_null($value))
        {
            $castedValue = 'null';
        }
        elseif (is_array($value))
        {
            $castedValue = [];
            foreach ($value as $k => $v)
            {
                $castedValue[$k] = $this->itemValuetoStringRepresentation($v);
            }
        }
        elseif (is_numeric($value))
        {
            $castedValue = (string)$value;
        }
        elseif (is_string($value))
        {
            $castedValue = $value;
        }
        else
        {
            throw new InvalidDataException('Invalid item value type!');
        }

        return $castedValue;
    }
353116
protected function processArrayValue(
        array $value,
        array $settings,
        /*# bool */ $between = false
    )/*# : string */ {
        if ($between) {
            $v1 = $this->processValue($value[0], $settings);
            $v2 = $this->processValue($value[1], $settings);
            return $v1 . ' AND ' . $v2;
        } else {
            $result = [];
            foreach ($value as $val) {
                $result[] = $this->processValue($val, $settings);
            }
            return '(' . join(', ', $result) . ')';
        }
    }
387649
private function generateFormElements($value)
    {
        $form = $label = '';
        $label = Inflector::underscoreToSpace($value['COLUMN_NAME']);
        $form .= "\t\t".'->addElement("label", "'.$label.'", ["class" => "col-sm-2 control-label","style" => "width:100%;"])'.PHP_EOL;

        $form .= "\t\t".'->addElement("text", "'.$value['COLUMN_NAME'].'", ["value" => (isset($this->model->'.$value['COLUMN_NAME'].')) ? $this->model->'.$value['COLUMN_NAME'].' : "", "class" => "form-control"])'.PHP_EOL;

        return $form;
    }
373461
private function convertMultipleColumns(& $values) {
		// regular fields
		foreach ($this->fields as $k => $v) {
			if (!empty($v['options']['multiple_column'])) {
				if (!empty($values[$k])) {
					pk($v['options']['multiple_column'], $values[$k]);
					$values[$k] = array_keys($values[$k]);
				}
			}
		}
		// details
		foreach ($this->detail_fields as $k => $v) {
			if (empty($values[$k]) || !is_array($values[$k])) continue;
			if (!empty($v['options']['details_convert_multiple_columns'])) {
				$widget_model = \Factory::model($k, true);
				$widget_model->convertMultipleColumns($this, $values[$k]);
			} else if (!empty($values[$k])) { // convert fields
				// 1 to 1
				if (!empty($v['options']['details_11'])) {
					$details = [$values[$k]];
				} else { // 1 to M
					$details = $values[$k];
				}
				foreach ($details as $k5 => $v5) {
					if (!empty($v['options']['details_11'])) {
						$values_key = [$k];
					} else {
						$values_key = [$k, $k5];
					}
					foreach ($v['elements'] as $k2 => $v2) {
						if (!empty($v2['options']['multiple_column'])) {
							if (!empty($v5[$k2])) {
								$temp = $v5[$k2];
								pk($v2['options']['multiple_column'], $temp);
								array_key_set($values, array_merge($values_key, [$k2]), array_keys($temp));
							}
						}
					}
				}
			}
			// subdetails
			if (!empty($v['subdetails'])) {
				foreach ($values[$k] as $k11 => $v11) {
					foreach ($v['subdetails'] as $k0 => $v0) {
						if (!empty($v0['options']['details_convert_multiple_columns'])) {
							$widget_model = \Factory::model($k0, true);
							$widget_model->convertMultipleColumns($this, $values[$k][$k11][$k0]);
						}
					}
				}
			}
		}
	}
287078
public static int toModifiers(final String modifiers) {
        if (modifiers == null) {
            return 0;
        }
        final String trimmedModifiers = modifiers.trim();
        int modifier = 0;
        final StringTokenizer tok = new StringTokenizer(trimmedModifiers, " ");
        while (tok.hasMoreTokens()) {
            final String mod = tok.nextToken();
            modifier = modifier | modifierValueForName(mod);
        }
        return modifier;
    }
1224635
protected function replacement($value, array $modifiers)
    {
        if (is_array($value)) {
            throw new DataInvalidFormat('', 'required scalar given');
        }
        return $this->valueModification($value, $modifiers);
    }
829690
public function BEM($block = null, $element = null, $modifiers = []): string
    {
        return implode(" ", ArrayHelper::BEM($block, $element, $modifiers));
    }
958370
protected function compileStatements($value) {
        $callback = function ($match) {
            if (method_exists($this, $method = 'compile'.ucfirst($match[1]))) {
                $match[0] = $this->$method(Arr::get($match, 3));
            } elseif (isset($this->customDirectives[$match[1]])) {
                $match[0] = call_user_func($this->customDirectives[$match[1]], Arr::get($match, 3));
            }

            return isset($match[3]) ? $match[0] : $match[0].$match[2];
        };

        return preg_replace_callback('/\B@(\w+)([ \t]*)(\( ( (?>[^()]+) | (?3) )* \))?/x', $callback, $value);
    }
1069426
private function doubledModifier($value, $modifier)
	{
		if (($count = substr_count($value, $modifier)) > 0) {
			$value = $count > 1 ? str_replace($modifier . $modifier, $modifier, $value) : $value;
			if (($count % 2) > 0) {
				return [TRUE, $value];
			}
		}

		return [FALSE, $value];
	}
719103
protected function checkType($value, $types): ?string
    {
        $type = gettype($value);

        return in_array($type, $types) ? $type : null;
    }
553688
public function hydrate($value, $data = [])
    {
        if (is_array($value)) {
            $coll = new ArrayCollection();
            foreach ($value as $v) {
                $coll->add($this->hydrate($v, $data));
            }
            return $coll;
        }

        if (empty($value) || 0 !== strpos($value, '{')) {
            return null;
        }

        $location = $this->getLocationEntity();
        return $location->fromString($value);
    }
366012
public static function createFilledMatrix($value, $rows, $columns = null)
    {
        if ($columns === null) {
            $columns = $rows;
        }

        $rows = Matrix::validateRow($rows);
        $columns = Matrix::validateColumn($columns);

        return new Matrix(
            array_fill(
                0,
                $rows,
                array_fill(
                    0,
                    $columns,
                    $value
                )
            )
        );
    }
1129126
public function parse($value, $providers = [], $references = [])
    {
        $referenceName = substr($value, 1);

        if (isset($references[$referenceName])) {
            return $references[$referenceName];
        }

        return $value;
    }
340595
protected function getModificatorSelector($modificator_name = null, $modificator_value = null)
	{
		if ( isset($modificator_name) && isset($modificator_value) ) {
			return '_' . $modificator_name . '_' . $modificator_value;
		}

		return '';
	}
1226527
private function formatCondition($identifier, $operator, $value, $modifier = NULL)
	{
		$operator = strtolower($operator);

		if ($operator === 'like') {
			$value = $this->processLikeOperator($value);
			$modifier = 're';
		}

		$value = $modifier ? $this->processModifier($modifier, $value) : $value;

		//tries to translate operator
		if (array_key_exists($operator, $this->operators)) {
			$operator = $this->operators[$operator];
		}

		if ($operator === '=') {
			return [$identifier => $value];
		}

		//$in and $nin need to reset keys
		if ($operator === 'in' || $operator === 'nin') {
			$value = array_values((array) $value);
		}

		//parses inner condition in $elemMatch
		if ($operator === 'elem_match' && is_array($value)) {
			$value = $this->parseDeepCondition($value);
		}

		//translates SQL like operator to mongo format ELEM_MATCH => $elemMatch
		if (strpos($operator, '_') !== FALSE) {
			$operator = lcfirst(str_replace(' ', '', ucwords(str_replace('_', ' ', $operator))));
		}

		return [(string) $identifier => [$this->formatCmd($operator) => $value]];
	}
195322
public function generateColumns($value, $dataContainer)
    {
        if (!$dataContainer->activeRecord) {
            return null;
        }

        /** @var FormModel|Result $current */
        $current = $dataContainer->activeRecord;

        if ($value && $dataContainer->activeRecord) {
            $stopElement  = $this->getStopElement($current);
            $nextElements = $this->getNextElements($stopElement);
            $sorting      = $stopElement->sorting;

            $sorting = $this->createSeparators($value, $current, $sorting);

            array_unshift($nextElements, $stopElement);
            $this->updateSortings($nextElements, $sorting);
        }

        return null;
    }