Return record(s) from specified table
@param string $tableName
@param string $field field to match
@param string $value value to match with field
@param array $fields columns to be returned
@return string executable SQL statement
17202
public function getRecord($tableName, $field, $value, $fields = array())
    {
        $query = SQLEncoder::encodeGetRecord($tableName, $field, $value, $fields);
        return $this->con->query($query);
    }
1072582
def find(self, fieldname):
        
        tablename, _, column = fieldname.rpartition(':')
        if tablename and tablename in self._field_map[column]:
            return tablename
        else:
            return self._field_map[fieldname]
320106
public List<Entity> findBy(Connection conn, String tableName, String field, Object value) throws SQLException{
		return findAll(conn, Entity.create(tableName).set(field, value));
	}
615174
function ruleExistsFieldValueNotEqual($tablename, $field, $value, $error_message = null) {
        return $this->ruleExists($tablename, $field, '!' . $value, $error_message);
    }
1150597
protected static function query($fields)
    {
        $result = Query::from(static::$table);

        $result = $result->where();

        foreach ($fields as $key => $value) {
            $result = $result->andWhere($key, '=', $value);
        }

        return $result->get();
    }
865202
public function GetField($Field, $Table = '') {
      if ($Table != '')
         $this->CurrentTable = $Table;
      
      if (!is_array($this->_Schema))
         $this->_Schema = array();
         
      $Result = FALSE;
      if ($this->FieldExists($this->CurrentTable, $Field) === TRUE)
         $Result = $this->_Schema[$this->CurrentTable][$Field];
         
      return $Result;
   }
698098
public function getRowByValue ($columnName, $value)
		{
			$query = $this->database->createQuery()
				->whereEqual($columnName, $value)
				->limit(1);

			return $this->getRows($query)
				->fetchRow();
		}
995500
public function getDataFieldValue($record, $fieldName)
    {
        if (isset($this->customDataFields[$fieldName])) {
            $callback = $this->customDataFields[$fieldName];

            return $callback($record);
        }

        if ($record->hasMethod('relField')) {
            return $record->relField($fieldName);
        }

        if ($record->hasMethod($fieldName)) {
            return $record->$fieldName();
        }

        return $record->$fieldName;
    }
939482
function getone($field = '')
    {
        $this->limit('1');
        if ($this->auto_cache or !empty($cache_id))
        {
            $cache_key = empty($cache_id) ? self::CACHE_PREFIX . '_one_' . md5($this->sql) : self::CACHE_PREFIX . '_all_' . $cache_id;
            global $php;
            $record = $php->cache->get($cache_key);
            if (empty($data))
            {
                if ($this->is_execute == 0)
                {
                    $this->exeucte();
                }
                $record = $this->result->fetch();
                $php->cache->set($cache_key, $record, $this->cache_life);
            }
        }
        else
        {
            if ($this->is_execute == 0)
            {
                $this->exeucte();
            }
            $record = $this->result->fetch();
        }
        if ($field === '')
        {
            return $record;
        }
        return $record[$field];
    }
1157676
public function get_column_values($table, $field,  array $where = [], $limit = false, $start = 0, $php = false)
  {
		if ( bbn\str::check_name($field) && ( $table = $this->table_full_name($table, 1) )  && ( $m = $this->db->modelize($table) ) && \count($m['fields']) > 0 )
		{
			$r = '';
			if ( $php ){
				$r .= '$db->query("';
			}
      if ( !isset($m['fields'][$field]) ){
        die("The column $field doesn't exist in $table");
      }
			$r .= "SELECT DISTINCT `$field` FROM $table".PHP_EOL.
        $this->db->get_where($where, $table).PHP_EOL.
        "ORDER BY `$field`";
      if ( $limit ){
  			$r .= PHP_EOL . $this->get_limit([$limit, $start]);
      }
			if ( $php ){
				$r .= '");';
			}
			return $r;
		}
		return false;
  }
532955
protected static function setFieldPluginAndModel(string $tableName, array $fields) : array
    {
        list($plugin, $model) = pluginSplit($tableName);

        $callback = function (&$value, $key) use ($plugin, $model) {
            $value = ['plugin' => $plugin, 'model' => $model, 'name' => $value];

            return $value;
        };

        array_walk_recursive($fields, $callback);

        return $fields;
    }
1157651
public function findByField($field_name, $value, $operator = '=') {
    $results = $this->findByFieldWithoutFetch($field_name, $value, $operator);
    $return = $this->hydrate($results);

    return $return;
  }
1208000
public static function select(
        $table, $fields = array(),
        $condition = null,
        $statement = null)
    {
        $query = array('SELECT ');
        array_push($query, (empty($fields)?'*':implode(', ', $fields)));
        array_push($query, " FROM $table");
        array_push($query, (isset($condition))?" WHERE $condition":'');
        array_push($query, (isset($statement))?" $statement":'');
        return implode($query);
    }
334004
public function get($value, $field = '*', $name = 'id')
    {
        $map = array(
            $name => $value
        );
        return $this->where($map)
            ->field($field)
            ->find();
    }
881546
public function where($field, $table, $value) {
        static $i = 0;
        $sql = self::resolve_field($field, $table) . ' ';

        if ($value === null) {
            $sql .= 'IS NULL';

        } else {
            $param = 'where' . $i++;
            $sql .= " = :$param";
            $this->params[$param] = $value;
        }

        $this->where[] = $sql;
    }
1172328
public static function fetchOneValue(string $field, $where = null, $orderField = null, $orderDirection = null)
    {
        $select = static::select()->field($field, 'key_field')->limit(0, 1);

        if ($where !== null) {
            if ($where instanceof Where) {
                $select->where($where);
            } else if (is_array($where)) {
                foreach ($where as $field => $value) {
                    $select->where($field, $value);
                }
            } else if (!is_array(static::$primaryKey) && (is_numeric($where) || is_string($where))) {
                $select->where(static::$primaryKey, $where);
            }
        }

        if ($orderField !== null) {
            $select->orderBy($orderField, $orderDirection);
        }

        $records = $select->fetchAll();
        if (count($records) == 0) {
            return null;
        }

        return $records[0]['key_field'];
    }
582562
public function generate(string $tableName, array $fieldValues): array
    {
        $tca = $GLOBALS['TCA'][$tableName];
        /** @var FieldGeneratorResolver $resolver */
        $resolver = GeneralUtility::makeInstance(FieldGeneratorResolver::class);
        foreach ($tca['columns'] as $fieldName => $fieldConfig) {
            // Generate only if there is no value set, yet
            if (isset($fieldValues[$fieldName])) {
                continue;
            }
            $data = [
                'tableName' => $tableName,
                'fieldName' => $fieldName,
                'fieldConfig' => $fieldConfig,
                'fieldValues' => $fieldValues,
            ];
            try {
                $generator = $resolver->resolve($data);
                $fieldValues[$fieldName] = $generator->generate($data);
            } catch (GeneratorNotFoundException $e) {
                // No op if no matching generator was found
            }
        }
        return $fieldValues;
    }