Render a dump for an array.

@param Model $model
The data we are analysing.

@return string
The rendered markup.
188786
public function process(Model $model)
    {
        $multiline = false;
        $count = count($model->getData());

        if ($count > (int) $this->pool->config->getSetting(Fallback::SETTING_ARRAY_COUNT_LIMIT)) {
            // Budget array analysis.
            $model->injectCallback(
                $this->pool->createClass('Brainworxx\\Krexx\\Analyse\\Callback\\Iterate\\ThroughLargeArray')
            )->setHelpid('simpleArray');
        } else {
            // Complete array analysis.
            $model->injectCallback(
                $this->pool->createClass('Brainworxx\\Krexx\\Analyse\\Callback\\Iterate\\ThroughArray')
            );
        }

        // Dumping all Properties.
        return $this->pool->render->renderExpandableChild(
            $model->setType(static::TYPE_ARRAY)
                ->setNormal($count . ' elements')
                ->addParameter(static::PARAM_DATA, $model->getData())
                ->addParameter(static::PARAM_MULTILINE, $multiline)
        );
    }
873396
private function addModelToArraySimpleMode($models, $model)
    {
        $apply_to_models = array();
        
        if (count($models) > 0) {
            foreach ($models as $item) {
                $object = $model->find($item);
                if ($object != null) {
                    $apply_to_models[] = $object;
                }
            }
        }
        
        return $apply_to_models;
    }
589661
public function onPreviewHtmlReport(Model $model)
    {
        $this->onReportsHistory();
        Breadcrumbs::register('logger-reports-preview-' . $model->id, function($breadcrumbs) use($model) {
            $breadcrumbs->parent('logger-reports-history');
            $breadcrumbs->push('Preview report ' . $model->name, handles('antares::logger/view/' . $model->id));
        });
        view()->share('breadcrumbs', Breadcrumbs::render('logger-reports-preview-' . $model->id));
    }
169948
public static function utf8EncodeModel(Model $model)
    {
        foreach($model->toArray() as $key => $value) {
            if (is_numeric($value) || !is_string($value)) {
                continue;
            }
            $model->$key = utf8_encode($value);
        }

        return $model;
    }
1372647
protected function render($template, $model)
    {
        $twig = $this->getTwig();

        return $twig->render($template, $model);
    }
1074390
public function executeGetColumnData($model, $params = [])
	{
		$value = null;
		if (isset($params['value']) && $params['value'] !== null) {
			if (is_string($params['value'])) {
				$value = ArrayHelper::getValue($model, $params['value']);
			} else {
				$value = call_user_func($params['value'], $model, $this);
			}
		} elseif (isset($params['attribute']) && $params['attribute'] !== null) {
			$value = ArrayHelper::getValue($model, $params['attribute']);
		}

		if (isset($params['format']) && $params['format'] != null)
			$value = $this->formatter()->format($value, $params['format']);

		return $value;
	}
1278781
public function render(Model $model, $source)
    {
        return view(static::VIEW, [
            'color' => $this->resolveModelSource($model, $source),
        ]);
    }
611311
public function dump($model = null)
    {
        if ($model) {
            $all = $this->all($model);
            Functions::dumpGrid($all, $model);
        } else {
            $this->dumpSchema();
        }
    }
929015
protected function saveColumns(Model $model)
    {
        /** @var \T4\Orm\Model $class */
        $class = get_class($model);
        $columns = $class::getColumns();
        $relations = $class::getRelations();
        $cols = [];
        $sets = [];
        $data = [];

        foreach ($columns as $column => $def) {
            if (isset($model->{$column}) && null === $model->{$column} && isset($def['default'])) {
                $sets[$column] = ':' . $column;
                $data[':'.$column] = $def['default'];
            } else {
                $cols[] = $column;
                $sets[$column] = ':' . $column;
                switch ($def['type']) {
                    case 'boolean':
                        $data[':' . $column] = (int)$model->{$column};
                        break;
                    default:
                        $data[':' . $column] = $model->{$column};
                        break;
                }
            }
        }

        foreach ($relations as $rel => $def) {
            switch ($def['type']) {
                case $class::BELONGS_TO:
                    $column = $class::getRelationLinkName($def);
                    if (!in_array($column, $cols)) {
                        // todo: test this!
                        //if (isset($model->{$column}) && !is_null($model->{$column})) {
                        if (isset($model->{$column})) {
                            $sets[$column] = ':' . $column;
                            $data[':'.$column] = $model->{$column};
                        } elseif (isset($model->{$rel}) && $model->{$rel} instanceof Model) {
                            $sets[$column] = ':' . $column;
                            $data[':'.$column] = $model->{$rel}->getPk();
                        }
                    }
                    break;
            }
        }

        $connection = $class::getDbConnection();
        if ($model->isNew()) {
            $query = new Query();
            $query->insert($class::getTableName())
                ->values($sets)
                ->params($data);
            $connection->execute($query);
            $model->{$class::PK} = $connection->lastInsertId();
        } else {
            $query = new Query();
            $query->update($class::getTableName())
                ->values($sets)
                ->where($this->quoteName($class::PK) . '='. $model->getPk())
                ->params($data);
            $connection->execute($query);
        }

        return $model;

    }
909139
public function render($model, array $fields = [], $element = self::DEFAULT_ELEMENT, array $data = [])
    {
        $data = Hash::merge([
            'clearUrl'   => [],
            'model'      => $model,
            'formFields' => $fields,
        ], $data);

        return $this->_View->element($element, $data);
    }
285931
public function getGroupName(Model $model) {
		$modelNamePlural = $this->getModelNamePlural($model);
		$groupNameCamel = Inflector::humanize(Inflector::underscore($modelNamePlural));
		$groupName = mb_ucfirst(mb_strtolower($groupNameCamel));

		return $groupName;
	}
995618
public function process(Model $model)
    {
        $data = $model->getData();

        // Check if this is a possible callback.
        // We are not going to analyse this further, because modern systems
        // do not use these anymore.
        if (function_exists($data) === true) {
            $model->setIsCallback(true);
        }

        // Checking the encoding.
        $encoding = $this->pool->encodingService->mbDetectEncoding($data);
        if ($encoding === false) {
            // Looks like we have a mixed encoded string.
            // We need to tell the dev!
            $length = $this->pool->encodingService->mbStrLen($data);
            $strlen = 'broken encoding ' . $length;
            $model->addToJson(static::META_ENCODING, 'broken');
        } else {
            // Normal encoding, nothing special here.
            $length = $strlen = $this->pool->encodingService->mbStrLen($data, $encoding);
        }

        if ($length > 20) {
            // Getting mime type from the string.
            // With larger strings, there is a good chance that there is
            // something interesting in there.
            $model->addToJson(static::META_MIME_TYPE, $this->bufferInfo->buffer($data));
        }

        // Check, if we are handling large string, and if we need to use a
        // preview (which we call "extra").
        // We also need to check for linebreaks, because the preview can not
        // display those.
        if ($length > 50 || strstr($data, PHP_EOL) !== false) {
            $cut = $this->pool->encodingService->encodeString(
                $this->pool->encodingService->mbSubStr($data, 0, 50)
            ) . static::UNKNOWN_VALUE;

            $data = $this->pool->encodingService->encodeString($data);

            $model->setHasExtra(true)
                ->setNormal($cut)
                ->setData($data);
        } else {
            $model->setNormal($this->pool->encodingService->encodeString($data));
        }

        return $this->pool->render->renderSingleChild(
            $model->setType(static::TYPE_STRING . $strlen)
                ->addToJson(static::META_LENGTH, $length)
        );
    }
1256498
public function process(Model $model)
    {
        $data = $model->getData() ? 'TRUE' : 'FALSE';
        return $this->pool->render->renderSingleChild(
            $model->setData($data)
                ->setNormal($data)
                ->setType(static::TYPE_BOOL)
        );
    }
373058
public function formatOutput($data, $model=null)
    {
        if ($data) {
            if (is_numeric(key($data))) {
                foreach ($data as $k => $v){
                    if (is_numeric($k) && is_array($v)) {
                        $data[$k] = static::formatOutputRecord($v, $model);
                    }
                }
            } else {
                $data = static::formatOutputRecord($data, $model);
            }
        }
        
        return $data;
    }
551460
public function render(ViewModelInterface $model)
    {
        foreach ($model as $child) {
            $groupId = $child->getGroupId();
            if (empty($groupId)) {
                continue;
            }
            $result    = $this->render($child);
            $oldResult = $model->getVariable($groupId, '');
            $model->setVariable($groupId, $oldResult . $result);
        }

        $events = $this->getEvents();
        $event  = new ViewEvent($model);
        $events->trigger($event);

        return $event->getResult();
    }
342817
public function append(Model $model)
    {
        $result = null;
        // If the list was filtered make sure that value is set on the model.
        if ($this->filter !== null) {
            $result = $this->filter->setFilterValuesOnModel($model);
        }
        $model->save();

        // Make sure the list is refetched.
        $this->invalidate();

        return ($result === null) ? $model : $result;
    }
1178081
public static function generateTemplateWidget($model){
        $templateWidget = Html::beginTag('div', ['data-id' => (string) $model->_id, 'data-category' => $model->category, 'class' => 'let_widget_origin']);
            $templateWidget .= $model->title;
        $templateWidget .= Html::endTag('div');
        
        return $templateWidget;
    }