Aktualizuje wartości pól rekordu formularza przed zapisem
@return null
165044
protected function _updateRecordDataBeforeSave()
    {
        //jeśli formularz nie ma rekordu
        if (!$this->hasRecord()) {
            return;
        }
        //dla każdego elementu formularza
        foreach ($this->getElements() as $element) {
            //pomijamy inne elementy niż TinyMce
            if (!$element instanceof \Cms\Form\Element\TinyMce || !$element->getUploaderObject()) {
                continue;
            }
            //dla każdego elementu TinyMce
            $value = $element->getValue();
            foreach (\Cms\Orm\CmsFileQuery::byObjectJoinedOriginal('tmp-' . $element->getUploaderObject(), $element->getUploaderId())
                ->find() as $file) {
                if (!$file->getJoined('original_file') || !$file->getJoined('original_file')->name) {
                    continue;
                }
                $oName = $file->getJoined('original_file')->name;
                $tName = $file->name;
                $value = preg_replace('@/data/' . $tName[0] . '/' . $tName[1] . '/' . $tName[2] . '/' . $tName[3] . '/(scalecrop|scalex|scaley|default)/([0-9x]{0,10})/' . $tName . '@', '/data/' . $oName[0] . '/' . $oName[1] . '/' . $oName[2] . '/' . $oName[3] . '/$1/$2/' . $oName, $value);
            }
            $element->setValue($value);
            $this->_record->setFromArray([$element->getName() => $value]);
        }
    }
248536
public function getProcessId()
    {
        if (null === $this->processId) {
            $content = fgets($this->getFileResource());
            $pieces = explode(PHP_EOL, trim($content));
            $this->processId = reset($pieces) ?: 0;
        }

        return $this->processId ?: null;
    }
885579
public function getCondForm() {
        $clz = static::class;
        if (isset(self::$forms[ $clz ])) {
            $form = self::$forms[ $clz ];

            return $form;
        }

        return null;
    }
360362
public function setAutoTagValue()
    {
        //brak rekordu
        if (!$this->_form->hasRecord()) {
            return $this;
        }
        //ustawianie wartości
        $this->setValue((new TagRelationModel($this->getOption('object') ? $this->getOption('object') : $this->_form->getFileObjectName(), $this->_form->getRecord()->getPk()))
                ->getTagRelations());
        //zwrot obiektu
        return $this;
    }
819493
public function validateConditionsTrigger()
    {
        $field = 'data.conditions';

        if ($this->isExcluded($field)) {
            return null;
        }

        $value = $this->getSubmitted($field);

        if ($this->isUpdating() && !isset($value)) {
            $this->unsetSubmitted($field);
            return null;
        }

        $label = $this->translation->text('Conditions');

        if (empty($value)) {
            $this->setErrorRequired($field, $label);
            return false;
        }

        if (!is_array($value)) {
            $this->setErrorInvalid($field, $label);
            return false;
        }

        $submitted = $this->getSubmitted();
        $operators = array_map('htmlspecialchars', array_keys($this->condition->getOperators()));

        $errors = $modified = array();

        foreach ($value as $line => $condition) {

            $line++;

            $parts = gplcart_string_explode_whitespace($condition, 3);
            $condition_id = array_shift($parts);
            $operator = array_shift($parts);
            $parameters = array_filter(explode(',', implode('', $parts)), function ($value) {
                return $value !== '';
            });

            if (empty($parameters)) {
                $errors[] = $line;
                continue;
            }

            if (!in_array(htmlspecialchars($operator), $operators)) {
                $errors[] = $line;
                continue;
            }

            $args = array($parameters, $operator, $condition_id, $submitted);
            $result = $this->validateConditionTrigger($condition_id, $args);

            if ($result !== true) {
                $errors[] = $line;
                continue;
            }

            $modified[] = array(
                'weight' => $line,
                'id' => $condition_id,
                'value' => $parameters,
                'operator' => $operator,
                'original' => "$condition_id $operator " . implode(',', $parameters),
            );
        }

        if (!empty($errors)) {
            $error = $this->translation->text('Error in @num definition', array('@num' => implode(',', $errors)));
            $this->setError($field, $error);
        }

        if ($this->isError()) {
            return false;
        }

        $this->setSubmitted($field, $modified);
        return true;
    }
32140
public function onRun()
    {
        //Get element slug
        $sElementSlug = $this->property('slug');
        if (empty($sElementSlug) && !$this->property('slug_required')) {
            return null;
        }

        if (empty($this->obElement)) {
            return $this->getErrorResponse();
        }

        return null;
    }
1283108
public function getOutcome()
    {
        if (isset($this->data['object']) && 'charge' === $this->data['object']) {
            if (isset($this->data['outcome']) && !empty($this->data['outcome'])) {
                return $this->data['outcome'];
            }
        }

        return null;
    }
870867
protected function doExecute()
    {
        $result = parent::doExecute();

        $this->console->database->setMonitor(new NullMonitor());

        return $result;
    }
782790
public function getDataForm()
    {
        $data = null;
        foreach ($this->dicionario as $meta)
            $data[$meta->getColumn()] = $meta->getValue();

        return $data;
    }
34469
public function getCurrentActionName()
    {
        return isset($this->action_names[$this->position]) ? $this->action_names[$this->position] : null;
    }
225318
public function getProcedureDescription()
    {
        if (! (isset($this->_gemsData['gap_id_procedure']) && $this->_gemsData['gap_id_procedure'])) {
            return null;
        }
        if (!array_key_exists('gapr_name', $this->_gemsData)) {
            $sql = "SELECT gapr_name FROM gems__agenda_procedures WHERE gapr_id_procedure = ?";

            $this->_gemsData['gapr_name'] = $this->db->fetchOne($sql, $this->_gemsData['gap_id_procedure']);

            // Cleanup db result
            if (false === $this->_gemsData['gapr_name']) {
                $this->_gemsData['gapr_name'] = null;
            }
        }
        return $this->_gemsData['gapr_name'];
    }
621149
protected function validateValueRating()
    {
        $field = 'rating';

        if ($this->isExcluded($field)) {
            return null;
        }

        $value = $this->getSubmitted($field);
        $label = $this->translation->text('Rating');

        if (!isset($value)) {
            $this->setErrorRequired($field, $label);
            return false;
        }

        if (!is_numeric($value)) {
            $this->setErrorNumeric($field, $label);
            return false;
        }

        if ($value > 5) {
            $this->setErrorInvalid($field, $label);
            return false;
        }

        return true;
    }
517709
public function nextEvent()
    {
        $next = $this->eventManager()->next();

        if (!$next) {
            return null;
        }

        return $this->eventFormatNav($next);
    }
1118872
function get_data() {
        $mform =& $this->_form;

        if (!$this->is_cancelled() and $this->is_submitted() and $this->is_validated()) {
            $data = $mform->exportValues();
            unset($data['sesskey']); // we do not need to return sesskey
            unset($data['_qf__'.$this->_formname]);   // we do not need the submission marker too
            if (empty($data)) {
                return NULL;
            } else {
                return (object)$data;
            }
        } else {
            return NULL;
        }
    }
791432
public function process()
    {
        $expr = $this->getExpression();
        $state = $this->getState();

        $var = $state->getVariable($expr->getIdentifier());

        return ($var === null) ? null : $var->getDefaultValue();
    }
991952
private function getDemo()
	{
		$demo = isset($_GET['demo']) ? $_GET['demo'] : null;

		// simple security
		if (!array_key_exists($demo, $this->available_demos))
			$demo = null;

		return $demo;
	}
1190966
public function process()
    {
        $operands = $this->getOperands();
        $expression = $this->getExpression();

        if ($operands->containsNull() === true) {
            return null;
        }

        if ($operands->sameCardinality() === false) {
            $msg = "The Match Expression only accepts operands with the same cardinality.";
            throw new OperatorProcessingException($msg, $this, OperatorProcessingException::WRONG_CARDINALITY);
        }

        if ($operands->sameBaseType() === false) {
            $msg = "The Match Expression only accepts operands with the same baseType.";
            throw new OperatorProcessingException($msg, $this, OperatorProcessingException::WRONG_BASETYPE);
        }

        $firstOperand = $operands[0];
        $secondOperand = $operands[1];

        if ($operands[0] instanceof Comparable) {
            // 2 containers to compare.
            return new QtiBoolean($operands[0]->equals($operands[1]));
        } else {
            return new QtiBoolean($operands[0] === $operands[1]);
        }
    }