[getSelector description]

@param string|object $field field name or field obj

@return string css selector
166256
private function getSelector($field)
    {
        if (\is_string($field)) {
            if (isset($this->trigs[$field]['selector'])) {
                return $this->trigs[$field]['selector'];
            }
            $fields = $this->getFieldsWithName($field);
            $field = $fields[0];
        }
        if (\in_array($field->attribs['type'], array('checkbox','radio','submit'))) {
            $formId = $this->form->cfg['attribs']['id'];
            $selector = '#'.$formId.' input[name=\"'.$field->attribs['name'].'\"]';
        } else {
            $fieldId = $field->id;
            $selector = '#'.$fieldId;
        }
        return $selector;
    }
1267733
private function findSelectOptions($field)
    {
        \PHPUnit_Framework_Assert::assertNotNull(
            $select = $this->getPage()->findField($field),
            sprintf('The select field "%s" does not exist.', $field)
        );

        $options = [];

        foreach ($select->find('xpath', '/option') as $option) {
            $options[] = $option->getValue();
        }

        return $options;
    }
573484
private static function handleSelectandi($fields) {
        $i = 0;
        $res = '';
        foreach($fields as $what) {
            $res .= ($i > 0 ? ', ' : '') . self::$_ops->selectandi($what);
            $i++;
        }
        return $res;
    }
167905
private function getJqSearchField($field)
    {
        // jqSearchable is not initialized
        if (!isset($this->jqSearchable) || !is_array($this->jqSearchable)) {
            return $field;
        }

        return isset($this->jqSearchable[$field]) ? $this->jqSearchable[$field] : $field;
    }
241387
function create_field( $field )
	{
		// vars
		$o = array( 'id', 'class', 'name', 'value' );
		$e = '';
		
		
		$e .= '<div class="acf-color_picker">';
		$e .= '<input type="text"';
		
		foreach( $o as $k )
		{
			$e .= ' ' . $k . '="' . esc_attr( $field[ $k ] ) . '"';	
		}
		
		$e .= ' />';
		$e .= '</div>';
		
		
		// return
		echo $e;
	}
939984
public function getFieldInput($field)
    {
        $model = ClassRegistry::init($this->usersModel);

        switch ($field) {
            case 'username':
                $username = trim($this->in('Username:'));

                if (!$username) {
                    $username = $this->getFieldInput($field);

                } else {
                    $result = $model->find('count', array(
                        'conditions' => array($model->alias . '.' . $this->userFields['username'] => $username)
                    ));

                    if ($result) {
                        $this->out('<error>Username already exists, please try again</error>');
                        $username = $this->getFieldInput($field);
                    }
                }

                return $username;
                break;

            case 'email':
                $email = trim($this->in('Email:'));

                if (!$email) {
                    $email = $this->getFieldInput($field);

                } else if (!Validation::email($email)) {
                    $this->out('<error>Invalid email address, please try again</error>');
                    $email = $this->getFieldInput($field);

                } else {
                    $result = $model->find('count', array(
                        'conditions' => array($model->alias . '.' . $this->userFields['email'] => $email)
                    ));

                    if ($result) {
                        $this->out('<error>Email already exists, please try again</error>');
                        $email = $this->getFieldInput($field);
                    }
                }

                return $email;
                break;

            // Password, others...
            default:
                $value = trim($this->in(sprintf('%s:', Inflector::humanize($field))));

                if (!$value) {
                    $value = $this->getFieldInput($field);
                }

                return $value;
                break;
        }
    }
457929
public function findColumn($field) {
        $rows = $this->select($field)->findAll();

        //false or null
        if (!$rows) {
            return $rows;
        }

        $columnValues = [];
        foreach ($rows as $row) {
            $columnValues[] = $row[$field];
        }
        return $columnValues;
    }
631811
public function getToolTipTemplate($field)
	{
		if (array_key_exists($field, $this->toolTips())) {
			$toolTip = Html::tag('span', "{label}", [
				'data-content'=> $this->toolTips()[$field],
				'data-toggle'=>'popover',
				'data-trigger'=>'hover',
				'style'=>'cursor:help; border-bottom: 1px dashed #888'
			]);

			return "$toolTip \n{input}\n{hint}\n{error}";
		}

		return "{label}\n{input}\n{hint}\n{error}";
	}
50461
public function getFieldDefinition($field)
    {
        if (isset($this->definition[$field])) {
            return $this->definition[$field];
        }
        if (isset($this->definition['fields'][$field])) {
            return $this->definition['fields'][$field];
        }
        return null;
    }
1366958
public function castingHelper($field)
    {
        $copy = $this->CopyContentFrom();
        if ($copy && $copy->exists() && ($helper = $copy->castingHelper($field))) {
            return $helper;
        }
        return parent::castingHelper($field);
    }
30778
public static function getObjectFieldValue($object, $field)
    {
        $op = $value = null;

        $pos = strpos($field, '(');
        if (false !== $pos) {
            list ($op, $field) = explode('(', $field, 2);
            $field = rtrim($field, ')');
        }

        if (isset($object[$field])) {
            $value = $object[$field];
        } else {
            $accessors = array('', 'get', 'is');

            foreach ($accessors as $accessor) {
                $accessor .= $field;

                if (!method_exists($object, $accessor)) {
                    continue;
                }

                $value = $object->{$accessor}();
                break;
            }
        }

        if ($op) {
            $function = 'filter' . ucfirst(strtolower($op));
            if (method_exists(static::class, $function)) {
                $value = static::$function($value);
            }
        }

        return $value;
    }
533942
public function getSelectRangeHtmlField(Field $field)
    {
        $stub = $this->getStubContent('form-selectrange-field.blade', $this->template);

        $this->replaceFieldName($stub, $field->name)
            ->replaceCssClass($stub, $field->cssClass)
            ->replaceFieldMinValue($stub, isset($field->range[0]) ? $field->range[0] : 1)
            ->replaceFieldMaxValue($stub, isset($field->range[1]) ? $field->range[1] : 10)
            ->replaceSelectedValue($stub, $this->getSelectedValueForMenu($field))
            ->replaceFieldPlaceHolder($stub, $this->getFieldPlaceHolderForMenu($field->getPlaceholder(), $field->name))
            ->wrapField($stub, $field);

        return $stub;
    }
474706
private function getSearchField($field)
    {
        if ($this->isStringDQLQuery($field)) {

            $dqlQuery = $field;

            $lexer = new Query\Lexer($field);

            // We have to rename some identifier or the execution will crash
            do {
                $lexer->moveNext();

                if ($this->isTheIdentifierILookingFor($lexer)) {

                    $replacement = sprintf("$1%s_%d$3", $lexer->lookahead['value'], mt_rand());
                    $pattern = sprintf("/([\(\s])(%s)([\s\.])/", $lexer->lookahead['value']);

                    $dqlQuery = preg_replace($pattern, $replacement, $dqlQuery);
                }

            } while($lexer->lookahead !== null);

            $dqlQuery = substr($dqlQuery, 0, strripos($dqlQuery, ")") + 1);

            return $dqlQuery;
        }

        $field = explode(' ', trim($field));

        return $field[0];
    }
1019538
private function getMaterialField($field)
    {
        if (isset($this->fields[$field['name']]) && is_object($this->fields[$field['name']]))
            return $this->fields[$field['name']];
            
        $slot = new Cache\Slot\MaterialField($this->table, $this->fields['id'], $field['name']);
        if (!$this->fields['id'] || false === ($_tmp = $slot->load())) {        
    
            if (!isset($this->fields[$field['name']]))
                $this->fields[$field['name']] = $this->getPlainField($field);

            if ($this->fields[$field['name']]) {
				
				try {
				
					if ($field['pseudo_type'] == PSEUDO_FIELD_LINK_CATALOG) {
						 $this->fields[$field['name']] = Catalog::getById($this->fields[$field['name']]);
					}
					elseif ($field['pseudo_type'] == PSEUDO_FIELD_LINK_USER) {   
						   $this->fields[$field['name']] = User::getById($this->fields[$field['name']]);  
					} 
					else {
									
						if ($field['type'] == FIELD_LINK) {
							if ($field['len']) {
								$c = Catalog::getById($field['len']);
								if (!$c) throw new Exception\CMS('Catalog '.$field['len'].' is not found.');
								$type = $c->materialsType;
							} else $type = $this->objectDefinition->id;
						} else {
							$type = $field['len'];
						}
						
						$this->fields[$field['name']] = self::getByIdType( $this->fields[$field['name']], $type );
					
					}
					
				}
				catch (\Exception $e) {
					$this->fields[$field['name']] = null;
				}
            
            } else {
                
                $this->fields[$field['name']] = null;
                
            }
            
            $slot->addTag(new Cache\Tag\Material($this->table, $this->fields['id']));
            $slot->save($this->fields[$field['name']]);
        } else {
            $this->fields[$field['name']] = $_tmp;
        }
        
        return $this->fields[$field['name']];
    }
1232545
public function getFieldDescription($field)
    {
        $item = $this->fields->find('Name', $field);

        if (!$item) {
            throw new Exception(
                sprintf(
                    'Tried to get field description for %s, but it has not been added to %s',
                    $field,
                    $this->getDataObjectClass()
                )
            );
        }

        return $item->Description;
    }
600333
private function findHiddenField($field)
    {
        $node = $this->getSession()->getPage()->find(
            'xpath',
            strtr(
                ".//input[./@type = 'hidden'][(./@id = '%locator%' or ./@name = '%locator%')]",
                array('%locator%' => $field)
            )
        );
        if (null === $node) {
            throw new ElementNotFoundException($this->getSession(), 'hidden field', 'id|name', $field);
        }

        return $node;
    }
96814
public function getOldValue(string $field)
    {
        $change = $this->objectChangeSet->getFieldChange($field);

        if ($change !== null) {
            return $change->getOldValue();
        }
    }