Display the primary field.

@param $item
@param null $config

@return mixed
2372
public function displayPrimaryField($item, $config = null)
    {
        $field = $this->getPrimaryField($item, $config);

        return $item->$field;
    }
653979
protected function getConfig($item)
	{
		// Get config item value for a custom layout if it exists, even if blank
		if (!is_null(Config::get($this->configNamePrefix.$this->layout.'.'.$item)))
		{
			return Config::get($this->configNamePrefix.$this->layout.'.'.$item);
		}

		// Fallback to default config item value if custom one does exist
		else
		{
			return Config::get($this->configNamePrefix.$item);
		}
	}
260882
public function getContainerValues(&$item)
    {
        if (false === is_object($item) && false === is_array($item)) {
            $item = $this->getContainerServices($this->getContainerParameters($item));
        }

        return $item;
    }
697523
public function getUrlManagerConfig($item)
    {
        $urlManager = $this->getConfigByName('urlManager');
        if (isset($urlManager[$item])) {
            return $urlManager[$item];
        }
        return false;
    }
370433
public function getProperty($property, $item)
    {
        if (gettype($item) == 'array') {
            return $item[$property];
        } elseif (gettype($item) == 'object') {
            return $item->$property;
        }
        return null;
    }
670277
protected function parseItem()
    {
        if (null === ($primary = $this->parse('Primary', null))) {
            return $this;
        }
        
        switch ($this->type) {
            case '?':
            case '*':
            case '+':
                return new AST\Item($primary, $this->consume());
        }
        
        return $primary;
    }
121764
public function getUser($item = null)
    {
        if (isset($item)) {
            return gplcart_array_get($this->current_user, $item);
        }

        return $this->current_user;
    }
1040817
public function getAdminObjectSourceName($item)
    {
        /** @var AbstractAdmin $admin */
        $admin = $this->getContainer()->get('sonata.admin.pool')->getAdminByClass($item->getSourceClass());

        if ($admin->getObject($item->getSourceItemId())) {
            return $admin->getObject($item->getSourceItemId())->getValue();
        }

        return null;
    }
1180699
public function getItem($config)
    {
        //why would you send an empty value?
        if(empty($config) || !is_string($config)) {
            return false;
        }

        $data = $this->loadConfig($config);

        //no config data available
        if(!is_array($data)) {
            return false;
        }

        //return item object
        return new Item($data);
    }
237119
public function getField($config, $field, $default = '')
    {
        $data = (isset($config['config'][$field])) ? $config['config'][$field] : $default;

        return $data;
    }
316489
protected function loadConfigure($item, $force = false)
    {
        if (array_key_exists($item, $this->config) && $force == false) {
            return $this->config[$item];
        }

        $config = [];
        $config_file = sprintf("%s/config/%s.php", $this->basePath, $item);
        if (is_file($config_file)) {
            $config = require $config_file;
        }

        $env_config = [];
        $env_config_file = sprintf("%s/config/%s/%s.php", $this->basePath, $this->environment, $item);
        if (is_file($env_config_file)) {
            $env_config = require $env_config_file;
        }

        $this->config[$item] = array_replace_recursive($config, $env_config);

        return $this->config[$item];
    }
280667
public function renderItem( $item ) {

        $label      = null;
        $url        = isset( $item[ 'url' ] ) ? $item[ 'url' ] : null;
		$urlOptions	= isset( $item[ 'urlOptions' ] ) ? $item[ 'urlOptions' ] : null;
        $options    = [];

		// Check whether label is required
		if( $this->label ) {

	        if( !isset( $item[ 'label' ] ) ) {

	            throw new InvalidConfigException( "The 'label' option is required." );
	        }

	        $label = $item[ 'label' ];
		}

		// Check whether icon is required
		if( $this->icon ) {

	        if( !isset( $item[ 'icon' ] ) ) {

	            throw new InvalidConfigException( "The 'icon' option is required." );
	        }

			$icon	= Html::tag( 'i', null, [ 'class' =>  $item[ 'icon' ] ] );
			$label	= "<span class='wrap-icon'>$icon</span><span class='wrap-text'>$label</span>";
		}

		if( isset( $item[ 'options' ] ) ) {

			$options = $item[ 'options' ];
		}

		if( isset( $url ) ) {

			$link = Html::a( $label, $url, $urlOptions );
		}

		// Custom Links
		if( isset( $options[ 'action' ] ) ) {

			$urlOptions[ 'link' ] = $url;

			$link = Html::tag( 'span', $label, $urlOptions );
		}

		// Custom HTML
		if( isset( $options[ 'html' ] ) ) {

			$link = $options[ 'html' ];

			unset( $options[ 'html' ] );
		}

        return Html::tag( 'li', $link, $options );
    }
218986
public static function getFieldValue($item,$field,$objectFieldAccess=false)
    {
        if(is_array($item) && array_key_exists($field, $item)){
            return $item[$field];
        }else if(is_object($item)){
            return ObjectUtil::getPropertyValue($item, $field,$objectFieldAccess);
        }
        return null;
    }
1317546
public function getSourceForFill(Item $item)
    {
        /* @var $source Source */
        foreach ($item->getSources() as $source) {
            if (strpos($source->getUrl(), $this->browser->getHost()) === 0) {
                return $source->getUrl();
            }
        }

        return '';
    }
1129519
public function get($item)
    {
        $key = $this->getItemKey($item);

        if (null !== $key) {
            if (isset($this->items[$key])) {
                $item = $this->items[$key];
            } else {
                $this->items[$key] = $item;
            }
        }

        return $item;
    }
1153323
protected function locate($item): ?ItemBucket
    {
        for ($this->rewind(); $this->valid(); $this->next()) {
            /** @var ItemBucket $current */
            $current = $this->current;
            if (Validate::areEqual($item, $current->item())) {
                return $current;
            }
        }

        return null;
    }
715368
public static function get($item, $default = null)
	{
		is_null(static::$default_check_value) and static::$default_check_value = pack('H*', 'DEADBEEFCAFE');

		if (isset(static::$items[$item]))
		{
			return static::$items[$item];
		}
		elseif ( ! isset(static::$itemcache[$item]))
		{
			$val = \Fuel::value(\Arr::get(static::$items, $item, static::$default_check_value));

			if ($val === static::$default_check_value)
			{
				return $default;
			}

			if ( ! is_scalar($val))
			{
				return $val;
			}

			static::$itemcache[$item] = $val;
		}

		return static::$itemcache[$item];
	}