Datatypes\Mixed\Editor::loadDatatype PHP Method

loadDatatype() protected method

Retrieve datatypes
protected loadDatatype ( string $name ) : mixed
$name string Datatype name
return mixed
    protected function loadDatatype($name)
    {
        if (!empty($this->datatypes[$name])) {
            return $this->datatypes[$name];
        }
        $class = 'Datatypes\\' . $name . '\\Datatype';
        $object = new $class();
        $object->setRequest($this->getRequest());
        $object->setHelperManager($this->getHelperManager());
        $object->setRouter($this->getRouter());
        $object->load($this->getDatatype()->getDatatypeModel(), $this->getProperty()->getDocumentId());
        $this->datatypes[$name] = $object;
        return $this->datatypes[$name];
    }