Return the controller identifiable item.

@param bool $create Return an entity if there's none

@return mixed
355449
public function getItem($create = false)
    {
        $item = $this->_mixer->getState()->getItem();

        if ($item == null && $this->_mixer->getState()->isUnique()) {
            $item = $this->fetchEntity(new AnCommandContext());
        }

        //create an new entity
        if ($item == null && $create) {
            $this->_mixer->getState()->setItem($this->getRepository()->getEntity());
        }

        return $this->_mixer->getState()->getItem();
    }
1082683
public function getItemControllerId($type)
    {
        $controllerId = null;
        switch ($type) {
            case CAuthItem::TYPE_OPERATION:
                $controllerId = 'operation';
                break;

            case CAuthItem::TYPE_TASK:
                $controllerId = 'task';
                break;

            case CAuthItem::TYPE_ROLE:
                $controllerId = 'role';
                break;

            default:
                throw new CException('Auth item type "' . $type . '" is valid.');
        }
        return $controllerId;
    }
608747
public function fetch() {
		if ($this->selection) {
			$fetch = $this->selection->fetch();
			if ($fetch) {
				return $this->createEntity($fetch);
			} else {
				return array();
			}
		} else {
			return array();
		}
	}
1166679
public function get($key)
	{
		$success = false;
		$value = apc_fetch($key, $success);
		$item = new Item($key);

		if ($success)
		{
			$item->setValue($value);
		}

		return $item;
	}
345406
public function getItems($force = false)
    {
        if ($this->nb_catalog_item_tree->isEmpty() || $force) {
            $this->nb_catalog_item_tree->populate();
        }

        return $this->nb_catalog_item_tree;
    }
565916
private function getMeta($create = false)
    {
        $locale = $this->locale;
        $metaCollection = $this->getFileVersion()->getMeta();

        // get meta only with this locale
        $metaCollectionFiltered = $metaCollection->filter(function($meta) use ($locale) {
            /** @var FileVersionMeta $meta */
            if ($meta->getLocale() == $locale) {
                return true;
            }

            return false;
        });

        // check if meta was found
        if ($metaCollectionFiltered->isEmpty()) {
            if ($create) {
                // create when not found
                $meta = new FileVersionMeta();
                $meta->setLocale($this->locale);
                $meta->setFileVersion($this->getFileVersion());
                $this->getFileVersion()->addMeta($meta);

                return $meta;
            }

            // return first when create false
            return $this->getFileVersion()->getDefaultMeta();
        }

        // return exists
        return $metaCollectionFiltered->first();
    }
480615
public static function create($boolean = FALSE) {
    $is_upper = FormatterFactory::getDefaultFormatter()->getConfig('boolean_null_upper');
    $node = new FalseNode();
    $node->addChild(NameNode::create($is_upper ? 'FALSE' : 'false'), 'constantName');
    return $node;
  }
777374
public function getItem($id)
    {
        foreach ($this->entity->getItems() as $item) {
            if ($item->getId() === $id) {
                return $item;
            }
        }

        return null;
    }
708754
public function get($object = false)
    {
        $this->prepare();

        return $this->prepareResult($this->_map, $object);
    }
459403
public function getAllItems(bool $returnBuilder = false)
    {
        $builder = $this->getItemsQuery(['created_at', 'updated_at'])->orderBy('created_at', 'desc');

        if ($returnBuilder) {
            return $builder;
        }

        return $builder->get();
    }
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);
    }
550484
public function getExtractor($new = false)
    {
        if ($new || !$this->extractor) {
            $this->extractor = $this->app->make('oauth_extractor', [$this->getService()]);
        }

        return $this->extractor;
    }
1025749
final public static function load_controller($restoreid = false) {
        // Get the restore id optional param.
        if ($restoreid) {
            try {
                // Try to load the controller with it.
                // If it fails at this point it is likely because this is the first load.
                $controller = restore_controller::load_controller($restoreid);
                return $controller;
            } catch (Exception $e) {
                return false;
            }
        }
        return $restoreid;
    }
490465
public function getAttribute($id, $create = false)
    {
        foreach ($this->attributes as $attribute) {
            if ($id == $attribute->getId()) {
                return $attribute;
            }
        }

        if ($create) {
            $attribute = new Attribute();
            $attribute->setId($id);
            $this->addAttribute($attribute);

            return $attribute;
        }

        return null;
    }
665463
public function get()
    {
        $request = $this->createRequest('/admin/shop.json');
        $response = $this->send($request);
        return $this->createObject(Shop::class, $response['shop']);
    }
198232
def get_or_create(cls, **kwargs):
        """"""

        data = cls._get(**kwargs)
        if data is None:
            return cls(**kwargs), True
        return cls.deserialize(data), False
503804
public function get( $id )
	{
		$context = $this->getContext();

		$filter = $this->manager->createSearch( true );
		$expr = [
			$filter->compare( '==', 'subscription.id', $id ),
			$filter->compare( '==', 'order.base.customerid', $context->getUserId() ),
			$filter->getConditions(),
		];
		$filter->setConditions( $filter->combine( '&&', $expr ) );

		$items = $this->manager->searchItems( $filter );

		if( ( $item = reset( $items ) ) === false )
		{
			$msg = 'Invalid subscription ID "%1$s" for customer ID "%2$s"';
			throw new \Aimeos\Controller\Frontend\Subscription\Exception( sprintf( $msg, $id, $context->getUserId() ) );
		}

		return $item;
	}