Gets the alignment for the element based on the type
@param string $type The type of the element
@param XBRL_Instance $instance
@return string The alignment to use
175106
public function valueAlignment( $type, $instance )
	{
		$parts = explode( ':', $type );
		if ( count( $parts ) < 2 )
		{
			return $this->valueAlignmentForNamespace( null, null, $type );
		}

		$namespace = $instance->getInstanceTaxonomy()->getNamespaceForPrefix( $parts[0] );
		if ( ! $namespace ) $namespace = $instance->getNamespaceForPrefix( $parts[0] );

		return $this->valueAlignmentForNamespace( $namespace, $parts[1] );
	}
697930
public function getForm($identifier, $instance) {
		$form = $this->jquery->semantic ()->dataForm ( $identifier, $instance );
		$form->setLibraryId ( "frmEdit" );
		$className = \get_class ( $instance );
		$fields = $this->controller->_getAdminData ()->getFormFieldNames ( $className, $instance );
		$relFields = OrmUtils::getFieldsInRelations_ ( $className );

		$this->setFormFields_ ( $fields, $relFields );
		array_unshift ( $fields, "_message" );
		$form->setFields ( $fields );

		$fieldTypes = OrmUtils::getFieldTypes ( $className );
		$this->setFormFieldsComponent ( $form, $fieldTypes );
		$this->relationMembersInForm ( $form, $instance, $className, $fields, $relFields );
		OrmUtils::setFieldToMemberNames ( $fields, $relFields );
		$form->setCaptions ( $this->getFormCaptions ( $fields, $className, $instance ) );
		$message = $this->getFormTitle ( $form, $instance );
		$form->setCaption ( "_message", $message ["subMessage"] );
		$form->fieldAsMessage ( "_message", [ "icon" => $message ["icon"] ] );
		$instance->_message = $message ["message"];
		$form->setSubmitParams ( $this->controller->_getBaseRoute () . "/update", "#frm-add-update" );
		$form->onGenerateField ( [ $this,'onGenerateFormField' ] );
		return $form;
	}
994181
public static function getInstance($type)
	{
		// Sanitize format type.
		$type = strtolower(preg_replace('/[^A-Z0-9_]/i', '', $type));

		// Only instantiate the object if it doesn't already exist.
		if (!isset(self::$instances[$type]))
		{
			$class = '\\Joomla\\Registry\\Format\\' . ucfirst($type);

			if (!class_exists($class))
			{
				throw new \InvalidArgumentException('Unable to load format class.', 500);
			}

			self::$instances[$type] = new $class;
		}

		return self::$instances[$type];
	}
867106
protected function match($type)
    {
        if ( ! $this->lexer->isNext($type)) {
            $this->syntaxError($this->lexer->getName($type));
        }

        $this->lexer->moveNext();

        return $this->lexer->token[0];
    }
116780
public function getTypeClass($type)
    {
        if (isset($this->types[$type])) {
            return $this->types[$type];
        }

        if (\class_exists($type)) {
            return $type;
        }

        return null;
    }
51095
protected function getFormTitle($form, $instance) {
		$type = ($instance->_new) ? "new" : "edit";
		$messageInfos = [ "new" => [ "icon" => HtmlIconGroups::corner ( "table", "plus", "big" ),"subMessage" => "New object creation" ],"edit" => [ "icon" => HtmlIconGroups::corner ( "table", "edit", "big" ),"subMessage" => "Editing an existing object" ] ];
		$message = $messageInfos [$type];
		$message ["message"] = \get_class ( $instance );
		return $message;
	}
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;
	}
250460
private function getTypeSuffix($type)
    {
        self::$TYP_MAPPING = array_merge(self::$TYP_COMPLEX_MAPPING, self::$TYP_SIMPLE_MAPPING);

        if ($type == '') {
            return '';
        }

        if (!isset(self::$TYP_MAPPING[$this->type])) {
            return '';
        }

        return self::$TYP_MAPPING[$this->type];
    }
440538
protected function getConfigInstance($instance)
    {
        if (is_callable($instance)) {
            return call_user_func($instance, $this->app);
        } elseif (is_string($instance)) {
            return $this->app->make($instance);
        }

        return $instance;
    }
512788
private static function getInstanceAndNodeByType(string $instance, string $node, int $type): array
    {
        if (!empty($node)) {
            return [$instance, $node];
        }

        if ($type === self::RETURN_ROWS || $type === self::RETURN_INSERTID) {
            return [$instance, Pool::MASTER];
        }

        return [$instance, Pool::SLAVE];
    }
714587
protected function get_instance($instance) {
        global $DB;
        if (is_scalar($instance)) {
            // instance id is passed as parameter
            $instance = $DB->get_record('grading_instances', array('id'  => $instance), '*', MUST_EXIST);
        }
        if ($instance) {
            $class = 'gradingform_'. $this->get_method_name(). '_instance';
            return new $class($this, $instance);
        }
        return null;
    }
631330
public static function factory(StyleType $type): Style
    {
        return self::evaluate($type)->isInstanceOf(Style::class)->getValue();
    }
92654
public function form($instance)
    {
        if (isset($instance['title'])) {
            $title = $instance['title'];
        } else {
            $title = __('New title', 'wpb_widget_domain');
        }

        if (isset($instance['show_parent'])) {
            $show_parent = $instance['show_parent'];
        } else {
            $show_parent = 0;
        }
        ?>
            <p>
                <label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?></label> 
                <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" />
            </p>
            <p>
                <input class="checkbox" type="checkbox" id="<?php echo $this->get_field_id('show_parent'); ?>" name="<?php echo $this->get_field_name('show_parent'); ?>" <?php checked($show_parent); ?>>
                &nbsp;<label for="<?php echo $this->get_field_id('show_parent'); ?>"><?php _e('Include the top level page', 'snap'); ?></label>
            </p>
        <?php
    }
1262003
public function form( $instance ) {
		parent::form( $instance );

		$menus = get_terms( 'nav_menu', array( 'hide_empty' => true ) );

		$selected_menu = isset( $instance['menu'] ) ? $instance['menu'] : '';

		$menu_field_name = $this->get_menu_field_id();

		?>

		<p>

			<label for="<?php echo esc_attr( $menu_field_name ) ?>">Menu:</label>

			<select id="<?php echo esc_attr( $menu_field_name ) ?>"
					name="<?php echo esc_attr( $menu_field_name ) ?>">

				<?php foreach ( $menus as $menu ) : ?>

					<option value="<?php echo esc_attr( $menu->slug ) ?>"
						<?php selected( $selected_menu, $menu->slug ); ?> >
						<?php echo esc_html( $menu->name ) ?>
					</option>

				<?php endforeach ?>

			</select>

		</p>

		<?php
	}
62155
public function withType($type)
    {
        $choices = [
            PriceInterface::TYPE_OWN,
            PriceInterface::TYPE_RENT,
        ];

        Assertion::choice($type, $choices);

        $instance = clone $this;

        $instance->type = $type;

        return $instance;
    }
499307
public function getStatement($type = null)
    {
        $data = array();
        $wheres = array();
        $matchOrs = array();

        if (is_null($this->match)) {
            $criteria = $this->translateCriteria($this->criteria);
            
            if ($criteria) {
                foreach ($criteria as $key => $value) {
                    $wheres[] = $this->dialect->grammarExpression($key, $value,$this->collection, $data);
                }
            }
        } else {
            $schema = $this->collection->schema();

            $i = 0;

            foreach ($schema as $key => $value) {
                if ($value instanceof \Norm\Schema\Reference) {
                    $foreign = $value['foreign'];
                    $foreignLabel = $value['foreignLabel'];
                    $foreignKey = $value['foreignKey'];
                    $matchOrs[] = $this->getQueryReference($key, $foreign, $foreignLabel, $foreignKey, $i);
                } else {
                    $matchOrs[] = $key.' LIKE :f'.$i;
                    $i++;
                }
            }

            $wheres[] = '('.implode(' OR ', $matchOrs).')';
        }

        $select  = '';

        if ($this->skip > 0 or $this->limit > 0) {
            $select .= 'rownum r, ';
        }

        $select  .= $this->collection->getName().'.*';
        $query   = 'SELECT '.$select.' FROM '.$this->collection->getName();
        $order   = '';

        if ($this->sortBy) {
            foreach ($this->sortBy as $key => $value) {
                if ($value == 1) {
                    $op = ' ASC';
                } else {
                    $op = ' DESC';
                }
                $order[] = $key . $op;
            }

            if (!empty($order)) {
                $order = ' ORDER BY '.implode(',', $order);
            }
        }

        if (!empty($wheres)) {
            $query .= ' WHERE '.implode(' AND ', $wheres);
        }

        $limit = '';

        if ($this->skip > 0) {
            $limit = 'r > '.($this->skip).' AND ROWNUM <= (SELECT COUNT(ROWNUM) FROM ('.$query.'))';

            if ($this->limit > 0) {
                $limit = 'r > '.($this->skip).' AND ROWNUM <= ' . $this->limit;
            }
        } elseif ($this->limit > 0) {
            $limit = 'r <= ' . $this->limit;
        }

        $query .= $order;

        if ($limit !== '') {
            $query = 'SELECT * FROM ('.$query.') WHERE '.$limit;
        }
        
        $statement = oci_parse($this->raw, $query);

        foreach ($data as $key => $value) {
            oci_bind_by_name($statement, ':'.$key, $data[$key]);
        }

        if ($matchOrs) {
            
            $match = '%'.$this->match.'%';

            foreach ($matchOrs as $key => $value) {
                oci_bind_by_name($statement, ':f'.$key, $match);
            }
        }
        
        oci_execute($statement);

        $result = array();

        while ($row = oci_fetch_array($statement, OCI_ASSOC + OCI_RETURN_LOBS + OCI_RETURN_NULLS)) {
            $result[] = $row;
        }


        $this->rows = $result;

        oci_free_statement($statement);

        $this->index = -1;

    }
576236
static public function instance($type=null)
    {
        $type = $type ?: 'default';
        if (!isset(static::$instances[$type])) {
            $options = ['type' => $type];
            static::$instances[$type] = new static($options);
        }
        return static::$instances[$type];
    }