条件数组中的元素,没有指定键的情况下
@param $value mixed 值
@return array [SQL,Prepare,Param]
170544
private function itemWithoutKey($value): array
    {

        // 如果是数组,按下一级条件拼接条件
        if (is_array($value)) {
            // 递归调用,生成子表达式
            list ($s, $subPrepared, $subParams) = (new self($value, $this->operator == 'AND' ? 'OR' : 'AND'))->result();
            return ['(' . $s . ')', '(' . $subPrepared . ')', $subParams];
        }

        // 必须是字符串了!!!
        if (!is_string($value)) {
            trigger_error('条件必须是数组或字符串:' . json($this->origin) . ':' . json($value),E_USER_ERROR);
        }

        return [$value, $value, []];
    }
123688
public function findAll($value): ?array
    {
        $founded = array_keys($this->items->toArray(), $value, true);

        if (0 === count($founded)) {
            return null;
        }

        return $founded;
    }
976433
public function cast($value): array
    {
        $result = [];
        foreach ((array)$value as $key => $itemValue) {
            $result[$key] = $this->type->cast($itemValue);
        }
        return $result;
    }
831454
protected function filter(&$value)
	{
		if (is_scalar($value)) {
			return htmlspecialchars($value, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');
		} elseif (is_array($value)){
			array_walk_recursive($value, [$this, 'filter']);
		} elseif (is_object($value)) {
			foreach (get_object_vars($value) as $k => $v) {
				$value->$k = $this->filter($value);
			}
		}

		return $value;
	}
821699
private function getValue($value)
    {
        if ($value === null) {
            return null;
        }

        if ($value instanceof String_ || $value instanceof LNumber || $value instanceof DNumber) {
            return $value->value;
        } elseif ($value instanceof ConstFetch) {
            $value = (string)$value->name;
            if ($value === 'null') {
                return null;
            } elseif ($value === 'true') {
                return true;
            } elseif ($value === 'false') {
                return false;
            }

            return $value;
        } elseif ($value instanceof Array_) {
            return $this->getArray($value);
        }

        return null;
    }
1285270
public static function convertFromSQLHex($value)
    {
        $matches = array();
        if (preg_match_all('/(?:(?:\A|[^\d])0x[a-f\d]{3,}[a-f\d]*)+/im', $value, $matches)) {
            foreach ($matches[0] as $match) {
                $converted = '';
                foreach (str_split($match, 2) as $hex_index) {
                    if (preg_match('/[a-f\d]{2,3}/i', $hex_index)) {
                        $converted .= chr(hexdec($hex_index));
                    }
                }
                $value = str_replace($match, $converted, $value);
            }
        }
        // take care of hex encoded ctrl chars
        $value = preg_replace('/0x\d+/m', ' 1 ', $value);

        return $value;
    }
968680
public function getTypeFromValue($value = null)
    {
        $value = ($value === null ? $this->value : $value);
        return array_search($value, self::$typeList);
    }
899618
protected function prepareValue($value, Parameter $param)
    {
        return is_array($value)
            ? $this->resolveRecursively($value, $param)
            : $param->filter($value);
    }
1127362
protected function prepeareQuery($value)
    {
        $query = \Doctrine_Query::create($this->getConnection())
                ->select($this->getField())
                ->from($this->getTable())
                ->where(sprintf('%s = ?', $this->getField()), $value);

        foreach ($this->getExclude() as $exclude => $value) {
            $query->andWhere(sprintf('%s != ?', $exclude), $value);
        }

        foreach ($this->getInclude() as $include => $value) {
            $query->andWhere(sprintf('%s = ?', $include), $value);
        }

        return $query;
    }
321472
public function fetchPairs($key, $value = NULL) {
		$return = array();
		foreach ($this as $row) {
			$return[$row->$key] = $value ? $row->$value : $row->$key;
		}
		return $return;
	}
1126653
public function preparedResults($values)
    {
        $preparedValues = [];

        /* @var $col Col */
        /* @var $field Field */
        foreach ($this->select as $pos => $selectColumn) {
            $col = $selectColumn[0];
            $field = $col->getOutputField();
            $val = ArrayHelper::getValue($values, $pos);
            // first use the inbuilt converters
            try {
                $val = Type::getType(
                    $field->dbType($this->connection)
                )->convertToPHPValue($val, $this->connection->getDatabasePlatform());
            } catch (DBALException $exception) {
            }

            // use the field converters if any were provided by the user.
            $converters = $field->getDbConverters($this->connection);

            if ($converters) {
                foreach ($converters as $converter) {
                    $val = call_user_func($converter, $this->connection, $val, $field);
                }
            }
            $preparedValues[] = $val;
        }

        return $preparedValues;
    }
855507
public function prep($values = null)
    {
        $hash = $this->queryHash();

        $prepOnly = true;

        if (is_array($values)) {

            $prepOnly = false;

        }

        if ($this->oosql_prepParams) {
            $this->oosql_stmt = $this->prepare(trim($this->sql()), $this->oosql_prepParams);
        } else {
            $this->oosql_stmt = $this->prepare(trim($this->sql()));
        }



        if ($prepOnly) {

            return $this->oosql_stmt;

        }

        return $this->execBound($this->oosql_stmt, $values);
    }
131330
public function generate($value): array
    {
        $schema = [];
        switch (gettype($value)) {
            case 'NULL':
                $schema['type'] = 'null';
                break;
            case 'boolean':
                $schema['type'] = 'boolean';
                break;
            case 'integer':
                $schema['type'] = 'integer';
                break;
            case 'double':
                $schema['type'] = 'number';
                break;
            case 'string':
                $schema = $this->generateStringSchema($value);
                break;
            case 'array':
                $isDictionary = array_keys($value) !== range(0, count($value) - 1);
                if ($isDictionary) {
                    $schema = $this->generateDictionarySchema($value);
                } else {
                    $schema = $this->generateArraySchema($value);
                }
                break;
        }
        return $schema;
    }
1022838
public function pluck($value, $key = null)
    {
        $this->newQuery();

        $lists = $this->query->pluck($value, $key);

        if (is_array($lists)) {
            return $lists;
        }

        return $lists->all();
    }
324862
protected function prepareData($value)
    {
        if (is_string($value)) {
            return stripslashes(trim(str_replace('\n', "\n", $value)));
        } elseif (is_array($value)) {
            return array_map('self::prepareData', $value);
        }

        return $value;
    }
1241833
protected function handleArrayParameter( $value )
    {
        $values = array();
        foreach ( $value->data->value as $subValue )
        {
            if ( $subValue->count() > 0 )
            {
                $subValue = (array)$subValue;
            }
            else
            {
                $subValue = array( (string)$subValue );
            }
            $values[] = $this->processParameter( $subValue );
        }

        return $values;
    }
1145782
private function prepareValue($value)
    {
        if (is_array($value)) {
            foreach ($value as &$val) {
                if (is_array($val) and count($val) === 1) {
                    $val = array_shift($val);
                }
            }
            unset($val);

            if (count($value) === 1) {
                $value = array_shift($value);
            }
        }

        return $value;
    }