Loads an element type.

@param   string   $type  The element type.
@param   boolean  $new   False (default) to reuse parameter elements; true to load the parameter element type again.
@return  object
760072
public function loadElement($type, $new = false)
	{
		if ($type == 'list')
		{
			$type = 'select';
		}

		$signature = md5($type);

		if ((isset($this->_elements[$signature]) && !($this->_elements[$signature] instanceof __PHP_Incomplete_Class)) && $new === false)
		{
			return $this->_elements[$signature];
		}

		$elementClass = __NAMESPACE__ . '\\Parameter\\Element\\' . ucfirst($type);

		if (!class_exists($elementClass))
		{
			if (isset($this->_elementPath))
			{
				$dirs = $this->_elementPath;
			}
			else
			{
				$dirs = array();
			}

			preg_match('/^[A-Za-z0-9_-]+[A-Za-z0-9_\.-]*([\\\\\/][A-Za-z0-9_-]+[A-Za-z0-9_\.-]*)*$/', str_replace('_', DS, $type) . '.php', $matches);
			$file = @ (string) $matches[0];

			if ($elementFile = \App::get('filesystem')->find($dirs, $file))
			{
				include_once $elementFile;
			}
			else
			{
				$false = false;
				return $false;
			}
		}

		if (!class_exists($elementClass))
		{
			$false = false;
			return $false;
		}

		$this->_elements[$signature] = new $elementClass($this);

		return $this->_elements[$signature];
	}
828101
public function getElementInstance($type)
	{
		$class = $this->elementNamespace . ucfirst($type);

		if (array_key_exists($type, $this->customTypes))
		{
			$class = $this->customTypes[$type];
		}

		// TODO: Throw exception if the class cannot be found
		return new $class;
	}
1010781
public function newQuery($type = 'select')
    {
        $query = $this->getDB()->newQuery($type);
        $query->cols("`" . $this->getTable() . "`.*");
        $query->from($this->getFullNameTable());
        $query->table($this->getTable());

        return $query;
    }
888537
public function __cast(string $type)
    {
        if (!isset($this->__delegate)) {
            $this->__createDelegate();
        }

        return $this->__delegate->__cast($type);
    }
627432
public function &createNavbarElement($type)
    {
        if (! in_array($type, $this->element_types)) {
            Throw new HtmlException(sprintf('They type "%s" is not a valid navbar elementtype. Allowed are %s.', $type, implode(', ', $this->element_types)));
        }

        return $this->elements[] = $this->factory->create('Bootstrap\Navbar\\' . $type . 'Element');
    }
879461
protected function &_NewElement(&$aData)
    {
        if (!empty($aData['class'])) {
            $sClassName = $aData['class'];
            $oElement = new $sClassName();
            $oElement->LoadFromRow($aData);

            return $oElement;
        } else {
            return parent::_NewElement($aData);
        }
    }
550828
public function get($type = FALSE)
  {
    $result = $this->peek($type);
	
    $this->clear($type);
	
    return $result;
  }
895591
public function create(string $type): RenderableElementInterface
    {
        $type = (string) $type;
        $search = strtolower($type);

        if (isset($this->typeToView[$search])) {
            $class = $this->typeToView[$search];

            return new $class();
        } elseif (class_exists($type)) {
            $class = new $type();
            if ($class instanceof RenderableElementInterface) {
                return $class;
            }
        }

        throw new Exception\UnknownTypeException(
            sprintf(
                'The given type "%s" is not an instance of "%s".',
                $type,
                RenderableElementInterface::class
            )
        );
    }
247290
public function mustBeTypeOf(string $type) : Slot
    {
        static $allowed_types = [
            'boolean',
            'bool',
            'integer',
            'int',
            'float',
            'double',
            'string',
            'array',
            'object',
            'resource',
            'NULL',
            'null',
        ];
        $this->type = in_array($type,$allowed_types) ? $type : self::TYPE_ANY;
        return $this;
    }
1025187
public function createElement($type, $name, $options = null) {
        $element = parent::createElement($type, $name, $options);
        return $element;
    }
306025
public function setRequestType ($type = FALSE)
	{
		
		// If there is a request argument
		
		if ($type !== FALSE)
		{
			
			// Set it
			
			$this->requestType	= $type;
			
		}
		
		// Else if there is a request format URL variable
		
		else if (isset ($_GET['request_type']))
		{
			
			// Set it
			
			$this->requestType	= $_GET['request_type'];
			
		}
		
	}
297663
public function setType($type)
    {
        if ($type === null) {
            $type = self::TYPE_UNDEFINED;
        }

        $this->type = $type;

        return $this;
    }
452623
public function loadElement($type, $key)
    {
        $json = $this->load();
        $fields = array();
        $columns = $json[$type]["elements"][$key]["columns"];

        //Check if it is an array before trying to count it
        if (is_array($columns) && count($columns) > 0) {
            foreach ($columns as $fieldName) {
                $fields[$fieldName] = $json[$type]["tca"][$fieldName];
            }
        }
        if (count($fields) > 0) {
            $json[$type]["elements"][$key]["tca"] = $fields;
        }
        return $json[$type]["elements"][$key];
    }
325824
public function next($type = false)
    {
        if ($type === false || $type === true) {
            $this->_current++;
            return $this->current($type);
        }
        $content = '';
        $start = $this->_current++;
        $count = $this->count();

        $list = array_fill_keys((array) $type, true);

        while ($this->_current < $count) {
            $content .= $this->_data[$this->_current][1];
            if (isset($list[$this->_data[$this->_current][0]])) {
                return $content;
            }
            $this->_current++;
        }
        $this->_current = $start;
    }
1159930
public function build($type)
    {
        if (!isset($this->types[$type])) {
            throw new \Exception("Unknown request type.");
        }
        return new $this->types[$type]();
    }
207243
protected function LoadElement()
    {
        if ($this->Content()->Exists()) {
            return $this->ElementSchema()->ByContent($this->Content());
        }
        return $this->ElementSchema()->CreateInstance();
    }
1127858
public static function loadData($type, $data)
    {
        if ($data === false || strlen($data) == 0) {
            return false;
        }
        $tmp = unpack($type, $data);

        return current($tmp);
    }