Opens a grid.

Call {@link core_course_management_renderer::grid_column_start()} to create columns.

@param string $id An id to give this grid.
@param string $class A class to give this grid.
@return string
173666
public function grid_start($id = null, $class = null) {
        $gridclass = 'grid-start grid-row-r d-flex flex-wrap row';
        if (is_null($class)) {
            $class = $gridclass;
        } else {
            $class .= ' ' . $gridclass;
        }
        $attributes = array();
        if (!is_null($id)) {
            $attributes['id'] = $id;
        }
        return html_writer::start_div($class, $attributes);
    }
1060942
private function createTable(array $data, $class)
    {
        $table = new NodeElement();
        $table->openTag('table')
              ->setClass($class);

        $tbody = new NodeElement();
        $tbody->openTag('tbody');

        foreach ($data as $key => $value) {
            $row = $this->createRow($key, $value);
            $tbody->appendChild($row);
        }

        $tbody->closeTag();
        $table->appendChild($tbody);

        $table->closeTag();
        return $table;
    }
121167
function render($class = '', $id = '', $return = false)
    {
        $link = $this->link . ($this->getparams ? '?'.$this->getparams.'&' : '?');
        ?>
        <div <?=(($id != '')? 'id="'.$id.'"' : '')?> <?=(($class != '')? 'class="'.$class.'"' : '')?>>
	        <a class="start" href="<?=$link?>p=1" title="Start">&nbsp;</a>
	        <a class="back" href="<?=$link?>p=<?=max($this->getPageNum() - 1, 1)?>"
		        title="Back">&nbsp;</a>
	        <?foreach($this->getPagesList() as $page):?>
	            <a class="number<?=($page == $this->getPageNum()? ' selected' : '')?>"
                    href="<?=$link?>p=<?=$page?>" title="Back"><?=$page?></a>
	        <?endforeach?>
	        <a class="next" href="<?=$link?>p=<?=min($this->getPageNum() + 1, $this->getPages())?>"
                title="Back">&nbsp;</a>
	        <a class="end" href="<?=$link?>p=<?=$this->getPages()?>"
                title="End">&nbsp;</a>
        </div>
        <?php
    }
119868
public function Columns($id = null)
    {
        $singleton = $this->dataRecord->getDataSingleton();
        $columns   = $singleton->summaryFields();
        $list      = ArrayList::create();
        $result    = null;

        if ($id) {
            $result = $this->queryList()->byId($id);
        }

        foreach ($columns as $name => $title) {
            // Check for unwanted parameters
            if (preg_match('/[()]/', $name)) {
                throw new RegistryException(_t(
                    'SilverStripe\\Registry\\RegistryPageController.UNWANTEDCOLUMNPARAMETERS',
                    "Columns do not accept parameters"
                ));
            }

            // Get dot deliniated properties
            $properties = explode('.', $name);

            // Increment properties for value
            $context = $result;
            foreach ($properties as $property) {
                if ($context instanceof ViewableData) {
                    $context = $context->obj($property);
                }
            }

            // Check for link
            $link = null;
            $useLink = $singleton->config()->get('use_link');
            if ($useLink !== false) {
                if ($result && $result->hasMethod('Link')) {
                    $link = $result->Link();
                }
            }

            // Format column
            $list->push(ArrayData::create([
                'Name' => $name,
                'Title' => $title,
                'Link' => $link,
                'Value' => $context,
                'CanSort' => $this->canSortBy($name)
            ]));
        }
        return $list;
    }
918380
public function create($class, $id, $path, $label, $permission, $options = [])
    {
        foreach ($this->itemFactories as $itemFactory) {
            if ($itemFactory->supports($class)) {
                return $itemFactory->build($class, $id, $path, $label, $permission, $options);
            }
        }
    }
915895
public function render($content, $class = '', $id = '', array $attrs = array())
    {
        $attrs = $this->_setId($attrs, $id);
        $attrs = $this->_cleanAttrs($attrs);

        if (!empty($class)) {
            $attrs = $this->_normalizeClassAttr($attrs, $class);
        }

        $tag = $this->_tag;
        if (Arr::key('tag', $attrs)) {
            $tag = $attrs['tag'];
            unset($attrs['tag']);
        }

        $format = (!empty($attrs)) ? '<%s %s>%s</%s>' : '<%s%s>%s</%s>';
        $output = sprintf($format, $tag, $this->buildAttrs($attrs), $content, $tag);

        return $output;
    }
137585
public function add($id, $columnClass, array $options = array())
    {
        $this->columns[$id] = array(
            'class' => $columnClass,
            'options' => $options,
        );

        return $this;
    }
606052
public function getColumn($id)
    {
        $column = $this->getComponent($id);
        if (!$column) {
            throw new RuntimeException("Column '$id' is not defined.");
        }
        if (!$column instanceof Column) {
            throw new RuntimeException("'$id' is not a column.");
        }
        return $column;
    }
1218140
public static function classAttributeIdentifierByID( $id )
    {
        $identifierHash = array_flip( self::classAttributeIdentifiersHash() );

        if ( isset( $identifierHash[$id] ) )
        {
            $classAndClassAttributeIdentifier = explode( '/', $identifierHash[$id] );
            return $classAndClassAttributeIdentifier[1];
        }
        else
            return false;
    }
231858
public function getImageDimension($columnClass)
    {
        switch ($columnClass) {
            case "grid-md-12": // 1-col
                $this->thumbnailSize = array(1200, 900);
                return $this->thumbnailSize;

            case "grid-md-6": // 2-col
                $this->thumbnailSize = array(800, 600);
                return $this->thumbnailSize;

            default:
                $this->thumbnailSize = array(400, 300);
                return $this->thumbnailSize;
        }
    }
1132640
public function dsql($class = null)
    {
        $obj = parent::dsql($class);
        if (!$obj instanceof DB_dsql_prefixed) {
            throw $this->exception('Specified class must be descendant of DB_dsql_prefixed')
            ->addMoreInfo('class', $class);
        }
        if ($this->table_prefix) {
            $obj->prefix($this->table_prefix);
        }

        return $obj;
    }
962363
public function getColumn($id)
    {
        $returnValue = null;

        
		if(isset($this->columns[$id]) && $this->columns[$id] instanceof tao_helpers_grid_Column){
			$returnValue = $this->columns[$id];
		}
        

        return $returnValue;
    }
400505
public function newInstance($class = null, $options = [])
    {
        if ($class === null) {
            $class = get_class($this);
        } elseif ($class instanceof self) {
            $class = get_class($class);
        }

        if (is_string($class) && $class[0] != '\\') {
            $class = '\\'.$class;
        }

        if ($this->persistence) {
            return $this->persistence->add($class, $options);
        }

        return new $class($options);
    }
140606
public static function loadById(int $id, string $column = '') {
		$class = get_called_class();
		$model = new $class();
		$pk = $model->pk;
		$last = array_pop($model->pk);
		$result = $model->get([
			'where' => [
				$last => $id
			],
			'pk' => [$last],
			'single_row' => true,
			'skip_acl' => true
		]);
		if (!empty($column)) {
			return $result[$column] ?? null;
		}
		return $result;
	}
534763
protected function createMigration( $class )
	{
		if( strpos( $class, 'm000000_000000_ysell_invoice_dev' ) !== false ) {
			$trap = 1;
		}
		
		$params = [
			'class'   => $class,
			'db'      => $this->db,
			'compact' => $this->compact,
		
		];
		
		if( $class instanceof Migration ) {
			array_push( $params, [
				'mode' => $this->alterMode,
			] );
		}
		
		return Yii::createObject( $params );
	}
577285
function factory($id,$row) {
		$mapper=clone($this);
		$mapper->reset();
		$mapper->id=$id;
		foreach ($row as $field=>$val)
			$mapper->document[$field]=$val;
		$mapper->query=[clone($mapper)];
		if (isset($mapper->trigger['load']))
			\Base::instance()->call($mapper->trigger['load'],$mapper);
		return $mapper;
	}
1247123
public function findOrNew($id, $columns = ['*'])
    {
        if (! is_null($model = $this->find($id, $columns))) {
            return $model;
        }

        return $this->newModelInstance();
    }