handleData

@return  static
345419
public function handleData()
    {
        $data = $this->getData();

        $this->prepareRender($data);

        $this->prepareData($data);

        $this->prepareGlobals($data);

        $dispatcher = $this->getPackage()->getDispatcher();

        $dispatcher->triggerEvent('onViewAfterHandleData', [
            'data' => &$data,
            'view' => $this
        ]);

        return $this;
    }
250912
protected function runHandler($data)
    {
        /** @var ArrayDataObject $data */
        $input     = $data->getArray();
        $newObject = $this->form->createNewObjectFromInput($input);

        $this->form->invokeBeforeSubmitCallbacks($newObject, $input);
        $this->form->bindToObject($newObject, $input);
        $this->form->invokeOnSubmitCallbacks($newObject, $input);

        $this->dataSource->save($newObject);

        $this->form->invokeOnSaveCallbacks($newObject, $input);

        return $newObject;
    }
1284886
public function handle($data = null)
    {

        // Handle data with adaptor
        $adaptor = $this->getAdaptor();
        if ( $adaptor ) {
            $data = $adaptor->transform( $data, $this );
        }

        // Overwrite default data with data
        $data = array_merge( [
            'name'=>null,
            'width'=>null,
            'height'=>null,
            'focus_point_x'=>0,
            'focus_point_y'=>0,
            'resize'=>false,
        ], $data );

        // Create variables from array keys
        extract( $data );

        // Throw error if filename is not set
        if ( ! $name ) throw new \Exception( 'You need to set a name in adaptor' );

        // Throw error if both width and height is null
        if ( ! $width && ! $height ) throw new \Exception( 'The width or the height need to be set' );

        // Create handler
        $this->handler = ImageHandler::create( $name, $this->getBaseFolder(), $this->getCropsFolder() );

        // Check if we should resize or crop
        // If one of the width or height is _ This is still a resize
        if ( $resize || ( !$width || !$height ) ) {
            $this->handler->resize( $width, $height );
        }
        else {
            $this->handler->cropToFit( $width, $height, $focus_point_x, $focus_point_y );
        }

        // Return this for binding
        return $this;
    }
1313882
protected function prepareData()
    {
        $dataProvider = $this->attributes['dataProvider'];
        $urlPattern   = $this->attributes['urlPattern'];
        $return       = new Collection();
        foreach ($dataProvider as $item) {
            $name = isset($item->title) ? $item->title : $item->name;
            $url  = str_replace('{id}', $item->id, $urlPattern);
            $return->push(['url' => handles($url), 'name' => ucfirst($name), 'id' => $item->id]);
        }
        return $return->sortBy('name');
    }
1296444
public function processar()
    {
        if ($this->isProcessado()) {
            return $this;
        }

        if (method_exists($this, 'init')) {
            call_user_func([$this, 'init']);
        }

        foreach ($this->file as $linha) {
            $inicio = $this->rem(1, 1, $linha);

            if ($inicio == '0') {
                $this->processarHeader($linha);
            } elseif ($inicio == '9') {
                $this->processarTrailer($linha);
            } else {
                $this->incrementDetalhe();
                if ($this->processarDetalhe($linha) === false) {
                    unset($this->detalhe[$this->increment]);
                    $this->increment--;
                }
            }
        }
        if (method_exists($this, 'finalize')) {
            call_user_func([$this, 'finalize']);
        }

        return $this->setProcessado();
    }
1123917
protected function setData()
    {
        // If it's already an array of arrays, we're good to go
        if (is_array(reset($this->data))) {
            return $this->setArrayOfArraysData();
        }

        $column_width = $this->getColumnWidth($this->data);
        $row_count    = $this->getMaxRows($column_width);

        return array_chunk($this->data, $row_count);
    }
641213
public function handle_get_data() {
        $url = new UrlHelper ();
        $pageNumber = $url->get('pageNumber', 1);
        $perPage = $url->get('perPage', 10);
        $filters = $url->get("filters_json", "[]");

        $params = array(
            'skip' => ($pageNumber - 1) * $perPage,
            'take' => $perPage,
            'filters_json' => $filters
        );
        return array(
            'type' => 'json',
            'data' => array (
                'rows' => $this->dataProvider->getData($params)
            )
        );
    }
323844
public function init()
    {
        foreach ($this->dynamic as $key => $data) {
            // Locate field.
            $path = explode('/', $key);
            $current = &$this->items;

            foreach ($path as $field) {
                if (\is_object($current)) {
                    // Handle objects.
                    if (!isset($current->{$field})) {
                        $current->{$field} = [];
                    }

                    $current = &$current->{$field};
                } else {
                    // Handle arrays and scalars.
                    if (!\is_array($current)) {
                        $current = [$field => []];
                    } elseif (!isset($current[$field])) {
                        $current[$field] = [];
                    }

                    $current = &$current[$field];
                }
            }

            // Set dynamic property.
            foreach ($data as $property => $call) {
                $action = 'dynamic' . ucfirst($call['action']);

                if (method_exists($this, $action)) {
                    $this->{$action}($current, $property, $call);
                }
            }
        }

        return $this;
    }
351865
public function checkDATA() {
        if (!defined(DATA))
                define(DATA,
                    __DIR__ . DIRECTORY_SEPARATOR . 'data' . DIRECTORY_SEPARATOR);

        if (!is_dir(DATA)) mkdir(DATA, 0777, true);

        return $this;
    }
6728
public function validateData()
    {
        $constraint = new Assert\Collection([
            'fields' => $this->getValidationRules(),
        ]);

        $violations = $this->validator->validate($this->getParameters(), $constraint);
        if ($violations->count()) {
            throw new ValidatorException($violations);
        }

        return $this;
    }
355696
public function setData()
    {
        // Process a collection
        if ($this->resource instanceof Collection) {
            $this->data = [];

            foreach ($this->resource->getData() as $resource) {
                $this->parseItem(new Item($resource, $this->resource->getTransformer()));
            }
        }

        // Process an item
        elseif ($this->resource instanceof Item) {
            $this->parseItem($this->resource);
        }

        return $this;
    }
566425
private function getParsedData()
    {
        if (is_array($this->parsedData)) {
            return $this->parsedData;
        }

        $this->parsedData = [
            'routes' => []
        ];

        $content = $this->getYmlFileContent();
        try {
            $parsedData = $this->parser->parse($content);
            $this->addGeneralDefaults($parsedData);
            $this->addDataRoutes($parsedData);
        } catch (ParseException $caught) {
            throw new RoutesFileParserException(
                $caught->getMessage(),
                0,
                $caught
            );
        }
        return $this->parsedData;
    }
1369308
function _handleDataReset() {
    storage.removeDataByKey(savedDataKey);

    let data = getCurrentData();

    dataEditor.setValue(prettifyJson(data));
}
679405
public function getData() {
        if ($this->toSort && !empty($this->getOrder())) {
            $this->sortData();
        }

        if ($this->getLimit()) {
            return array_slice($this->data, $this->getOffset(), $this->getLimit());
        } else {
            return $this->data;
        }
    }
153001
protected function prepareData($data)
    {
        $data->collector = $data->item['collector'];

        $data->exception = new Data($data->collector['exception']);
    }
933600
public function data()
    {
        $args = func_get_args();

        $this->each(function ($item) use ($args) {
            if (count($args) >= 2) {
                $item->data($args[0], $args[1]);
            } else {
                $item->data($args[0]);
            }
        });

        return $this;
    }
126512
protected function handleDataAttributes()
    {
        $dataAttributes = [];

        $dataAttributesAssetHandler = $this->getDataAttributesAssetHandler();

        if ($this->formObject->hasForm()) {
            if (false === $this->formObject->hasFormResult()) {
                $form = $this->formObject->getForm();
                $formValidator = $this->getFormValidator($this->getFormObjectName());
                $formResult = $formValidator->validateGhost($form);
            } else {
                $formResult = $this->formObject->getFormResult();
            }

            $dataAttributes += $dataAttributesAssetHandler->getFieldsValuesDataAttributes($formResult);
        }

        if (true === $this->formObject->formWasSubmitted()) {
            $dataAttributes += [DataAttributesAssetHandler::getFieldSubmissionDone() => '1'];
            $dataAttributes += $dataAttributesAssetHandler->getFieldsValidDataAttributes();
            $dataAttributes += $dataAttributesAssetHandler->getFieldsMessagesDataAttributes();
        }

        $this->tag->addAttributes($dataAttributes);
    }