Create a basic hint from a row loaded from the question_hints table in the database.
@param object $row with property options as well as hint, shownumcorrect and clearwrong set.
@return question_hint_ddmarker
169428
public static function load_from_record($row) {
        return new question_hint_ddmarker($row->id, $row->hint, $row->hintformat,
                $row->shownumcorrect, $row->clearwrong, $row->options);
    }
736238
protected function generateBoxLabel($row)
    {
        // Generate the title
        $html = '<span class="title">'.$row->getAdminTitleHtmlAttribute().'</span>';

        // Add link to edit
        $url = '/'.Config::get('decoy.core.dir').'/'.Str::snake($this->name, '-')
            .'/'.$row->getKey().'/edit';
        if (app('decoy.user')->can('update', $url)) {
            $html .= '<a href="'.$url.'"><span class="glyphicon glyphicon-pencil edit"></span></a>';
        }

        // The str_replace fixes Former's auto conversion of underscores into spaces.
        $html = str_replace('_', '&#95;', $html);

        return $html;
    }
85654
protected function checkRow(array $row) {
		foreach ($row as $column => $str) {
			$width = Colors::width( $str, $this->isAsciiPreColorized( $column ) );
			if (!isset($this->_width[$column]) || $width > $this->_width[$column]) {
				$this->_width[$column] = $width;
			}
		}

		return $row;
	}
1206777
public function write_hints($question) {
        if (empty($question->hints)) {
            return '';
        }

        $output = '';
        foreach ($question->hints as $hint) {
            $output .= $this->write_hint($hint, $question->contextid);
        }
        return $output;
    }
421259
protected function col_name($row) {
        return html_writer::link(new moodle_url('/admin/tool/lp/plan.php', array('id' => $row->id)),
            format_string($row->name, true, array('context' => $this->context)));
    }
623057
private static function createModel( $row )
    {
        $table_name = get_called_class();
        
        $model = new $table_name();
        
        $model->setExists( true );
        
        foreach ( $row as $key => $value )
        {
            if ( !is_int($key) )
            {
                $model->$key = $value;
                $model->_snapshot[$key] = $value;
            }
        }
        
        return $model;
    }
129515
public function toHtml(array $row)
    {
        if ($this->getLabel() == '') {
            throw new \InvalidArgumentException(
                'A label is required for this action type, please call $action->setLabel()!'
            );
        }

        $label = $this->getLabel();
        if ($label instanceof AbstractColumn) {
            $label = $row[$label->getUniqueId()];
        }

        return '<a '.$this->getAttributesString($row).'>'.$label.'</a>';
    }
811553
protected function instantiateItem(array $row)
    {
        if ( ! count($this->intermediateFields)) {
            return parent::instantiateItem($row);
        }

        $itemAttributes         = Arr::only($row, $this->itemFields);
        $intermediateAttributes = Arr::only($row, $this->intermediateFields);
        /** @var \Colibri\Database\Model $item */
        $item = new static::$itemClass($itemAttributes);

        return $item->setIntermediate($intermediateAttributes);
    }
1354535
protected function getDivisor($row)
    {
        if (!is_null($this->totalValueUsedAsDivisor)) {
            return $this->totalValueUsedAsDivisor;
        } elseif ($this->getDivisorFromSummaryRow) {
            $summaryRow = $this->table->getRowFromId(DataTable::ID_SUMMARY_ROW);
            return $summaryRow->getColumn($this->columnNameUsedAsDivisor);
        } else {
            return $row->getColumn($this->columnNameUsedAsDivisor);
        }
    }
954643
public function insertRow($row)
    {
        if ($row instanceof Row) {
            $this->rows []= $row;
        } elseif (is_array($row)) {
            $newRow = new Row;
            foreach ($row as $cell) {
                $newRow->setCell($cell);
            }
            $this->insertRow($newRow);
        } else {
            throw new \InvalidArgumentException(
                "Argument 1 must be an instance of DataTable\Row or an array of DataTable\Cell"
            );
        }

        return $this;
    }
475148
public function create($row = array()){
        $class = $this->modelClass;
        $model = new $class($this->db, $row);
        $model->setAttribute('table', $this->table)->setAttribute('pk', $this->pk);
        
        return $model;
    }
161126
protected function rowToObject($row)
    {
        if ('array' == $this->returnDataType) {
            return $row;
        }

        if ($row) {
            $object = $this->createEntity();
            $this->loadObjectFromArray($object, $row);

            return $object;
        }

        return;
    }
903591
public function col_note($row) {
        if ($this->is_downloading()) {
            return $row->note;
        } else {
            return format_text($row->note, FORMAT_MOODLE);
        }
    }
1303779
protected function formatRow($row)
    {
        foreach ($row as &$column) {
            if (!is_scalar($column)) {
                $column = $this->serialize($column);
            }
            switch ($this->quoting) {
                case self::QUOTE_NONE:
                    // do nothing... no quoting is happening here
                    break;
                case self::QUOTE_ALL:
                    $column = $this->quote($this->escape($column));
                    break;
                case self::QUOTE_NONNUMERIC:
                    if (preg_match("/[^0-9]/", $column)) {
                        $column = $this->quote($this->escape($column));
                    }
                    break;
                case self::QUOTE_MINIMAL:
                default:
                    if ($this->containsSpecialChars($column)) {
                        $column = $this->quote($this->escape($column));
                    }
                    break;
            }
        }

        return $row;
    }
1088316
public function format_row($row) {
        if ($this->rownum < 0) {
            $this->rownum = $this->currpage * $this->pagesize;
        } else {
            $this->rownum += 1;
        }

        return parent::format_row($row);
    }
483431
protected function populateItem($row)
    {
        $class = $row['type'] == Item::TYPE_PERMISSION ? Permission::className() : Role::className();

        if (!isset($row['data']) || ($data = @unserialize($row['data'])) === false) {
            $data = null;
        }

        return new $class([
            'name' => $row['name'],
            'type' => $row['type'],
            'description' => $row['description'],
            'ruleName' => $row['rule_name'],
            'data' => $data,
            'createdAt' => $row['created_at'],
            'updatedAt' => $row['updated_at'],
            'parents' => isset($row['parents']) ? $row['parents'] : null,
        ]);
    }
1026906
public function castRow($row)
    {
        if ($this->isLocked) {
            // schema is locked, no more inferring is needed
            return parent::castRow($row);
        } else {
            // add the row to the inferrer, update the descriptor according to the best inferred fields
            $this->fieldsInferer->addRows([$row]);
            $this->descriptor->fields = [];
            foreach ($this->fieldsInferer->infer() as $fieldName => $inferredField) {
                /* @var Fields\BaseField $inferredField */
                $this->descriptor->fields[] = $inferredField->descriptor();
            }
            $this->castRows = $this->fieldsInferer->castRows();

            return $this->castRows[count($this->castRows) - 1];
        }
    }